From patchwork Wed Oct 16 04:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13837703 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 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-input@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?q?VzXHuuNGn+I/Wk3ldXelnWSKpYh/AVr?= =?utf-8?q?EQTbzG7MFvcarlrbAF91DdUSLDc9WUkI7+rh85Hsi1hARqTXlHbyEzv5z7T5ysDlg?= =?utf-8?q?IdEc/Akvv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aiCzbh4l24ZZKilrQ6Z2V73JyQEFhjbrUN1?= =?utf-8?q?BaoAcbjl1Fj82ZbY8VfoWayLkAviJe/CYPlHr4Mm/ex8Ryop8FIKTZq7/Ab8GNZ+o?= =?utf-8?q?aBSVzjFjiBqIEudDqRXmuSN9riTD/TyaIjtFWTahZX7kOGCaTm4fmc+D1n2/cAv8J?= =?utf-8?q?IUvr1C55Rxz5oXbUltjV6gyqzYtkwYcNdP37/bo+ND8Zd/j38w3oT6eale9psLawR?= =?utf-8?q?CVDj4bpjKaTrDVtE9fydOHJ2M8dbBdfb7PA9zuzQsiZnf4YKenZ7sKVvxaGzne+jZ?= =?utf-8?q?YzI9WI4o8UhyJCRz2ooW8XRYsRDmHpY0PXw=3D=3D?= 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?q?DyxyoKdrGQQnH9Hie7cHz9baftP2?= =?utf-8?q?w02VG0RpKTDrjOn7Ag0lC4jGjqpTzc8WV5KbJpa/AnJDX03ErX18Q/OI/xtvt4KD+?= =?utf-8?q?GB7TafZCwUQp4kQ0SH2F4bh4gkurm0hpDRdgWbSk20ka+42+VQfxtM45fZn09t778?= =?utf-8?q?4OVwFNYfu5mhrGMb6iJNeYdqDVxchR+F3h1KnV1SVQkYBmWZhUplql+eGCyWMIPuY?= =?utf-8?q?c4Nu4pjqSL1F9n0eo4FqF6I/+mpYwDy1SIzsLY6pM/wwv6F/LX1xOB3zE0/vyaIka?= =?utf-8?q?3ehslmuQ/V/CApwEWrSMuRTiS6ninBkZiWR4tAXCJbQCWTw/apMFoIlT6YkLEXOi5?= =?utf-8?q?Goy9iVw9j4jRA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CbmIoJz2D9vxreTCxxzG/Mm+gcxLRGjmoMYHMciUQTGAIp?= =?utf-8?q?yD6RtAk79CE0os4jXGsROjbHRuFjcTuJwJtSn6hikAmyulN9byX8fuXwLLRsJ8RNU?= =?utf-8?q?iBMu6RhxmwJVscUrmbOvwZIB8cmF26LGsQAWDzJ5rXEL1WnMyXTRtXKtsb2IS+0LK?= =?utf-8?q?cIrBScBkV/KfhgUpJ9bzZo9kjG1k+goqAZ9ZoM+xqaupOY4jc0UZXLzakcgjjjN3I?= =?utf-8?q?UeVIYt9rKXM4l+oevSjR03qqniJVMjh4xoFDlRwOKM2u20p66J2+RxJaiYpP6WDWh?= =?utf-8?q?hBwJAsT4SfYWvMTF7ifa6D5/JOhqc6DjvaCYUZOIpsI2eFfWggNe298=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/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml 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 + 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 specific + functionality. + + This is of special interest if the touchscreen is shipped with a physical + overlay on top of it with a frame that hides some part of the original + 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 button. + + The x-origin and y-origin properties of a touchscreen area define the + offset of a new origin from where the touchscreen events are referenced. + This offset is applied to the events accordingly. The x-size and y-size + properties define the size of the touchscreen effective area. + + The following example shows a new touchscreen area with the new origin + (0',0') for the touch events generated by the device. + + Touchscreen (full area) + ┌────────────────────────────────────────┐ + │ ┌───────────────────────────────┐ │ + │ │ │ │ + │ ├ y-size │ │ + │ │ │ │ + │ │ touchscreen area │ │ + │ │ (no key code) │ │ + │ │ │ │ + │ │ x-size │ │ + │ ┌└──────────────┴────────────────┘ │ + │(0',0') │ + ┌└────────────────────────────────────────┘ + (0,0) + + where (0',0') = (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) + ┌───────────────────────────────────┐ + │ │ + │ │ + │ ┌─────────┐ │ + │ │button 0 │ │ + │ │KEY_POWER│ │ + │ └─────────┘ │ + │ │ + │ │ + ┌└───────────────────────────────────┘ + (0,0) + + Segments defining buttons and clipped toushcreen areas can be combined + 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 associated + key code. Any events outside the defined areas are ignored. + + Touchscreen (full area) + ┌─────────┬──────────────────────────────┐ + │ │ │ + │ │ ┌───────────────────────┐ │ + │ button 0│ │ │ │ + │KEY_POWER│ │ │ │ + │ │ │ │ │ + ├─────────┤ │ touchscreen area │ │ + │ │ │ (no key code) │ │ + │ │ │ │ │ + │ button 1│ │ │ │ + │ KEY_INFO│ ┌└───────────────────────┘ │ + │ │(0',0') │ + ┌└─────────┴──────────────────────────────┘ + (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 ]