Message ID | 20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264@wolfvision.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3643629vqo; Wed, 10 May 2023 06:59:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66S+tAmIhonXvBSetGLFWrFSvCLmCOLJcr5dii2/s+C+wMg1GYPYXBeZdlusuVtM86kZKS X-Received: by 2002:a17:903:2451:b0:1ab:142a:3dd7 with SMTP id l17-20020a170903245100b001ab142a3dd7mr20428981pls.68.1683727144903; Wed, 10 May 2023 06:59:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683727144; cv=pass; d=google.com; s=arc-20160816; b=gphAv4fltdRpaVIwJ9VG06R0BoOJ3PoqqWfQDaj+vwdf0Lh8CKSiNZwoZbC96YwIwc 0iMH56y0IV8S4pY11CdK0ejnT2iTQVsIWqRAjUj2WREDhiixRvQIqJCOx2mbcNGU4NPf mYqs0cr//QoBIQ/zBHpOnUi79TSCxU9ApmgBxkOpGQ2v1lXjVjhdPd5FPO/l1OeO/8gC LQFkjUL8Rma2ZW9ArWkL/o0jEj6iD8Kxespjp006aLnL0j431z6TMj/l0jk82LGCQMlt ckGLfo7UuvWVHNkhPL4XbnifbP7d2D0G4sGplVwigdfImP7lLW5p2v6prDTHTNv91iKU 5wrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:in-reply-to:references :message-id:content-transfer-encoding:subject:date:from :dkim-signature; bh=LOuqX80ES/n3XjsvI7/oioFCWoheiOJW/6TgOGVbclM=; b=wFw4RPOc9ricRZxXb6xWa8q1UEn4RvkEbUygppj9JkvXlsUQT8iiz8IUJMzIuPm6iU haGLtrDabq9Xs52tCiG5h3KMC3t02RFn15tjOoN8E6gMZUd1M/7/Fn/C8Z3aEZOggbwW l87kqybDWnw3Kj1q524pxS42BFJ/p/DCn766hdL2gRACFhiPOA4jTmnom9FHMIppJlE9 5omekFIa5xfG6gJDUgI9PFwOeRZkNMkmSUAQJNRpm8VFQMMFkmoV8D4PAA7kmbW+ZOVz cm2JPPh/seGRS7rclaq4Go776BHNNkZSWxzWDKwzqWbpxGlqF3KIb/+AxiO0wGm880j9 Yckw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=WgdWAUaF; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a170902c15300b001aadf9e2d15si4094543plj.491.2023.05.10.06.58.52; Wed, 10 May 2023 06:59:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=WgdWAUaF; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237313AbjEJNxN (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Wed, 10 May 2023 09:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236975AbjEJNw4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 10 May 2023 09:52:56 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on20602.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaf::602]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82844DC54; Wed, 10 May 2023 06:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vt5/nr0qEKeaNQdjfBTR+T11sr1l9/Nb6BCj552HU6+ED4KmhPhobLJI+AtCqQampY2t6LEwkB2P2nd6l8WbkyJMvC49GDymfvq2mis4BB+WlqkJr6E9cQd5PjJWb0QOSnyo5SkPyLLqMnlTqEgyojjKnFpUHDiRtQQxSjvUMrOzNRMRwfFKLSzv5p3hChAh8RlfLTvLHtvxdfB4wwCH3cDZ2CpSB1U2YtY+TYteG2hLKxbXJCWejcDDHTMQPLdKDZNe28JS+IEsembknI9vC4LZg95ICh1CJciDfbK9tWEznTzUxzoMTcTDlRBEt+DvcR8w935ParCzLa7789QHrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LOuqX80ES/n3XjsvI7/oioFCWoheiOJW/6TgOGVbclM=; b=mZS1APL6mf++221zv3eW30stDIkJSp12g0a5fyrtdk20iaaXeaNGQab09y2QP3p5XZz82MThovXPk7Conr/KDGAlZdT4g4VoJDTPgc/dBnDu60RnPgnXH2Izhub/F8dZYspH59xxgf46Z0pfn00QEfS4AfeI4Wzpn9ecnGCjR7bC1yHMT6ZDtSx8f4F7wOmPw//qUD+VtTrHKwU60sK/73Yhl99HacIe0yICNwLKimYTQQYGHT8U3tRTCMhNTgYNPe4ssOZQYLcWeDBTMjP1e3IvqeJtDqvFwjoDCwW8PTHucby0s8gqSOAkwDcGvtGH8ztPV5VOgxZ2BtEcJK+uHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LOuqX80ES/n3XjsvI7/oioFCWoheiOJW/6TgOGVbclM=; b=WgdWAUaF6oEGyX1fPeyT/+/rrWm6NJ8ttHqk3NO24OTPcwDcHHkkgm74dk+jWVszYT7T7PZIhRUoCRud22Xmg3Q0pKqE8Qpv+l2gkQtUuqw+AFxEA3a62CHfjcirxzFQzhhv8UvYBLVSO8/mJ+Y8NlXxv31V/AR42x/xEEHrjIo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by PAWPR08MB10212.eurprd08.prod.outlook.com (2603:10a6:102:369::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19; Wed, 10 May 2023 13:51:13 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d%4]) with mapi id 15.20.6387.019; Wed, 10 May 2023 13:51:13 +0000 From: Javier Carrasco <javier.carrasco@wolfvision.net> Date: Wed, 10 May 2023 15:50:48 +0200 Subject: [PATCH 3/4] Input: st1232 - add virtual touchscreen and buttons handling Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264@wolfvision.net> References: <20230510-feature-ts_virtobj_patch-v1-0-5ae5e81bc264@wolfvision.net> In-Reply-To: <20230510-feature-ts_virtobj_patch-v1-0-5ae5e81bc264@wolfvision.net> To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Henrik Rydberg <rydberg@bitmath.org>, Bastian Hecht <hechtb@gmail.com>, Michael Riesch <michael.riesch@wolfvision.net> Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, Javier Carrasco <javier.carrasco@wolfvision.net> X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683726670; l=5714; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=fWrCGxaXlY48WwSbRN/CYfxP5nues3x9k/+33c+j4hk=; b=aVn1MhrI4JhXOMAF279flCvJahcG4mP/BJWunH9hIKJheOxmF6mGL10i+kBzbNeNiK308QbdY W1JeUKzqa8qCmnlafjvuy0mSPtjh2rbx3PPvsDufKP7aw5JMxuUHj+N X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR0102CA0093.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::34) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|PAWPR08MB10212:EE_ X-MS-Office365-Filtering-Correlation-Id: 232d81bc-852d-428c-00c8-08db515d9dcd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i5s+7sy7N1zpBERTKW773zpFALz/rNXAWBMCaz7tsDi3jfFAhxmkpgAPUlpoYrS7n1QC+4C4mglcwWNqjhVt+/4seM9OEJVzujEaYS2TLEyrV4LV9PLJz6ytCXc09DL6v/O0Fqu4VFlsHNGz9OTkUFa19jqHwqEIVfMGxg4M/SzmYk9Ey/wVU9kOhKWyMJMwJZMPyvIZ4QzYLfUNL0UBTf+hzaK6aLIh8G4NCnBheJp7QWewUakmbggPUVqtAEqiLC6xgYgqs+akepb5nqHnAUcg+0i4iI/Phe9fJBNqR0ybkPTxHfXiPhjL1egIAmbbXQjelIEACehHKwdZVwpKIulbHa/9uf5hHAW4+48ZHivkbIjfO9VVb5aXYmPAuWEehggaxyaokP1oxTYfCOu4YcIiGWxNcqlGiqBpplkA0kKEBbTF1XBsDrYMF2LIIyiIN/puBRpO8AJWTy8Opmq4oGk0abw/68xrGXB4b/uKF+GOxctR+PbfxFbQKYEvHJ4JAS2MW5ChUbYBfNVQspZ6NuVpuSkuyvvuE4wWB0kE6S6bsZHdBn04a9xu98HLWiFVEPtz/iy9mDLlpH1edC/YkuqagCayQsjRcAOaiJ2lWLcA1kQTpYXuT1BG+KM9kfYu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(376002)(136003)(39850400004)(396003)(451199021)(86362001)(36756003)(6666004)(110136005)(316002)(6636002)(4326008)(66476007)(52116002)(478600001)(66946007)(66556008)(6486002)(41300700001)(5660300002)(44832011)(8936002)(8676002)(2906002)(38100700002)(38350700002)(186003)(2616005)(26005)(6512007)(107886003)(6506007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QLowoXt/LQPR2txVpupDugsB1tAU?= =?utf-8?q?xaTwtcNhDRTruC7jXWmHCPv315g0xRQXnbMMNrCq2arDgk6/qthZEd++DDv3Xofs5?= =?utf-8?q?NglI8TLNtvQMMjQlZq3WQOL72goBcoNT25SUjt1iH8HScl4rZ1Y+dJ7bxm7OGv690?= =?utf-8?q?VIc1xvs6qVJIdYupotKd31h6GtXIlSaOvmoAyxiWqr3WoVgo1niKYmboOc47/xmyN?= =?utf-8?q?D/4qcWp5aksiI9w4uldkOJcRmsh6k4mxMB9dZrmGI+Z1OqLIwhq1Flu0C67G+8pfp?= =?utf-8?q?3wu+CQ5u9HrI9IKnJ7k+yLsrnHpaPSoZNrGqb3XUw6wm3uYH/ppfP8ars5vvwPKKk?= =?utf-8?q?x2n01IDncFWYfLGe6rfK5uSNhLv+gnIPtHFEtGC2CCo8PtL4TzV4NVrv/9JBq94TY?= =?utf-8?q?4cFKYdu9To1b2Q0n5exZv8I/vrXaPSzgUYKS7PbhbsohabBXsNyu+RrjluMTn+2IJ?= =?utf-8?q?9TyvPLLTwOvRjunlrFOu+7dGzvCZnvtNIil05O7CzYpOGky1Bc64+tjLh+Ai66Lxy?= =?utf-8?q?XqUdq4Hat1nNd2ojRabziPVMnfFj3s08CN7V6fslsK+MxMgKt/BVxzlARxSGgKUav?= =?utf-8?q?IK9qqNNyOdXlmzU/9RqbMigXXJI2yc8OBh8LeNvmVvNhYI/R2QWb6jpZhZSWrr7uF?= =?utf-8?q?BUxAtcMItWHb8lxM0s5bKk3mK60SfsyxkAl1aqw6pP2IPnJm+lij7LCj559bhtYbT?= =?utf-8?q?7FDW95y4eHIJ41R/7f+1+MgMW2m5LFDRksCISDlE1fX5HsKL+vOZgW+lateZ3vAKy?= =?utf-8?q?GWZ3CCgUx3tojQjphVWJPQ0AI5m7xcQSr2qHnlA4PECKdnKMwquAxpjOgiDn5le0m?= =?utf-8?q?7/tipmBKQkSlwpimBmRZNHvStLMucWtvTE5NrcL3rYqM6yYNpbAklFJP9bxEZ6pEm?= =?utf-8?q?CSiq0z1yDm7A086VDEpbIaTVG1KyPQiA39cfYwYaZaJB8YhE+HnFM+49IBJKumbl7?= =?utf-8?q?FXB+rJgGgSlIf1OvAmyYLrHkk2lqZ/JLex6TO6Nk/vH0bHX4RCQLq23B94he2RBbh?= =?utf-8?q?bRHUGKPbf+ulRqNzBD1gh5QEBKvDFJRY1xpLMqfVf7uDiac3my9vIRAhQR99XdJBL?= =?utf-8?q?Ec6nDc64ctZvf3wzf5k9lzoL1xukaTk7J/UbNm3jAgoa8Km3ZNeDuYWL5sMol9mAF?= =?utf-8?q?71O5240ujtV5IB3ttu+LkMWu1xDm8IPGF38c37xjvNW1FLFa5gzRHrNU4JRb5dIC/?= =?utf-8?q?G+7BpFHCGvEeYCJITX+e6l3FnmTb5XY5TQ1TZAash4Ex5f3fYrnkgSle5WKWRW79S?= =?utf-8?q?lzGZCQmj+GMxYwRr+v6OGX8N+3+UsW0GwAlUJu0izfoFnNwwsdMjc7kO41sGKW18q?= =?utf-8?q?iMkET6AJjHX38UiL35wuCa/VIPnp8BaqhjuBLAKE+dZC6W66HIyOqGPqks87efnmP?= =?utf-8?q?yeMRTFKwY9yK7TBTGhCJQNw94D14anddlDyFLogoRUwXAARD9MJpjsaOHH+MHTYDv?= =?utf-8?q?6einbV1IZOze5Jc8j18O94K/drCqki7EnxmQK8KmU4IUvlBgO7M5Cx9roVC97sfUv?= =?utf-8?q?1lPgVybXnrDOBTO+graVPBh9VFq8QG6D6sUcvEbFYzjHe+0kFEklE5g=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 232d81bc-852d-428c-00c8-08db515d9dcd X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 13:51:13.0848 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w3HvyBafXPCY0h1FuzM/JTxPCcX58gjEz3jzKVVGbuXvpAOlTAhAxvjIy6m8RwQWQ28nLBuMKPU6ekHUny0ILch9WMErqGy3RMKqHkX0qPU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10212 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765515874359336725?= X-GMAIL-MSGID: =?utf-8?q?1765515874359336725?= |
Series |
Input: support virtual objects on touchscreens
|
|
Commit Message
Javier Carrasco
May 10, 2023, 1:50 p.m. UTC
Use ts-virtobj to support overlay objects such as buttons and resized
frames defined in the device tree.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
drivers/input/touchscreen/st1232.c | 87 ++++++++++++++++++++++++++++++--------
1 file changed, 69 insertions(+), 18 deletions(-)
Comments
Hi Javier, kernel test robot noticed the following build errors: [auto build test ERROR on ac9a78681b921877518763ba0e89202254349d1b] url: https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 base: ac9a78681b921877518763ba0e89202254349d1b patch link: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264%40wolfvision.net patch subject: [PATCH 3/4] Input: st1232 - add virtual touchscreen and buttons handling config: arm-randconfig-m041-20230514 (https://download.01.org/0day-ci/archive/20230514/202305140640.VLcvhR5G-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 git checkout 133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202305140640.VLcvhR5G-lkp@intel.com/ All errors (new ones prefixed by >>): arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_parse_and_report': >> st1232.c:(.text+0x148): undefined reference to `ts_virtobj_is_button_slot' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x15e): undefined reference to `ts_virtobj_button_press' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x16c): undefined reference to `ts_virtobj_mt_on_touchscreen' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x242): undefined reference to `ts_virtobj_mapped_buttons' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x266): undefined reference to `ts_virtobj_is_button_slot' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x276): undefined reference to `ts_virtobj_button_release' arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_probe': >> st1232.c:(.text+0x42c): undefined reference to `ts_virtobj_map_objects' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x43c): undefined reference to `ts_virtobj_mapped_touchscreen' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x44a): undefined reference to `ts_virtobj_get_touchscreen_abs' arm-linux-gnueabi-ld: st1232.c:(.text+0x520): undefined reference to `ts_virtobj_mapped_buttons' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x542): undefined reference to `ts_virtobj_set_button_caps'
On 14.05.23 00:38, kernel test robot wrote: > Hi Javier, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on ac9a78681b921877518763ba0e89202254349d1b] > > url: https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 > base: ac9a78681b921877518763ba0e89202254349d1b > patch link: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264%40wolfvision.net > patch subject: [PATCH 3/4] Input: st1232 - add virtual touchscreen and buttons handling > config: arm-randconfig-m041-20230514 (https://download.01.org/0day-ci/archive/20230514/202305140640.VLcvhR5G-lkp@intel.com/config) > compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 > git checkout 133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202305140640.VLcvhR5G-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_parse_and_report': >>> st1232.c:(.text+0x148): undefined reference to `ts_virtobj_is_button_slot' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x15e): undefined reference to `ts_virtobj_button_press' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x16c): undefined reference to `ts_virtobj_mt_on_touchscreen' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x242): undefined reference to `ts_virtobj_mapped_buttons' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x266): undefined reference to `ts_virtobj_is_button_slot' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x276): undefined reference to `ts_virtobj_button_release' > arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_probe': >>> st1232.c:(.text+0x42c): undefined reference to `ts_virtobj_map_objects' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x43c): undefined reference to `ts_virtobj_mapped_touchscreen' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x44a): undefined reference to `ts_virtobj_get_touchscreen_abs' > arm-linux-gnueabi-ld: st1232.c:(.text+0x520): undefined reference to `ts_virtobj_mapped_buttons' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x542): undefined reference to `ts_virtobj_set_button_caps' > Apparently there is something wrong about the references from this patch to a previous one from the same series ([PATCH 1/4] Input: ts-virtobj - Add touchs[c]reen virtual object handling). The "url" link shows all patches of this series in the right order though. All these functions are declared in the linux/input/ts-virtobj.h header and also inline-defined there if ts-virtobj is not selected. If it is selected (either y or M), the functions are exported from driver/input/touchscreen/ts-virtobj.c. According to the error report, ts-virtobj was selected as a module. I could build the kernel with the three possible configurations (ts-virtobj y/n/M) for x86_64 as well as for arm64 with no errors or warnings repeatedly, so I am a bit confused now. I am probably missing something, but I do not know what. I wonder if the new file where the functions are defined (ts-virtobj.c) could not be found by some reason or if the test build does not like the way I handled the function declaration/definition. Any hint or advice would be more than welcome.
On 15/05/2023 06:34, Javier Carrasco wrote: > On 14.05.23 00:38, kernel test robot wrote: >> Hi Javier, >> >> kernel test robot noticed the following build errors: >> >> [auto build test ERROR on ac9a78681b921877518763ba0e89202254349d1b] >> >> url: https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 >> base: ac9a78681b921877518763ba0e89202254349d1b >> patch link: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264%40wolfvision.net >> patch subject: [PATCH 3/4] Input: st1232 - add virtual touchscreen and buttons handling >> config: arm-randconfig-m041-20230514 (https://download.01.org/0day-ci/archive/20230514/202305140640.VLcvhR5G-lkp@intel.com/config) >> compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 >> reproduce (this is a W=1 build): >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> # https://github.com/intel-lab-lkp/linux/commit/133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 >> git remote add linux-review https://github.com/intel-lab-lkp/linux >> git fetch --no-tags linux-review Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 >> git checkout 133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 >> # save the config file >> mkdir build_dir && cp config build_dir/.config >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash >> >> If you fix the issue, kindly add following tag where applicable >> | Reported-by: kernel test robot <lkp@intel.com> >> | Link: https://lore.kernel.org/oe-kbuild-all/202305140640.VLcvhR5G-lkp@intel.com/ >> >> All errors (new ones prefixed by >>): >> >> arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_parse_and_report': >>>> st1232.c:(.text+0x148): undefined reference to `ts_virtobj_is_button_slot' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x15e): undefined reference to `ts_virtobj_button_press' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x16c): undefined reference to `ts_virtobj_mt_on_touchscreen' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x242): undefined reference to `ts_virtobj_mapped_buttons' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x266): undefined reference to `ts_virtobj_is_button_slot' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x276): undefined reference to `ts_virtobj_button_release' >> arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_probe': >>>> st1232.c:(.text+0x42c): undefined reference to `ts_virtobj_map_objects' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x43c): undefined reference to `ts_virtobj_mapped_touchscreen' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x44a): undefined reference to `ts_virtobj_get_touchscreen_abs' >> arm-linux-gnueabi-ld: st1232.c:(.text+0x520): undefined reference to `ts_virtobj_mapped_buttons' >>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x542): undefined reference to `ts_virtobj_set_button_caps' >> > Apparently there is something wrong about the references from this patch > to a previous one from the same series ([PATCH 1/4] Input: ts-virtobj - > Add touchs[c]reen virtual object handling). The "url" link shows all > patches of this series in the right order though. > > All these functions are declared in the linux/input/ts-virtobj.h header > and also inline-defined there if ts-virtobj is not selected. If it is > selected (either y or M), the functions are exported from > driver/input/touchscreen/ts-virtobj.c. According to the error report, > ts-virtobj was selected as a module. > > I could build the kernel with the three possible configurations > (ts-virtobj y/n/M) for x86_64 as well as for arm64 with no errors or > warnings repeatedly, so I am a bit confused now. I am probably > missing something, but I do not know what. > > I wonder if the new file where the functions are defined (ts-virtobj.c) > could not be found by some reason or if the test build does not like the > way I handled the function declaration/definition. Any hint or advice > would be more than welcome. The report is correct. Build driver builtin and your virtual as module. Best regards, Krzysztof
On 15.05.23 08:43, Krzysztof Kozlowski wrote: > On 15/05/2023 06:34, Javier Carrasco wrote: >> On 14.05.23 00:38, kernel test robot wrote: >>> Hi Javier, >>> >>> kernel test robot noticed the following build errors: >>> >>> [auto build test ERROR on ac9a78681b921877518763ba0e89202254349d1b] >>> >>> url: https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 >>> base: ac9a78681b921877518763ba0e89202254349d1b >>> patch link: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-3-5ae5e81bc264%40wolfvision.net >>> patch subject: [PATCH 3/4] Input: st1232 - add virtual touchscreen and buttons handling >>> config: arm-randconfig-m041-20230514 (https://download.01.org/0day-ci/archive/20230514/202305140640.VLcvhR5G-lkp@intel.com/config) >>> compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 >>> reproduce (this is a W=1 build): >>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >>> chmod +x ~/bin/make.cross >>> # https://github.com/intel-lab-lkp/linux/commit/133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 >>> git remote add linux-review https://github.com/intel-lab-lkp/linux >>> git fetch --no-tags linux-review Javier-Carrasco/Input-ts-virtobj-Add-touchsreen-virtual-object-handling/20230510-215519 >>> git checkout 133c0f8c33dc5e70a72e6a7d670e133b6043a7a3 >>> # save the config file >>> mkdir build_dir && cp config build_dir/.config >>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig >>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash >>> >>> If you fix the issue, kindly add following tag where applicable >>> | Reported-by: kernel test robot <lkp@intel.com> >>> | Link: https://lore.kernel.org/oe-kbuild-all/202305140640.VLcvhR5G-lkp@intel.com/ >>> >>> All errors (new ones prefixed by >>): >>> >>> arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_parse_and_report': >>>>> st1232.c:(.text+0x148): undefined reference to `ts_virtobj_is_button_slot' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x15e): undefined reference to `ts_virtobj_button_press' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x16c): undefined reference to `ts_virtobj_mt_on_touchscreen' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x242): undefined reference to `ts_virtobj_mapped_buttons' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x266): undefined reference to `ts_virtobj_is_button_slot' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x276): undefined reference to `ts_virtobj_button_release' >>> arm-linux-gnueabi-ld: drivers/input/touchscreen/st1232.o: in function `st1232_ts_probe': >>>>> st1232.c:(.text+0x42c): undefined reference to `ts_virtobj_map_objects' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x43c): undefined reference to `ts_virtobj_mapped_touchscreen' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x44a): undefined reference to `ts_virtobj_get_touchscreen_abs' >>> arm-linux-gnueabi-ld: st1232.c:(.text+0x520): undefined reference to `ts_virtobj_mapped_buttons' >>>>> arm-linux-gnueabi-ld: st1232.c:(.text+0x542): undefined reference to `ts_virtobj_set_button_caps' >>> >> Apparently there is something wrong about the references from this patch >> to a previous one from the same series ([PATCH 1/4] Input: ts-virtobj - >> Add touchs[c]reen virtual object handling). The "url" link shows all >> patches of this series in the right order though. >> >> All these functions are declared in the linux/input/ts-virtobj.h header >> and also inline-defined there if ts-virtobj is not selected. If it is >> selected (either y or M), the functions are exported from >> driver/input/touchscreen/ts-virtobj.c. According to the error report, >> ts-virtobj was selected as a module. >> >> I could build the kernel with the three possible configurations >> (ts-virtobj y/n/M) for x86_64 as well as for arm64 with no errors or >> warnings repeatedly, so I am a bit confused now. I am probably >> missing something, but I do not know what. >> >> I wonder if the new file where the functions are defined (ts-virtobj.c) >> could not be found by some reason or if the test build does not like the >> way I handled the function declaration/definition. Any hint or advice >> would be more than welcome. > > The report is correct. Build driver builtin and your virtual as module. You are right, that was the configuration I was missing, which I honestly did not even consider when I tested this feature. The problem seems to be that I am using the IS_ENABLED macro which returns true if selected as a module, but the define is in that case CONFIG_TOUCHSCREEN_TS_VIRTOBJ_MODULE instead of CONFIG_TOUCHSCREEN_TS_VIRTOBJ. As I am using the latter define in the Makefile, it does not get compiled. I am testing the IS_REACHABLE macro for the header instead, which I think is the right one in this case and actually fixes the bug. I am telling you that just in case I am talking nonsense to save everyone from a pointless v2. But first I will go through all possible combinations between my virtual and a touchscreen driver before I submit a broken v2, where I will also provide an improved documentation as you suggested. Thanks a lot again! > > Best regards, > Krzysztof >
On 15/05/2023 10:33, Javier Carrasco wrote: >>> All these functions are declared in the linux/input/ts-virtobj.h header >>> and also inline-defined there if ts-virtobj is not selected. If it is >>> selected (either y or M), the functions are exported from >>> driver/input/touchscreen/ts-virtobj.c. According to the error report, >>> ts-virtobj was selected as a module. >>> >>> I could build the kernel with the three possible configurations >>> (ts-virtobj y/n/M) for x86_64 as well as for arm64 with no errors or >>> warnings repeatedly, so I am a bit confused now. I am probably >>> missing something, but I do not know what. >>> >>> I wonder if the new file where the functions are defined (ts-virtobj.c) >>> could not be found by some reason or if the test build does not like the >>> way I handled the function declaration/definition. Any hint or advice >>> would be more than welcome. >> >> The report is correct. Build driver builtin and your virtual as module. > > You are right, that was the configuration I was missing, which I > honestly did not even consider when I tested this feature. > > The problem seems to be that I am using the IS_ENABLED macro which > returns true if selected as a module, but the define is in that case > CONFIG_TOUCHSCREEN_TS_VIRTOBJ_MODULE instead of > CONFIG_TOUCHSCREEN_TS_VIRTOBJ. As I am using the latter define in the > Makefile, it does not get compiled. This could be proper solution for build failure but does not look like the proper solution for entire choice/design. The questions are: why TOUCHSCREEN_TS_VIRTOBJ should be selectable by user? How can user know that he needs a driver with VIRTOBJ? I think he cannot and your config help option suggests that: "you are using a touchscreen driver that supports printed overlays". What driver supports or not, is a job for kernel developers. Not for kernel configurators or distros. User should never investigate whether his touchscreen driver support printed overlays. Why would user like to dig into kernel to know that? Thus either your driver should select VIRTOBJ or depend on it. Best regards, Krzysztof
On 15.05.23 10:41, Krzysztof Kozlowski wrote: > On 15/05/2023 10:33, Javier Carrasco wrote: >>>> All these functions are declared in the linux/input/ts-virtobj.h header >>>> and also inline-defined there if ts-virtobj is not selected. If it is >>>> selected (either y or M), the functions are exported from >>>> driver/input/touchscreen/ts-virtobj.c. According to the error report, >>>> ts-virtobj was selected as a module. >>>> >>>> I could build the kernel with the three possible configurations >>>> (ts-virtobj y/n/M) for x86_64 as well as for arm64 with no errors or >>>> warnings repeatedly, so I am a bit confused now. I am probably >>>> missing something, but I do not know what. >>>> >>>> I wonder if the new file where the functions are defined (ts-virtobj.c) >>>> could not be found by some reason or if the test build does not like the >>>> way I handled the function declaration/definition. Any hint or advice >>>> would be more than welcome. >>> >>> The report is correct. Build driver builtin and your virtual as module. >> >> You are right, that was the configuration I was missing, which I >> honestly did not even consider when I tested this feature. >> >> The problem seems to be that I am using the IS_ENABLED macro which >> returns true if selected as a module, but the define is in that case >> CONFIG_TOUCHSCREEN_TS_VIRTOBJ_MODULE instead of >> CONFIG_TOUCHSCREEN_TS_VIRTOBJ. As I am using the latter define in the >> Makefile, it does not get compiled. > > This could be proper solution for build failure but does not look like > the proper solution for entire choice/design. The questions are: why > TOUCHSCREEN_TS_VIRTOBJ should be selectable by user? How can user know > that he needs a driver with VIRTOBJ? > > I think he cannot and your config help option suggests that: > "you are using a touchscreen driver that supports printed overlays". > What driver supports or not, is a job for kernel developers. Not for > kernel configurators or distros. User should never investigate whether > his touchscreen driver support printed overlays. Why would user like to > dig into kernel to know that? Thus either your driver should select > VIRTOBJ or depend on it. > I was thinking about the minimal savings (inline functions that just return a value and the size of the ts-virtobj object itself) that could be obtained if the touchscreen does not need the functionality at all. But probably those savings are negligible and there will not be many cases where the user will know if that applies. I agree, the feature will be selected by drivers that support it. That actually simplifies the code a little bit. > Best regards, > Krzysztof >
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index f49566dc96f8..b8139b7daa40 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -22,6 +22,7 @@ #include <linux/pm_qos.h> #include <linux/slab.h> #include <linux/types.h> +#include <linux/input/ts-virtobj.h> #define ST1232_TS_NAME "st1232-ts" #define ST1633_TS_NAME "st1633-ts" @@ -56,6 +57,8 @@ struct st1232_ts_data { struct touchscreen_properties prop; struct dev_pm_qos_request low_latency_req; struct gpio_desc *reset_gpio; + struct input_dev *virtual_keypad; + struct ts_virtobj_map *map; const struct st_chip_info *chip_info; int read_buf_len; u8 *read_buf; @@ -129,10 +132,12 @@ static int st1232_ts_read_resolution(struct st1232_ts_data *ts, u16 *max_x, static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) { - struct input_dev *input = ts->input_dev; + struct input_dev *tscreen = ts->input_dev; + __maybe_unused struct input_dev *keypad = ts->virtual_keypad; struct input_mt_pos pos[ST_TS_MAX_FINGERS]; u8 z[ST_TS_MAX_FINGERS]; int slots[ST_TS_MAX_FINGERS]; + __maybe_unused bool button_pressed[ST_TS_MAX_FINGERS]; int n_contacts = 0; int i; @@ -143,6 +148,15 @@ static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) unsigned int x = ((buf[0] & 0x70) << 4) | buf[1]; unsigned int y = ((buf[0] & 0x07) << 8) | buf[2]; + /* forward button presses to the keypad input device */ + if (ts_virtobj_is_button_slot(ts->map, i) || + ts_virtobj_button_press(ts->map, keypad, x, y, i)) { + button_pressed[i] = true; + continue; + } + /* Ignore events out of the virtual screen if defined */ + if (!ts_virtobj_mt_on_touchscreen(ts->map, &x, &y)) + continue; touchscreen_set_mt_pos(&pos[n_contacts], &ts->prop, x, y); @@ -154,18 +168,25 @@ static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) } } - input_mt_assign_slots(input, slots, pos, n_contacts, 0); + input_mt_assign_slots(tscreen, slots, pos, n_contacts, 0); for (i = 0; i < n_contacts; i++) { - input_mt_slot(input, slots[i]); - input_mt_report_slot_state(input, MT_TOOL_FINGER, true); - input_report_abs(input, ABS_MT_POSITION_X, pos[i].x); - input_report_abs(input, ABS_MT_POSITION_Y, pos[i].y); + input_mt_slot(tscreen, slots[i]); + input_mt_report_slot_state(tscreen, MT_TOOL_FINGER, true); + input_report_abs(tscreen, ABS_MT_POSITION_X, pos[i].x); + input_report_abs(tscreen, ABS_MT_POSITION_Y, pos[i].y); if (ts->chip_info->have_z) - input_report_abs(input, ABS_MT_TOUCH_MAJOR, z[i]); + input_report_abs(tscreen, ABS_MT_TOUCH_MAJOR, z[i]); + } + input_mt_sync_frame(tscreen); + input_sync(tscreen); + + if (ts_virtobj_mapped_buttons(ts->map)) { + for (i = 0; i < ts->chip_info->max_fingers; i++) + if (ts_virtobj_is_button_slot(ts->map, i) && + !button_pressed[i]) + ts_virtobj_button_release(ts->map, keypad, i); + input_sync(keypad); } - - input_mt_sync_frame(input); - input_sync(input); return n_contacts; } @@ -226,6 +247,7 @@ static int st1232_ts_probe(struct i2c_client *client) const struct st_chip_info *match; struct st1232_ts_data *ts; struct input_dev *input_dev; + struct input_dev __maybe_unused *virtual_keypad; u16 max_x, max_y; int error; @@ -292,18 +314,28 @@ static int st1232_ts_probe(struct i2c_client *client) if (error) return error; - /* Read resolution from the chip */ - error = st1232_ts_read_resolution(ts, &max_x, &max_y); - if (error) { - dev_err(&client->dev, - "Failed to read resolution: %d\n", error); - return error; - } - if (ts->chip_info->have_z) input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, ts->chip_info->max_area, 0, 0); + /* map virtual objects if defined in the device tree */ + ts->map = ts_virtobj_map_objects(&ts->client->dev, ts->input_dev); + if (IS_ERR(ts->map)) + return PTR_ERR(ts->map); + + if (ts_virtobj_mapped_touchscreen(ts->map)) { + /* Read resolution from the virtual touchscreen if defined*/ + ts_virtobj_get_touchscreen_abs(ts->map, &max_x, &max_y); + } else { + /* Read resolution from the chip */ + error = st1232_ts_read_resolution(ts, &max_x, &max_y); + if (error) { + dev_err(&client->dev, + "Failed to read resolution: %d\n", error); + return error; + } + } + input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, max_x, 0, 0); input_set_abs_params(input_dev, ABS_MT_POSITION_Y, @@ -335,6 +367,25 @@ static int st1232_ts_probe(struct i2c_client *client) return error; } + /* Register keypad input device if virtual buttons were defined */ + if (ts_virtobj_mapped_buttons(ts->map)) { + virtual_keypad = devm_input_allocate_device(&client->dev); + if (!virtual_keypad) + return -ENOMEM; + + ts->virtual_keypad = virtual_keypad; + virtual_keypad->name = "st1232-keypad"; + virtual_keypad->id.bustype = BUS_I2C; + ts_virtobj_set_button_caps(ts->map, virtual_keypad); + error = input_register_device(ts->virtual_keypad); + if (error) { + dev_err(&client->dev, + "Unable to register %s input device\n", + virtual_keypad->name); + return error; + } + } + i2c_set_clientdata(client, ts); return 0;