From nobody Tue Nov 26 20:01:39 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2099.outbound.protection.outlook.com [40.107.104.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C93B8290F; Wed, 16 Oct 2024 04:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051374; cv=fail; b=MUAQuWw0o7N1QQZw4SvR8Zw5kjRiu8WrHHBG7jKTjG6x8gM8VzuXEl300bSEkAnliZZwZKeCDuXzerHpyHB0qlRQSWZPicGor/HskQ2gNH61q1rAwZVv9s0q5gUvM0i5IlPKe8z8w9H5BL03eumC6Q9Nu0/BYpnj7IgsLJTyUj0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051374; c=relaxed/simple; bh=yQHrhy/cLj8m5cwZywJZimlUvuzO6TSYXrE1Tzqpzjs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=eFOHrxsKyS3GX5zauX/WzM/T1Wbcdcfm/26Fg0WMi+rHMig1uQGDQ20lv/t9mvRdkhESUlKlUsHX0omt8XfNyJsRXpCp4rkzUTO2b47TCQXqY6hn8w4GiB/4TJUk3SlpRm58f9ZJLmW/dTEiWXaOWkG28qNz7rHxXS9r3gYLWH4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=OqLP5Smh; arc=fail smtp.client-ip=40.107.104.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="OqLP5Smh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C6uBeA3zjBFn7h+4f3Ky1G7Xpa0JGLu5RC5YwIvSVUTZG4qAbBtlyGd1W4Qz4grPGwHy8HnDXdah9XBIyFEZSr8KVxh3vBZqmIadoxiHHDzaAVJyueW5j/OVpKIVuYTbpXk99m8YN0P1j1TdUgcPDaYKSfMSwPulfdSvhnSQSn1XBF7rW9UOSE0uCDwjUInkW5bnPkm8FFjVbyihUXM9vr9vjvxRbBZivAi79ee0ad3k0H4VkkdPk6eMae+xBjvbhdvvwni0cTcgTYWuqMEy9W7TjnOV5MtfwV0Jkt9B6iKrhiffnW76rOKf8fbqxxU9RQ8Taun24ppZrGBpVWz6XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XBaP2zOuwSQ9ixzTarI2EZ4kIOrr2eYt2I5CT+KpXPM=; b=Qwo1Qq5ak25Texp1dgzN1Y4hBEyKvtZtIAnGmQaJBhTqWGRP1YWYfFPxA1uWBphe12xKhF6qjedrh9O9ouOgaFnTtfjVqUUF0xVRfUICKJjBllmkme6dEuJNPRqU3g0AK8EoAYVf8kL1gLrM40bP46fXIFTWVIf9pcFBPW8+LakMdceRUqycDpCVOI55Lnn5uvexs8CA0h5CaamOQp9iJy4DfV+aLUHIn5+hKw3RCCjIECOtgYJjXtvEN99Z8scXwwMqWXfhnlSgRVwr9rIYDZLoow0b8nPwiOT86+fbOaSf8wLSNxy/wd6+rQObTdnDrO1YzXvPDDja648vmI/bYw== 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=XBaP2zOuwSQ9ixzTarI2EZ4kIOrr2eYt2I5CT+KpXPM=; b=OqLP5Smhf4BfVBoAyM5r6NtYXK2aD9J2up+Ww7earZRCMJNbS/OeCyrJaX5rbhW2gvS2YQh2JHVjYTyfpFH1E4OxGKWhRm5zaBUTKBXcj1AeGn5sWJFTLZwhkbEskenuTR+xAy0xSHfEowmbI4cpeoeL5ZnmILuLyVF1l8bIE2U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) by PAWPR08MB10183.eurprd08.prod.outlook.com (2603:10a6:102:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 04:02:50 +0000 Received: from DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4]) by DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4%6]) with mapi id 15.20.8048.020; Wed, 16 Oct 2024 04:02:50 +0000 From: Javier Carrasco Date: Wed, 16 Oct 2024 06:02:40 +0200 Subject: [PATCH v11 1/4] dt-bindings: touchscreen: add touch-overlay property Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241016-feature-ts_virtobj_patch-v11-1-b292a1bbb0a1@wolfvision.net> References: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> In-Reply-To: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bastian Hecht , Michael Riesch Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , Jeff LaBundy X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1729051368; l=7148; i=javier.carrasco@wolfvision.net; s=20240617; h=from:subject:message-id; bh=yQHrhy/cLj8m5cwZywJZimlUvuzO6TSYXrE1Tzqpzjs=; b=ob0lSkhZOvOSkCPz6IQbJspuk7I1NAkYwGEAwH1zMNvCCDEakBcLwBo9N+9NJEL7T0AJRWnnK i7kVS6mjte1CUulxz/0avGy4PUtA0uK0bO2kkTFwlI2Yv7vp12yeYDZ X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=hfASRUP6l4lf3Lo2mjLM085/h37dT3m0Qj1HejXDPDc= X-ClientProxiedBy: VI1PR07CA0154.eurprd07.prod.outlook.com (2603:10a6:802:16::41) To DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR08MB9190:EE_|PAWPR08MB10183:EE_ X-MS-Office365-Filtering-Correlation-Id: c1578ee6-f8df-4b7c-007c-08dced9766c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VnpYSHV1TkduK0kvV2szbGRYZWxuV1NLcFloL0FWckVRVGJ6RzdNRnZjYXJs?= =?utf-8?B?cmJBRjkxRGRVU0xEYzlXVWtJNytyaDg1SHNpMWhBUnFUWGxIYnlFenY1ejdU?= =?utf-8?B?NXlzRGxnSWRFYy9Ba3Z2OG1nREMvWFg2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230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RHl4eW9LZHJHUVFuSDlIaWU3Y0h6OWJhZnRQMncwMlZHMFJwS1REcmpPbjdB?= =?utf-8?B?ZzBsQzRqR2pxcFR6YzhXVjVLYkpwYS9BbkpEWDAzRXJYMThRL09JL3h0dnQ0?= =?utf-8?B?S0QrR0I3VGFmWkN3VVFwNGtRMFNIMkY0Ymg0Z2t1cm0waHBEUmRnV2JTazIw?= =?utf-8?B?a2ErNDIrVlFmeHRNNDVmWm4wOXQ3Nzg0T1Z3Rk5ZZnU1bWhyR01iNmlKTmVZ?= =?utf-8?B?ZHFEVnhjaFIrRjNoMUtuVjFTVlFrWUJtV1poVXBscWwrZUdDeVdNSVB1WWM0?= =?utf-8?B?TnU0cGpxU0wxRjluMGVvNEZxRjZJLyttcFl3RHkxU0l6c0xZNnBNL3d3djZG?= =?utf-8?B?L0xYMXhPQjN6RTAvdnlhSWthM2Voc2xtdVEvVi9DQXB3RVdyU011UlRpUzZu?= =?utf-8?B?aW5Ca1ppV1I0dEFYQ0piUUNXVHcvYXBNRm9JbFQ2WWtMRVhPaTVHb3k5aVZ3?= =?utf-8?B?OWo0alJBc3oxNml2N1RMaENwSG8vY0t4N1dyV0Z6M2V1RHJoNzgvbndOV25n?= =?utf-8?B?TVRsRXNGMVc0dHhaU294YS9PZHVNTnM2WmpBcGlYQXc2WjZ2QStONHZ6czFm?= =?utf-8?B?STREeVVhMXJqajIzZ285b3BDZWFXOXRCcHFvTDlSVll4Y3JkQk5MbHVxcVJS?= =?utf-8?B?cktxOGNZUS9iWlNOMzdBcUtzazVTZE5IaWo3SW1Mc0FMYWJpNCsyUlNPVHJM?= =?utf-8?B?MUZycGhZTEFhZ0YvTmcrcFlyVVdrem13eWFBaGxwYmJNWEZMN3dPd0t1SVlP?= =?utf-8?B?bEFSdlM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?B?MVlqdEVlNnhuTXRhUkRBOHR1S003NENibUlvSnoyRDl2eHJlVEN4eHpHL01t?= =?utf-8?B?K2djeExSR2ptb01ZSE1jaVVRVEdBSXB5RDZSdEFrNzlDRTBvczRqWEdzUk9q?= =?utf-8?B?YkhSdUZqY1R1SndKdFNuNmhpa0FteXVsTjlieVg4ZnVYd0xMUnNKOFJOVWlC?= =?utf-8?B?TXU2Umh4bXdKVnNjVXJtYk92d1pJQjhjbUYyNkxHc1FBV0R6SjVyWEVMMVdu?= =?utf-8?B?TXlYVFJ0WEt0c2IySVMrMExLY0lyQlNjQmtWL0tmaGdVcEo5Ynpabzlrakcx?= =?utf-8?B?aytnb3FBWjlab00reHFhdXBPWTRqYzBVWlhMemFrY2dqampOM0lVZVZJWXQ5?= =?utf-8?B?cktYTTRsK29ldlNqUjAzcXFuaUpWTWpoNHhvRkRsUndPS00ydTIwcDY2SjIr?= =?utf-8?B?UnhKYWlZcFA2V0RXaGhCd0pBc1Q0U2ZZV3ZNVEY3aWZhNkQ1L0pPaHFjNkRq?= =?utf-8?Q?vaCYUZOIpsI2eFfWggNe298=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: c1578ee6-f8df-4b7c-007c-08dced9766c5 X-MS-Exchange-CrossTenant-AuthSource: DB4PR08MB9190.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 04:02:50.0983 (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: O1nN6UleeuNHLied8xn5mVlxFTQHugMyFSxJForwAhZSY6j2r0JNODJlxHjMHCuiGvAZpI07yTPGLIv8xsRylQ2RgzIpKK8W0sE69yputJ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10183 The touch-overlay encompasses a number of touch areas that define a clipped touchscreen area and/or buttons with a specific functionality. A clipped touchscreen area avoids getting events from regions that are physically hidden by overlay frames. For touchscreens with printed overlay buttons, sub-nodes with a suitable key code can be defined to report key events instead of the original touch events. Reviewed-by: Jeff LaBundy Reviewed-by: Rob Herring Signed-off-by: Javier Carrasco --- .../bindings/input/touchscreen/touchscreen.yaml | 119 +++++++++++++++++= ++++ 1 file changed, 119 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscree= n.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.ya= ml index 431c13335c40..3e3572aa483a 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml @@ -87,6 +87,125 @@ properties: touchscreen-y-plate-ohms: description: Resistance of the Y-plate in Ohms =20 + touch-overlay: + description: | + List of nodes defining segments (touch areas) on the touchscreen. + + This object can be used to describe a series of segments to restrict + the region within touch events are reported or buttons with a specif= ic + functionality. + + This is of special interest if the touchscreen is shipped with a phy= sical + overlay on top of it with a frame that hides some part of the origin= al + touchscreen area. Printed buttons on that overlay are also a typical + use case. + + A new touchscreen area is defined as a sub-node without a key code. = If a + key code is defined in the sub-node, it will be interpreted as a but= ton. + + The x-origin and y-origin properties of a touchscreen area define the + offset of a new origin from where the touchscreen events are referen= ced. + This offset is applied to the events accordingly. The x-size and y-s= ize + properties define the size of the touchscreen effective area. + + The following example shows a new touchscreen area with the new orig= in + (0',0') for the touch events generated by the device. + + Touchscreen (full area) + =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=90 + =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=90 =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=9C y-size =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=82 touchscreen area =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=82 (no key code) =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=82 x-size =E2=94=82 = =E2=94=82 + =E2=94=82 =E2=94=8C=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 + =E2=94=82(0',0') =E2=94=82 + =E2=94=8C=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=98 + (0,0) + + where (0',0') =3D (0+x-origin,0+y-origin) + + Sub-nodes with key codes report the touch events on their surface as= key + events instead. + + The following example shows a touchscreen with a single button on it. + + Touchscreen (full area) + =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 + =E2=94=82 =E2=94=82 + =E2=94=82 =E2=94=82 + =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 + =E2=94=82 =E2=94=82button 0 =E2=94=82 =E2=94= =82 + =E2=94=82 =E2=94=82KEY_POWER=E2=94=82 =E2=94= =82 + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 + =E2=94=82 =E2=94=82 + =E2=94=82 =E2=94=82 + =E2=94=8C=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 + (0,0) + + Segments defining buttons and clipped toushcreen areas can be combin= ed + as shown in the following example. + In that case only the events within the touchscreen area are reported + as touch events. Events within the button areas report their associa= ted + key code. Any events outside the defined areas are ignored. + + Touchscreen (full area) + =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=90 + =E2=94=82 =E2=94=82 =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 + =E2=94=82 button 0=E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 + =E2=94=82KEY_POWER=E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 + =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 touchscreen area =E2=94= =82 =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 (no key code) =E2= =94=82 =E2=94=82 + =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 + =E2=94=82 button 1=E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 + =E2=94=82 KEY_INFO=E2=94=82 =E2=94=8C=E2=94=94=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 + =E2=94=82 =E2=94=82(0',0') =E2=94=82 + =E2=94=8C=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=98 + (0,0) + + type: object + + patternProperties: + '^segment-': + type: object + description: + Each segment is represented as a sub-node. + properties: + x-origin: + description: horizontal origin of the node area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-origin: + description: vertical origin of the node area + $ref: /schemas/types.yaml#/definitions/uint32 + + x-size: + description: horizontal resolution of the node area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-size: + description: vertical resolution of the node area + $ref: /schemas/types.yaml#/definitions/uint32 + + label: + description: descriptive name of the segment + $ref: /schemas/types.yaml#/definitions/string + + linux,code: true + + required: + - x-origin + - y-origin + - x-size + - y-size + + unevaluatedProperties: false + dependencies: touchscreen-size-x: [ touchscreen-size-y ] touchscreen-size-y: [ touchscreen-size-x ] --=20 2.43.0 From nobody Tue Nov 26 20:01:39 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2099.outbound.protection.outlook.com [40.107.104.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3243D189906; Wed, 16 Oct 2024 04:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051379; cv=fail; b=gv3HiDDLPMD8NSUwBaKcfPWYt4ZxT9/2ex4vKECCulcwmCfOhcWU8To0J3fybQ1l/Lq4IO2HKlAELuWsN/TTe/25rorpZqUZxyvSz4yzaxT3f/i7a95BuF1jjnzSpAlH4Q7OzCI/Gz38ePOvFEY+2fvzu6MRzOngoTgfmAc5slY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051379; c=relaxed/simple; bh=jdJvamDCLB03jG7UmkYQcoILhVnVlu7OFv5WsJ4UHqc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sfNBaoJ1HufgztxPPes2xz2uWtSNCTNkGkq8sxR0eegrP6Tv6BRaIw630/Y85/OS5Z3FrArMCIoepVLVBqLIGTFV9YeMrsdIsdk2wvpO5PWrnDljpfDK1LH6x89Sc8FqS0ZFY/0jEIl9+q2lw4a75Xn8nB37EofV8vx776ivvdM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=Z/WE3BpY; arc=fail smtp.client-ip=40.107.104.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="Z/WE3BpY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bw6xNYWCxd2ksNiAKDuHV0tBYJ9jiTaF5hlh9bsYnIGHdaKAO80j+B69GSoHLX5UDid6dLPHY0JkULBhYkVBk28VO9ap3BzD385MrFqjGOsHpLPujH+9WF02nFVwVFmV5z/wZcZwhNUq/He0UpT4sNSnFCTV2fMg2ymti9Rx459/sA6/VxhYBOUqCSCPbkLKWmjfMu/wWwIhDT5f4EQbw7mjDjivaN4oSZ26K4bp5l6WowY9+/l6CYksuA72MvTaX/qA6JaO+7vh+BIKJUd3/WR4H1W8cZIUBd6DUCsUL0bO6XMLCBL3wOIkWrSwEbfoBJWEIOrWkfUrsTwtbU69jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=roCj5cj0UOTRVRR4/qbjDDBEx1tybxsLLqewz0ql7fs=; b=ies/FIlTT6HnNSAjZrgbbe65rXdFI1RmpFM2HWWqjU6MxBX3Hd0yTO9EM3iglGHk7ChlzvZpdxoVJmU/iYzMDHbHV+nh2xrNxW9nowvJixfMmgqSVVwh6AEcUF4SqlZGwBkkiSGOCq9Q2DnxiKZFPFnI8u4s/95VmbPTZ1aCay/O3rXu8Px+uhQAAFZuPNCVF56wQk2BxcVIQzzuqFUcw0Vy2fSl5wCUReTRvsRWhHsTjugbVftiubdreuTMx8UVDR0cW8pboWIJePoBzpCKB1wKzT0U8QJZQ4xPjmlEU2D9z9aNKpo5a1uYIXuRWmkmtYxd2WUNezDdq5xsAck0cA== 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=roCj5cj0UOTRVRR4/qbjDDBEx1tybxsLLqewz0ql7fs=; b=Z/WE3BpYF2/DWfHQwMeKxsF7k7CelwHiZ3nEofvynWLGdzdMXjtn9XEePhvBxbMl6K39Csj3Z43V0z2J18LXt1AR+sBkJFgNl3heMCragfKpcEiv+Rkx/UqfUq425xcJu4rNmPMBTH9m9db8nJdkwvDRSPqzK7K2uMkXY4PUrXY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) by PAWPR08MB10183.eurprd08.prod.outlook.com (2603:10a6:102:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 04:02:50 +0000 Received: from DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4]) by DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4%6]) with mapi id 15.20.8048.020; Wed, 16 Oct 2024 04:02:50 +0000 From: Javier Carrasco Date: Wed, 16 Oct 2024 06:02:41 +0200 Subject: [PATCH v11 2/4] Input: touch-overlay - Add touchscreen overlay handling Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241016-feature-ts_virtobj_patch-v11-2-b292a1bbb0a1@wolfvision.net> References: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> In-Reply-To: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bastian Hecht , Michael Riesch Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , Jeff LaBundy X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1729051368; l=11690; i=javier.carrasco@wolfvision.net; s=20240617; h=from:subject:message-id; bh=jdJvamDCLB03jG7UmkYQcoILhVnVlu7OFv5WsJ4UHqc=; b=MOF9v6orUPG7u1JyizROmgsCf7RZnL11Ki0tgFvsi59Onp/9Iknu/0z08qSNHPMHe59zWDnNq JXI5i96zSZRCJW5vjBojCeOU5NCmNfX/xzR8/Yp5VEtnHP6rdYkRdjr X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=hfASRUP6l4lf3Lo2mjLM085/h37dT3m0Qj1HejXDPDc= X-ClientProxiedBy: VI1PR07CA0154.eurprd07.prod.outlook.com (2603:10a6:802:16::41) To DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR08MB9190:EE_|PAWPR08MB10183:EE_ X-MS-Office365-Filtering-Correlation-Id: d12cadb6-6201-410c-3de6-08dced976740 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?T1hVZlZzbkY1ODBrS2xtWkM3dGtqOWFrSU5TSkRLSXEwVTJadFR1SzJyL2hy?= =?utf-8?B?ZE5aam9FaE81SUs2WUllb2t4VkZ4K0d4ZU5xYVE1eFBiSlNiUEZWRzRYekdM?= =?utf-8?B?UVlEVWY4S1hUOE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outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WnlJRHF5aGkzK3krK29iZW5nWmdGQS9EbU9YQmJJMU5ZaEx6cEVZc0dlT2o2?= =?utf-8?B?WGdMSFlqYnZITnFOOXhOa1VjNitNUXBOQlJCczg0Vk1yREZuK25CWHE1NG15?= =?utf-8?B?azFtSk5HZERqaExzNTJudWdDVEFXU01QcnhFZ3BCbVNVODI5Ukx3K0RqK0I1?= =?utf-8?B?U3JRU2ZNNUpJUm9BY1U3MGdhWGdQdTM4d1BFMFZkaDV6N3ByV3c5VDREQVRX?= =?utf-8?B?ZjRrdEFXelhtdFh4T3NPTFFSZENYZHg3bWptdi93Mm9YVkhOdVdIbTBhWXNC?= =?utf-8?B?WUhlcU1wMG9SWG1jQnB6Rmd4K3M0V2h1UHBGSEllRVc2RkRhSlExRlA4eGtv?= =?utf-8?B?NVRSdnRDQ1VQSlloMzRaazg1aHpabjJtWlJ0QlBHc2xSR003OGgvMHI3QVJi?= =?utf-8?B?bUJEZTB3bHdsYzR6eEhwSDJacWRRWktHQ0J4d2JwMkptMkQvUWQrTndkSWd2?= =?utf-8?B?REpMRlJCZ2hIMW5hbFVzZ2w2OTUyWlBBVGlmTldiSFhhcXVjaDFFdDJYQ0VR?= =?utf-8?B?MGlweEtFakpHZ0F0dUJKSXBRQnBSNHRaWGEycjN3NGhhcWR5RURZbXBUNmtt?= =?utf-8?B?VTFaSTI4MTc0bmNNbFMzRDdTU1cvczFIeitwRndneWZLUFNKMkFOMG9VK2wx?= =?utf-8?B?ZmEzVDNjN09iNTlOZUtVckRiakc4Y0FOVnpPaWp0cW1ZS3oxclZjRk1kYVNG?= =?utf-8?B?SXVmb3pHSGwwRmJkNVlMZlhjaHZjbzVjam5GeUFiS2ZIMkwvVWxKOGVvQ25Q?= =?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RL?= =?utf-8?B?OTk3ZDZ4ZkdIRWl1anBmbjd2K1lBVjNrTFc5S01sbDdlWVlqR2lyU2U3YlJo?= =?utf-8?B?L2VpMXh4U3VmUmNJb0U3NWM1aWNWVmFWdFR2MFRRN1VCTlR5Sk1paU1rM2s1?= =?utf-8?B?WHl4NVRueEw1ME9nbm8waVVoR0hWUHNjQ3dmanF0ZC9UNnVYUEgxVUhmdUJX?= =?utf-8?B?VlFQMFEwN1huc3JENENQNTlPWWluUTF1cC9PcmlDckNhaWh5bkkwYW83MnFL?= =?utf-8?B?eEdwK0tBK3dtaTVzTHZ3TlRNQ3NuaG5JVWp3M2dhRkdaRUFtVzBRS1Uxbm5z?= =?utf-8?B?RDBLeW9SMFZIU1gwWlRQZXovY1lONTFJQnpjcGM2anFKUTVtRlBxTWZHWHdj?= =?utf-8?B?Tm5zRFZ1M2lwMlM1VDdnMTA1SnVjdFB3cUZMMjBoNHcxY3AxS0l5SUpIcENW?= =?utf-8?B?V1lFK2Q1dyszTEVaWnhyNXA0ZEdIaDlnSFN1YWlBb3pBb1VFUXY2Mlo5S1dK?= =?utf-8?Q?bxh3racgFHWZPZg0mIuiuL4=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: d12cadb6-6201-410c-3de6-08dced976740 X-MS-Exchange-CrossTenant-AuthSource: DB4PR08MB9190.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 04:02:50.8603 (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: ML54QFZoRIBNd5xUsARMQNAdokpPQYEUyqdKx8oVSl6e/m1tHwm+YRvlu6tkhmxbRfPCS5Qxo2nlW4IdjAgVcZh1AZ1X8xrgV/vNAcs8WLY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10183 Some touch devices provide mechanical overlays with different objects like buttons or clipped touchscreen surfaces. In order to support these objects, add a series of helper functions to the input subsystem to transform them into overlay objects via device tree nodes. These overlay objects consume the raw touch events and report the expected input events depending on the object properties. Note that the current implementation allows for multiple definitions of touchscreen areas (regions that report touch events), but only the first one will be used for the touchscreen device that the consumers typically provide. Should the need for multiple touchscreen areas arise, additional touchscreen devices would be required at the consumer side. There is no limitation in the number of touch areas defined as buttons. Reviewed-by: Jeff LaBundy Signed-off-by: Javier Carrasco --- MAINTAINERS | 7 + drivers/input/Makefile | 2 +- drivers/input/touch-overlay.c | 277 ++++++++++++++++++++++++++++++++= ++++ include/linux/input/touch-overlay.h | 25 ++++ 4 files changed, 310 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index c27f3190737f..898083ea3a1b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -23478,6 +23478,13 @@ L: platform-driver-x86@vger.kernel.org S: Maintained F: drivers/platform/x86/toshiba-wmi.c =20 +TOUCH OVERLAY +M: Javier Carrasco +L: linux-input@vger.kernel.org +S: Maintained +F: drivers/input/touch-overlay.c +F: include/linux/input/touch-overlay.h + TPM DEVICE DRIVER M: Peter Huewe M: Jarkko Sakkinen diff --git a/drivers/input/Makefile b/drivers/input/Makefile index c78753274921..393e9f4d00dc 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -7,7 +7,7 @@ =20 obj-$(CONFIG_INPUT) +=3D input-core.o input-core-y :=3D input.o input-compat.o input-mt.o input-poller.o ff-core= .o -input-core-y +=3D touchscreen.o +input-core-y +=3D touchscreen.o touch-overlay.o =20 obj-$(CONFIG_INPUT_FF_MEMLESS) +=3D ff-memless.o obj-$(CONFIG_INPUT_SPARSEKMAP) +=3D sparse-keymap.o diff --git a/drivers/input/touch-overlay.c b/drivers/input/touch-overlay.c new file mode 100644 index 000000000000..8806373f7a4a --- /dev/null +++ b/drivers/input/touch-overlay.c @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Helper functions for overlay objects on touchscreens + * + * Copyright (c) 2023 Javier Carrasco + */ + +#include +#include +#include +#include +#include +#include + +struct touch_overlay_segment { + struct list_head list; + u32 x_origin; + u32 y_origin; + u32 x_size; + u32 y_size; + u32 key; + bool pressed; + int slot; +}; + +static int touch_overlay_get_segment(struct fwnode_handle *segment_node, + struct touch_overlay_segment *segment, + struct input_dev *input) +{ + int error; + + error =3D fwnode_property_read_u32(segment_node, "x-origin", + &segment->x_origin); + if (error) + return error; + + error =3D fwnode_property_read_u32(segment_node, "y-origin", + &segment->y_origin); + if (error) + return error; + + error =3D fwnode_property_read_u32(segment_node, "x-size", + &segment->x_size); + if (error) + return error; + + error =3D fwnode_property_read_u32(segment_node, "y-size", + &segment->y_size); + if (error) + return error; + + error =3D fwnode_property_read_u32(segment_node, "linux,code", + &segment->key); + if (!error) + input_set_capability(input, EV_KEY, segment->key); + else if (error !=3D -EINVAL) + return error; + + return 0; +} + +/** + * touch_overlay_map - map overlay objects from the device tree and set + * key capabilities if buttons are defined. + * @list: pointer to the list that will hold the segments + * @input: pointer to the already allocated input_dev + * + * Returns 0 on success and error number otherwise. + * + * If buttons are defined, key capabilities are set accordingly. + */ +int touch_overlay_map(struct list_head *list, struct input_dev *input) +{ + struct fwnode_handle *fw_segment; + struct device *dev =3D input->dev.parent; + struct touch_overlay_segment *segment; + int error; + + struct fwnode_handle *overlay __free(fwnode_handle) =3D + device_get_named_child_node(dev, "touch-overlay"); + if (!overlay) + return 0; + + fwnode_for_each_available_child_node(overlay, fw_segment) { + segment =3D devm_kzalloc(dev, sizeof(*segment), GFP_KERNEL); + if (!segment) { + fwnode_handle_put(fw_segment); + return -ENOMEM; + } + error =3D touch_overlay_get_segment(fw_segment, segment, input); + if (error) { + fwnode_handle_put(fw_segment); + return error; + } + list_add_tail(&segment->list, list); + } + + return 0; +} +EXPORT_SYMBOL(touch_overlay_map); + +/** + * touch_overlay_get_touchscreen_abs - get abs size from the touchscreen a= rea. + * @list: pointer to the list that holds the segments + * @x: horizontal abs + * @y: vertical abs + */ +void touch_overlay_get_touchscreen_abs(struct list_head *list, u16 *x, u16= *y) +{ + struct touch_overlay_segment *segment; + struct list_head *ptr; + + list_for_each(ptr, list) { + segment =3D list_entry(ptr, struct touch_overlay_segment, list); + if (!segment->key) { + *x =3D segment->x_size - 1; + *y =3D segment->y_size - 1; + break; + } + } +} +EXPORT_SYMBOL(touch_overlay_get_touchscreen_abs); + +static bool touch_overlay_segment_event(struct touch_overlay_segment *seg, + struct input_mt_pos *pos) +{ + if (pos->x >=3D seg->x_origin && pos->x < (seg->x_origin + seg->x_size) && + pos->y >=3D seg->y_origin && pos->y < (seg->y_origin + seg->y_size)) + return true; + + return false; +} + +/** + * touch_overlay_mapped_touchscreen - check if a touchscreen area is mapped + * @list: pointer to the list that holds the segments + * + * Returns true if a touchscreen area is mapped or false otherwise. + */ +bool touch_overlay_mapped_touchscreen(struct list_head *list) +{ + struct touch_overlay_segment *segment; + struct list_head *ptr; + + list_for_each(ptr, list) { + segment =3D list_entry(ptr, struct touch_overlay_segment, list); + if (!segment->key) + return true; + } + + return false; +} +EXPORT_SYMBOL(touch_overlay_mapped_touchscreen); + +static bool touch_overlay_event_on_ts(struct list_head *list, + struct input_mt_pos *pos) +{ + struct touch_overlay_segment *segment; + struct list_head *ptr; + + list_for_each(ptr, list) { + segment =3D list_entry(ptr, struct touch_overlay_segment, list); + if (segment->key) + continue; + + if (touch_overlay_segment_event(segment, pos)) { + pos->x -=3D segment->x_origin; + pos->y -=3D segment->y_origin; + return true; + } + /* ignore touch events outside the defined area */ + return false; + } + + return true; +} + +static bool touch_overlay_button_event(struct input_dev *input, + struct touch_overlay_segment *segment, + struct input_mt_pos *pos, int slot) +{ + struct input_mt *mt =3D input->mt; + struct input_mt_slot *s =3D &mt->slots[slot]; + bool button_contact =3D touch_overlay_segment_event(segment, pos); + + if (segment->slot =3D=3D slot && segment->pressed) { + /* sliding out of the button releases it */ + if (!button_contact) { + input_report_key(input, segment->key, false); + segment->pressed =3D false; + /* keep available for a possible touch event */ + return false; + } + /* ignore sliding on the button while pressed */ + s->frame =3D mt->frame; + return true; + } else if (button_contact) { + input_report_key(input, segment->key, true); + s->frame =3D mt->frame; + segment->slot =3D slot; + segment->pressed =3D true; + return true; + } + + return false; +} + +/** + * touch_overlay_sync_frame - update the status of the segments and report + * buttons whose tracked slot is unused. + * @list: pointer to the list that holds the segments + * @input: pointer to the input device associated to the contact + */ +void touch_overlay_sync_frame(struct list_head *list, struct input_dev *in= put) +{ + struct touch_overlay_segment *segment; + struct input_mt *mt =3D input->mt; + struct input_mt_slot *s; + struct list_head *ptr; + + list_for_each(ptr, list) { + segment =3D list_entry(ptr, struct touch_overlay_segment, list); + if (!segment->key) + continue; + + s =3D &mt->slots[segment->slot]; + if (!input_mt_is_used(mt, s) && segment->pressed) { + input_report_key(input, segment->key, false); + segment->pressed =3D false; + } + } +} +EXPORT_SYMBOL(touch_overlay_sync_frame); + +/** + * touch_overlay_process_contact - process contacts according to the overl= ay + * mapping. This function acts as a filter to release the calling driver + * from the contacts that are either related to overlay buttons or out of = the + * overlay touchscreen area, if defined. + * @list: pointer to the list that holds the segments + * @input: pointer to the input device associated to the contact + * @pos: pointer to the contact position + * @slot: slot associated to the contact (0 if multitouch is not supported) + * + * Returns true if the contact was processed (reported for valid key events + * and dropped for contacts outside the overlay touchscreen area) or false + * if the contact must be processed by the caller. In that case this funct= ion + * shifts the (x,y) coordinates to the overlay touchscreen axis if require= d. + */ +bool touch_overlay_process_contact(struct list_head *list, + struct input_dev *input, + struct input_mt_pos *pos, int slot) +{ + struct touch_overlay_segment *segment; + struct list_head *ptr; + + /* + * buttons must be prioritized over overlay touchscreens to account for + * overlappings e.g. a button inside the touchscreen area. + */ + list_for_each(ptr, list) { + segment =3D list_entry(ptr, struct touch_overlay_segment, list); + if (segment->key && + touch_overlay_button_event(input, segment, pos, slot)) + return true; + } + + /* + * valid contacts on the overlay touchscreen are left for the client + * to be processed/reported according to its (possibly) unique features. + */ + return !touch_overlay_event_on_ts(list, pos); +} +EXPORT_SYMBOL(touch_overlay_process_contact); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Helper functions for overlay objects on touch devices"= ); diff --git a/include/linux/input/touch-overlay.h b/include/linux/input/touc= h-overlay.h new file mode 100644 index 000000000000..0253e554d3cd --- /dev/null +++ b/include/linux/input/touch-overlay.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2023 Javier Carrasco + */ + +#ifndef _TOUCH_OVERLAY +#define _TOUCH_OVERLAY + +#include + +struct input_dev; + +int touch_overlay_map(struct list_head *list, struct input_dev *input); + +void touch_overlay_get_touchscreen_abs(struct list_head *list, u16 *x, u16= *y); + +bool touch_overlay_mapped_touchscreen(struct list_head *list); + +bool touch_overlay_process_contact(struct list_head *list, + struct input_dev *input, + struct input_mt_pos *pos, int slot); + +void touch_overlay_sync_frame(struct list_head *list, struct input_dev *in= put); + +#endif --=20 2.43.0 From nobody Tue Nov 26 20:01:39 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2099.outbound.protection.outlook.com [40.107.104.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BFB618A93F; Wed, 16 Oct 2024 04:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051381; cv=fail; b=uQ/PY4Q0Saby45GWDLFu1D9NO47d0hY3XYS6m31qDRkoO3zmzYM8V9mN4tC+QAik9UdehZ4BZidUlsxa0B/mMqmW/gPm1kf6+eCHf3cT8S6hQ2mglrHwAKsp8vrJH/ncGz3b2ac5a5sB4Sw9LjeJfOhOkIvKow7kPVN+jlvcfJg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051381; c=relaxed/simple; bh=XWHXrVKqE2CO9WPWm0JSgomvOBlZ7nKTdoLdXMwhYpk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=C4RXWm3WkRt8hRiGJkyQG6b03TkXWCHdrC5D75HNfSvvYlz/9akx5fHYC9Imvui9HxnEPBFTVqe6ERSDgbuGgL3PipvcjMYRrsPvU4RgyNxJ6HCeJZUb06IyrLcFR3GJ0AhU+SAQzB4AdeIVjPTY//54EoqmvFAU95xxTZoVcVQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=jf2RBX6B; arc=fail smtp.client-ip=40.107.104.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="jf2RBX6B" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SefXL8PbzSJGaEcsJyLW/nOx2c0rK3o1l+3qYa+tr2RO/vqqHDnVm4FMne5J2LsLK+Ccf12Zt25uATW6voOoJnROuHJBCIenEvy5AVVodTXJ81/5JgwCx6BMfaSp8DkucaDqffFBx59ObrBbuXq4VuyYkB/OTjfZZJwHuntybUyFfgNWObhTK6KeOvJGnx1FQK7c1F2Xyp+uCtPEA4bG1yVkl0xD87wZ7+nshMAUoSALOmQv/4hM8q6nbfVXol05yVL8W6eM62L+KRHMmNElxegSzTnGx9J13agxKl9HQCmooD6AdDUsNjL3+6CbSXaiZQMXfaRD4aA9U4lZ+JRw6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OMAGtTuTnOUoFkDvbGTrc/5C9LZDKdMlTNViTlbiSRQ=; b=ZlYlwRhA5CBmXd+Caz5IKQY9rO5ddLjJ4DDvSu0MP6NsGsfZha2ZeiR0BjcB6aRxyRjcdU1nGL1csshz3zAaRYJmbC3mdfJ4YkMta3caOwzn31vkljGQvgEhPMXqHukAeNs2snyZdJrF7Elxx1fjRfTatjvd7EqeVuaM3lBQIHcXl77/rhzCkvS+wMzNjW4WaIXDaaMId0WmjgtEfJe7i6SqGE4z6KD5cE1znLyfczljNZWpH0URvIGtSOdGd021QawLs/wI3VkT3j8P5EFisU2xVZiG/I1CA1pSsuGNipCixC4ObOZhtqhxp8cu2+2CZAJPw4tUaqeXQgOCdNcNug== 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=OMAGtTuTnOUoFkDvbGTrc/5C9LZDKdMlTNViTlbiSRQ=; b=jf2RBX6BHtDskvUB84e/9hSOUaVFCe27VjQBmAPeeT2q1OFHTeeGxZSjfo7aFsQsqTm76mH+gg8M7qtRLx/kXtEpMSlHcDjN7V6TspMCu2sw+RVIm0xUgO05QnRYxGUjhJHKoAqLyyk6Z2Dm+BqjDeuZbGxWb/GA/u3QuI7vaHc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) by PAWPR08MB10183.eurprd08.prod.outlook.com (2603:10a6:102:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 04:02:51 +0000 Received: from DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4]) by DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4%6]) with mapi id 15.20.8048.020; Wed, 16 Oct 2024 04:02:51 +0000 From: Javier Carrasco Date: Wed, 16 Oct 2024 06:02:42 +0200 Subject: [PATCH v11 3/4] dt-bindings: input: touchscreen: st1232: add touch-overlay example Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241016-feature-ts_virtobj_patch-v11-3-b292a1bbb0a1@wolfvision.net> References: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> In-Reply-To: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bastian Hecht , Michael Riesch Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1729051368; l=2517; i=javier.carrasco@wolfvision.net; s=20240617; h=from:subject:message-id; bh=XWHXrVKqE2CO9WPWm0JSgomvOBlZ7nKTdoLdXMwhYpk=; b=ZDQYS1QI2o5Q8E4/PyNeXvhlm9If7BAMd/TUA+C7PmIhqysNISDC1G1uIyi5U32OzS+Uzm+nk eMFaSVC7kOYA3U6IrYf5eXe2myZnGrjFuOE5+SNibonzNpotXgobvWK X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=hfASRUP6l4lf3Lo2mjLM085/h37dT3m0Qj1HejXDPDc= X-ClientProxiedBy: VI1PR07CA0154.eurprd07.prod.outlook.com (2603:10a6:802:16::41) To DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR08MB9190:EE_|PAWPR08MB10183:EE_ X-MS-Office365-Filtering-Correlation-Id: ffe7a1a6-adb2-452e-d2ef-08dced9767b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?M2xQdXF1MWZ3dWVBK05zVFhuclpzZEFoc1RNV2UwR3A1UTUzY2ZpM1lFeGF6?= =?utf-8?B?U3RqcW95bitUTDNrQlhqM3lJTkJJSjRJYUx4OGVERTRNOGFxUnJtR2RlZW81?= =?utf-8?B?dFo4TVJRNnRnakV3ZzNkN00xSStmbTRUTE0yTXlRRG5RcmRodHBhNGxDR2pi?= =?utf-8?B?RlE0VHlTUE1XSUEzQW02MmRrY1FhL0Q0bEJNVmE4bzliL0RlcURrYUFYL1Rq?= =?utf-8?B?NWlKV20vWkI0SmRuVkNVMFFEeEx5emY0aGw5Q2lCZHc2VFV6bnUwb0dyQyt3?= =?utf-8?B?Tm1VVEdIRkpXa3MvRVhtVloxdVRtRnBlV1ExVXRlY3dMYXhqN1oyVWcyNEpB?= =?utf-8?B?R2VsT1FuM2VWM2tQaEZpV0c1bVI1aEppSnFNTlpQazA5WmhVRDJJT3R6WE01?= =?utf-8?B?ZDdSMEp5YUFTRmIzek9lQVlIRng0bmorZGU4WUFTRE9QbkUzb1FNUHdkdkln?= =?utf-8?B?bkhlNTRjdTRiYm5iVnBIY3lFWDQ3akdTclluTjIvSTBHN2h2K0RHQlNPUzhM?= =?utf-8?B?UWF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mFzVkJx?= =?utf-8?B?emVLRlJUOGk5UFFqaGZKMGgvcnBSaEV1YkpmTnZlaVdqbm90QXZqVjBCR0FL?= =?utf-8?B?OGJNQlRQMnEwWTBWdVN6RlQ4Z1AxVE8wdjhmQ0gzTnVyN3hUTDFBUmxrSmk5?= =?utf-8?B?NS94TmFtR0NBWXIxTXRJWXNjbWdZbjdmSHhKWGFGcGFSa2Rnb3pReGxhU1VB?= =?utf-8?B?WWdnM0JpK1JacFdnUXB2Q2crMmtPeW5YZU9mSW1ON2E0VG9Yek9tcS9JQUhQ?= =?utf-8?B?cHc0Mmt3TkhXV3VleWtQM1pGMk55NDJoZnVKVTBlaWpRZktNemlqZ0JCNUZP?= =?utf-8?B?ZWg1QlJNazlORmZiZU5LNHRlV0hvUmlIU1FWU2orNGhYZzhTTk1CYkN3bloz?= =?utf-8?B?VGpvR2FYc2VsT3BLbDBIZz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB4PR08MB9190.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RGF0VkYrdStpRngwZTJHNzhqZnFqYnNxY1krN3VUVUxBaXRBMnN3VzA4SVJT?= =?utf-8?B?WDM1MmxmMTBvcmE4elBYcFB3d09IdnhESURDbU9kZGxJLzhvWkRYbno4cVRS?= =?utf-8?B?aTNyeFI1YW51d0o1YlhjN1pHU3hGZTViUzYyRnNUSms4eTNpT3ZvUzBNZHJk?= =?utf-8?B?b09JVjNWRGJmb0JHVjBHdFc1TDN5NUlvbWdRdkQyKzdDYWRWUW1SN2xMTWxx?= =?utf-8?B?UFUxRTAwNS9aN1FWWFgwTGxVY1VvdkE0NlpVbGpFYyt5UGhPai9lNVBIYTQ0?= =?ut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c2swNXZkd1dO?= =?utf-8?B?RGFwUUhPYkpKa0J5NFlIb1lDUXhNVWhqL2l3emJ5dkw1Z3A1TFY1Z3ZJa2Ir?= =?utf-8?Q?XCWEs0Tc6BmsHltzw8WNXew=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: ffe7a1a6-adb2-452e-d2ef-08dced9767b3 X-MS-Exchange-CrossTenant-AuthSource: DB4PR08MB9190.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 04:02:51.6074 (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: omwnKBAkm0hcze/gc9WIS4qfke7pZ+TzE3n1LjZ7A9F8Oev9DN5MkMildkH6QunHxmmEuBMMFFRD1DMxWkk+QH5rrtRvxK2lum/ZGPjO92g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10183 The touch-overlay feature adds support for segments (touch areas) on the touchscreen surface that represent overlays with clipped touchscreen areas and printed buttons. Add nodes for a clipped touchscreen and overlay buttons to the existing example. Reviewed-by: Rob Herring Signed-off-by: Javier Carrasco --- .../input/touchscreen/sitronix,st1232.yaml | 29 ++++++++++++++++++= ++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/sitronix,s= t1232.yaml b/Documentation/devicetree/bindings/input/touchscreen/sitronix,s= t1232.yaml index 1d8ca19fd37a..e7ee7a0d74c4 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.y= aml +++ b/Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.y= aml @@ -37,6 +37,7 @@ unevaluatedProperties: false =20 examples: - | + #include i2c { #address-cells =3D <1>; #size-cells =3D <0>; @@ -46,5 +47,33 @@ examples: reg =3D <0x55>; interrupts =3D <2 0>; gpios =3D <&gpio1 166 0>; + + touch-overlay { + segment-0 { + label =3D "Touchscreen"; + x-origin =3D <0>; + x-size =3D <240>; + y-origin =3D <40>; + y-size =3D <280>; + }; + + segment-1a { + label =3D "Camera light"; + linux,code =3D ; + x-origin =3D <40>; + x-size =3D <40>; + y-origin =3D <0>; + y-size =3D <40>; + }; + + segment-2a { + label =3D "Power"; + linux,code =3D ; + x-origin =3D <160>; + x-size =3D <40>; + y-origin =3D <0>; + y-size =3D <40>; + }; + }; }; }; --=20 2.43.0 From nobody Tue Nov 26 20:01:39 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2099.outbound.protection.outlook.com [40.107.104.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53946290F; Wed, 16 Oct 2024 04:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051383; cv=fail; b=abaMM7H6h0E1zuVYdYUXyH4wQ+h+583/sYaku18l6Y0oDgNMg/xdYAExjZ1p47JRRRAtMlUZNE72BIEfU2M4yGFutsVPB5eSBNPPp91vHUKhf0w9cNdsu+WZE9ADPp8K8U3jUy8A3yNbGlD6RrO0oOvXj3LE0TGQC1jgbpE+1ic= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729051383; c=relaxed/simple; bh=6Rd06mzprzVBozWdIS79zpyXpkHY0oY+g8+KrxW3IOM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=eJjRo/YU5MmxSbF57uOLyO0aqFNRj1xd+Ojou6+9yR9Wg99sDoQCEZ67b1Ye8R9S2k/6SO1UW1TsSV6/dLf7Dvr8XTFnopHBM898xlqmtEsG/14/PqCZrMznmDMfyNqKVjxkzvFfEKMfbBv6dC8n3Ex4rHINb3eOQRUiJ4yR5fo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=eKGV5CfY; arc=fail smtp.client-ip=40.107.104.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="eKGV5CfY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dTpX33ZQR1uZl9d0uG2kPqOyEzUsb4JD92TJjlgBnRJnE9eqHpeaH1dLjbgIoYlkCgAWQ4pE7KpO/Yxi20x4vpJ5R4WAWrpVHLoU/w6rqPtL1SSEkBghYtXScygjJwzsH5WSORqulm7D1L3d+9V+l+UU0fKAd4td4ZrAMVOgQtTttPFepNfW5PxbKfFtXRVBtYb6XCxJgBCWUu5RHtzvdk73NOBCc/kIkObQA6HYFaYAB1qFGHk60caHgf+4ddR0etbKh7WOUqRXZE3IN5qNz3NrjRvKm+5Vvl24JJyefm8u2MBjhQhICgqekWdB+XlW9oKH8t0gVlglyenNr8qOfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=R8aCWi7+qUdaWhJcJz61qNnK96Og/DumwNYjndfUjZo=; b=Lhm9ecbnyxP+/JjUltpT8Uz7U3WfJ0ltfmeiiDM9Lw4frY8LJ3hZ28ttMK3EfT6RDikUGeu2P4QOKLTTYxAdMuSjFdaRDLdV0GDnm1IBqLSMmDZyd6YRLxpTGML2WRP2NZetAvs3GqFLdWeWZFHTXyMefKzlfDewN11bMk+PoWY2uu8lHPQwr7i65I3jp11msaK9w9IP30J4tykZJ11szQ91qbWnEwp768GKC4Ca8MFvAtd92pHLCxqCy5Fne+xLb4ctGmecxGzBdhNCm6xThUjUKy8P1LvPg2smoEhYzg4OWEVPacMNz1lcOg6qUaTFrUWYRlD4KNTboWwlk1rIUw== 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=R8aCWi7+qUdaWhJcJz61qNnK96Og/DumwNYjndfUjZo=; b=eKGV5CfYd15QsTJFh71ooQMVWE+kngURGo6SWzMeJKknAy6blLUsobC0yQ/ePESxQFQbZanxmu4heIimvG4mMe9a/z2H4EucgwkTvEH5kCmb0aWZQfms21lRDterfpQ2BkE0mcO5iKYzjkHYQwe9l9ZYbaBKMiSYWmdjBvVBBTo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) by PAWPR08MB10183.eurprd08.prod.outlook.com (2603:10a6:102:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 04:02:52 +0000 Received: from DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4]) by DB4PR08MB9190.eurprd08.prod.outlook.com ([fe80::c7a:6978:9afa:19a4%6]) with mapi id 15.20.8048.020; Wed, 16 Oct 2024 04:02:52 +0000 From: Javier Carrasco Date: Wed, 16 Oct 2024 06:02:43 +0200 Subject: [PATCH v11 4/4] Input: st1232 - add touch-overlay handling Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241016-feature-ts_virtobj_patch-v11-4-b292a1bbb0a1@wolfvision.net> References: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> In-Reply-To: <20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bastian Hecht , Michael Riesch Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , Jeff LaBundy X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1729051368; l=3162; i=javier.carrasco@wolfvision.net; s=20240617; h=from:subject:message-id; bh=6Rd06mzprzVBozWdIS79zpyXpkHY0oY+g8+KrxW3IOM=; b=VF44P9sxVB7wtJtTURWetgKIiz/ENaKIyFWiF/DEWnWiMyykkaPCFvM0ahcPkyKbrmIe7GSqA boT59t/HczUBYWKZ1/IJCieumLYG4wubuz8IHvD4EHVsgQtdoJ3e3n/ X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=hfASRUP6l4lf3Lo2mjLM085/h37dT3m0Qj1HejXDPDc= X-ClientProxiedBy: VI1PR07CA0154.eurprd07.prod.outlook.com (2603:10a6:802:16::41) To DB4PR08MB9190.eurprd08.prod.outlook.com (2603:10a6:10:3fd::21) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR08MB9190:EE_|PAWPR08MB10183:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b06a46b-5030-4d04-a3e1-08dced976826 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dzBGK25mcnYxQXBTYmRPa3JhT1FWQzQ1ZU9GZ1FyK285UDdlK0FscmlneFpJ?= =?utf-8?B?OThnUnBzYU10YlZ2S1ZyMGJOQUVvZlNVOC9JQzFOWCs0bThrL29nK0Vudjk3?= =?utf-8?B?WHVVZklFK1pxQ241R0ErMjJyNTEvbUowU3J3NERERWI4cDhjNlZEOWJaV0I5?= =?utf-8?B?eVhlS1pZWlNnZGtYR1hVV3NBcWo5UVJZdFVYdzNSalR0dG5VTDRHSlFOQTUr?= =?utf-8?B?MGwzWG5sRXR2ajBZTDBJK1hGWkFwMnJQbmh5Q2NXb2V0a1NEYkhHc3FiRDMr?= =?utf-8?B?QjVINVNGNmI4L1IyampVUlZNb0ZSWkRMZzIxTmZBZ2xoS2U4YlZuUDkySjRn?= =?utf-8?B?OGFsbTZ3RTVDb3MwVDl6TisyVnY1Z2YrYlhhUGFuODZhQzBlVXJEbk1yRFpt?= =?utf-8?B?QTBlSUczRThFRFZ2NlUyVWNJTGFNNjAyOXNPaUkxbE9FZHdzS2FkMWVURXFF?= =?utf-8?B?S3pXTEZUbm5yaE1zM29xY05tREJML2Vmd0lZS3pvd0FDMk9YbEFWWGxPSEJj?= =?utf-8?B?N2hDY1Rsc1RSclhoUnNtNWYySDNSMnlXUVV5UFI0NlRRVHJxSm1ETGNUY0xO?= =?utf-8?B?eFhsOGcxMUxxTVNsNURmNU90eUJHOHV6VEJ5eXA0ZVN2czlsWXhtcUhSWjlQ?= =?utf-8?B?ZGhKZGFHTkQrSm1reGxzOWwrUHlKNUM5YkVwMitLWUtMUmVZZW50QklFUnNS?= =?utf-8?B?YmtKYzBDaHpFNkhqWUE2eGVGTHQwUkhjYWUyK2hTR081Z2FBbjExTUlIK1pL?= =?utf-8?B?SzFESWExSFlvOG9xL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ueEVo?= =?utf-8?B?Q0tzaVJ6VjNEcFQ1MWZORFh3VnAvWTVTbkZvQWN3RGgwenYxd3lNNzl6cDd6?= =?utf-8?B?TTIvdTN2NGh2TW9IS1RJNFFVN0xRSFI4TWNoTEZpTkdVZEFxL0E5VWNxNnN2?= =?utf-8?B?eHdXZGlhU3h4N09lVzgydz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB4PR08MB9190.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEFaRHBENG5rNkloWWxZcDMvemJhQ1pNcGlVaDA2ZWxNUHhJWEFhL29xbWtC?= =?utf-8?B?OFRQL2E1RUZOd3ZQcmdMeXpIdmZyY2NOeHl2N0l1dGZaY3R0VWVlNHd5RkxO?= =?utf-8?B?RTF1WUlrdTVTMVJXZkpCWnVuakVnWFVMTWtuN1JtcytuOUFzSU15SThwS2xN?= =?utf-8?B?WHFyYWxORmsvakp3VkJXQitTdXNuMmtUaHhuYkJobWg3c1M2ZWVzUEJUUlZF?= =?utf-8?B?Ty8rMGpzZ0RTUmJsVEhMeTdvV0xYTTR5WStKaThkUTl3R3BLZlY1eUJVczJk?= =?utf-8?B?Tjl0RmhzWHJJNDd1QWZjMUhBdTFvRkdZcVFEa1lncnNXaUZRMHZxSEg5Z0hZ?= =?utf-8?B?M25KT24vZjQveDNJUmRKNThXaHdZRko3eVcvcU9ycjRoWWRkb09xNlNlMEQv?= =?utf-8?B?bEhDNnZmVndWSGtxSmhRSkxJTjlsd2IwelkyY1RvdDlqN3dKMytlaG1nQTNr?= =?utf-8?B?ZTRHbzVWUUFDUnR2MDVnZ1BpQ3RBTDNwSVoranNQYlNDUjcxSFk0UFpkWU0r?= =?utf-8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1JF?= =?utf-8?B?SzJNbDhTZExqcCthdkREakNDRDhZYkZZR1VKL0tibWRVZ3htWnNlYS9HODll?= =?utf-8?B?RU1mZG9RNDFlV2U5MUVzOGJyR1NqU2t2amZwOWlSL1lZZTRQaFd4c2JhYm9K?= =?utf-8?B?ZjJQWmxKRzdWT3I0L2lzVlFwTmZQTEIrVjBZR3ZnNHhuaUgyVGJORTcrMWJh?= =?utf-8?B?VVJRV092THJCOGtRNDRIR1UvTVJXT3JrMUlxdFZwcUlUdDc3RDQwRkVXNGIy?= =?utf-8?B?RVpFTFNjSXBjT29ieE80WGNiSmUrL3N4Yk82ZThQWlZXdTVLd0UvWFdVYWxD?= =?utf-8?B?OFpxa09nSjVQWHFRd0lYMCtHNEh3cnF3L09jcmQ0SktLaGVEbitZaVZiTERt?= =?utf-8?B?b2VORGFYMjdPYnhRM2tFK2E4SHBSU0tBMitjeTExQlhPQU1NT3I3MityVVN4?= =?utf-8?B?VGRDbmVRRUVoOE5GM3JCYkE0dFpYM1UxOEhXZzJQNGlWOC9UMGdKK1BhT1hV?= =?utf-8?B?Q1lTVlQ2b2pUM1V6czBCSUpJK0w1WktaTWVvK25hZitSMitBa1h4QjBpTlAz?= =?utf-8?B?c0x5T3B0VURzK0hVU3NmekJiMkZOT0d1Ykw2WGZIeUhwMUk5TCt3bWVwdWxZ?= =?utf-8?B?OW0zMWMrT24wSXVSeFBjMktDMjBHa2Q4ZmhCaHppOG9URDZIMmZabWZLVTQy?= =?utf-8?B?VnFMbDZ0eGkyTTZ5NEYzNTdIRFRQdVpqbnAxMFgySEhsemxMamlhZ1Z4Tm9G?= =?utf-8?Q?6tWxq4Wz7Q0H7/vSbCvCKDA=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 4b06a46b-5030-4d04-a3e1-08dced976826 X-MS-Exchange-CrossTenant-AuthSource: DB4PR08MB9190.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 04:02:52.3570 (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: 29dSvq+SUhKTuL3IWz/FWbXwR6iwHkbIXALG2n31dbk+39ANFTU5x7ZdNWuR2not1GB0rHyaIohYokAtsLYNlvhwrLUCohXDORqeprAl/QQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10183 Use touch-overlay to support overlay objects such as buttons and a resized frame defined in the device tree. A key event will be generated if the coordinates of a touch event are within the area defined by the button properties. Reviewed-by: Jeff LaBundy Signed-off-by: Javier Carrasco --- drivers/input/touchscreen/st1232.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen= /st1232.c index 6475084aee1b..9b3901eec0a5 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -22,6 +22,7 @@ #include #include #include +#include =20 #define ST1232_TS_NAME "st1232-ts" #define ST1633_TS_NAME "st1633-ts" @@ -57,6 +58,7 @@ struct st1232_ts_data { struct dev_pm_qos_request low_latency_req; struct gpio_desc *reset_gpio; const struct st_chip_info *chip_info; + struct list_head touch_overlay_list; int read_buf_len; u8 *read_buf; }; @@ -156,6 +158,10 @@ static int st1232_ts_parse_and_report(struct st1232_ts= _data *ts) =20 input_mt_assign_slots(input, slots, pos, n_contacts, 0); for (i =3D 0; i < n_contacts; i++) { + if (touch_overlay_process_contact(&ts->touch_overlay_list, + input, &pos[i], slots[i])) + continue; + 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); @@ -164,6 +170,7 @@ static int st1232_ts_parse_and_report(struct st1232_ts_= data *ts) input_report_abs(input, ABS_MT_TOUCH_MAJOR, z[i]); } =20 + touch_overlay_sync_frame(&ts->touch_overlay_list, input); input_mt_sync_frame(input); input_sync(input); =20 @@ -292,18 +299,30 @@ static int st1232_ts_probe(struct i2c_client *client) if (error) return error; =20 - /* Read resolution from the chip */ - error =3D 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); =20 + /* map overlay objects if defined in the device tree */ + INIT_LIST_HEAD(&ts->touch_overlay_list); + error =3D touch_overlay_map(&ts->touch_overlay_list, input_dev); + if (error) + return error; + + if (touch_overlay_mapped_touchscreen(&ts->touch_overlay_list)) { + /* Read resolution from the overlay touchscreen if defined */ + touch_overlay_get_touchscreen_abs(&ts->touch_overlay_list, + &max_x, &max_y); + } else { + /* Read resolution from the chip */ + error =3D 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, --=20 2.43.0