From patchwork Mon Apr 22 10:07:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13638259 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2130.outbound.protection.outlook.com [40.107.22.130]) (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 DEFBE13D611; Mon, 22 Apr 2024 10:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.130 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780471; cv=fail; b=SP1I12L5Yhmry+8bm5awocYCoXswqsCaMphU6VHfb4r4zYL9krt8aDEwFWvIlB+6W3iy5Ei1kWb78jKJNT5Luv8zNAqKpr3Q32QPaQfNQLGj83rf9Falyr5uTudVnHzn8erUrJb/NG7Nj7yAq91biLhza9EbT6X+Ou9g/v7Cb6s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780471; c=relaxed/simple; bh=xqSujAmAV6/3SRa4nYhyKQa4ADU+qccjdvBXJR5CB0w=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=jtRbw8BH5eDHpMzirSZr14UfLBRw095ZbamkmL9un3huhv12OFfrHkOVDe8xWzD9ffEUHKOhvOQJmAkjeoyMkAh4SvUtxFEbxsGt9CH/NRkcxu5+UMSqVjrlGs8NS1ZjJdS0fmpN7jLGu54bANun2cguRVfmPIVP9w1HuFJT2KI= 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=HFr/Rb5K; arc=fail smtp.client-ip=40.107.22.130 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="HFr/Rb5K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KGTF5WqN2ENSvfb+ZaTCH0T3P5tlc11R/so6jQdjBkoxhtuMguAdwZNDScjEH4pz6+dESpe3c5qRs0WHtJkzRVctHRzHO0fpgIuUbnqVptpvvhNkpAgj/4/Y9/qNZCxDsl+m08z73uzJF/d6es5mLcFnmtctBOHb0nqs7i4VNoiOHjyAhYyCmLOCNErPi4LBvStXXsvaYIPFfX4yPJ3uxYEkpIziOzxXn/k2PpAq6lautTf/NhTF3IhK7/TrPmLfyFjlsLF2or9rk9AgEyWgD3X4JOoO/EpkY1ZeeuFXqGdtug6+AJ4wJZb8i8AFJuLsRs1ucqcH54l+m/Thn7SUtA== 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=zWBj8+b4lzxBjqPTVkhmewDiQTK1BlKfm1lKWS6844Y=; b=jNyKc+gx2ri/+Sp90A0jga2wRSRrstQCa8aHPhc16+XIMNxfLBzrIuklzK1AI+Zb3fdigbFz61sXDfx+PPoZdFtq9kRAjJW+DMdgaIiyxoNdMcJdQrgsqnI080toXmcH7ppIiWPbB7ShzXn5bNbENbCOx05z+sRTjU3XEXl/PidYfpSPl2w05xbgxlhJq3QVRPnpWgVv8+gICJIlNeOJYMJZzxPLwmZC8TOxbeTvu1d4blFLk7xEoNu31NWB04XZY+GahC7HGhn5hIZQSHnNzi8qS5Wv3PHYe1ZHxIBhLAXlD1a2iUc+bQQV6liGkGUZPlrK2RmrE3ZCaRQiqzS/vA== 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=zWBj8+b4lzxBjqPTVkhmewDiQTK1BlKfm1lKWS6844Y=; b=HFr/Rb5KXpyGgsxzDgVhl0mBjwNKNM7Wj64hKYw7MzYHnKfme5pMV/lmKVdiBbeHHZK1avf39KaxvnBH5/a8JrAuPwKqOjTr2g0KE0IuJJxDChMhm0vf7xJVgDE9RnrUdowWllbcvIrWpnqXMC68YPER3+s+RY8ng23asPUKDzE= 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 AS8PR08MB7885.eurprd08.prod.outlook.com (2603:10a6:20b:508::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Mon, 22 Apr 2024 10:07:44 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6621:68a6:ab00:c040]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6621:68a6:ab00:c040%5]) with mapi id 15.20.7472.044; Mon, 22 Apr 2024 10:07:43 +0000 From: Javier Carrasco Subject: [PATCH v9 0/4] Input: support overlay objects on touchscreens Date: Mon, 22 Apr 2024 12:07:36 +0200 Message-Id: <20240422-feature-ts_virtobj_patch-v9-0-acf118d12a8a@wolfvision.net> X-B4-Tracking: v=1; b=H4sIAOg2JmYC/43Q3U7EIBAF4FfZcC0boPx098r3MGbD0MFiTLsBR M2m7y6s8crGcHkg8w2HG0kYAyZyPtxIxBJSWJcaTg8H4ma7vCANU81EMDEwxRn1aPN7RJrTpYS YV3i9XG12M0WhjZLMWjSS1HGwCSlEu7i5AUUfJY2Ot6trRB8+71ufnmueQ8pr/Lo/ovB22rGvc Mqosqhw5OCElo8f65v/aXBcMJMmF9Griap5PVoNHo1lflcberWhaiA9GO8kWDC7muzVZGvqtGP eccRJ72qqV1OtqdegnJxAn4ZdTfdqumpT/TamTkZxta+Nv5pkg/hPG6vmLGg0kwPu/zbdtu0bw 5RkrbQCAAA= 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=1713780463; l=5105; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=xqSujAmAV6/3SRa4nYhyKQa4ADU+qccjdvBXJR5CB0w=; b=fmxxqBdBNNy9Pp5XfwiBYiXjJiypAOnULXDgsjUKr3wSRPiNn8pnXlB9rs/06m3sU6H0sR1jt bifSR6ml5/8DtvjwxqmW90HhxGAHJTmLLAwX/OHnreGIWNtC4909F3Z X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR0502CA0004.eurprd05.prod.outlook.com (2603:10a6:803:1::17) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) 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: VE1PR08MB4974:EE_|AS8PR08MB7885:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e81507e-e936-4135-8f20-08dc62b40d4a X-MS-Exchange-SenderADCheck: 1 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Eg/lgqak9GNMi3zc2apBMWuf2Nqd?= =?utf-8?q?47ryd3qaKvFwwalORlDXjTtANBzsOwOiKD/GOMIo4lXTQPZtjk28tNzFD7yjZ7rPQ?= =?utf-8?q?HT/l25ywirGq0RBAMjwW5CnBuSSCl6yfQ0udTecs01fL/f5bEGzPH2FZxr8PhPi2i?= =?utf-8?q?QfdQ9nvymG9hW0H0KZP4wPbocQwUpmkl1uFF0Au3LS+Dut6fmvZG+vnGEx0bGTgFA?= =?utf-8?q?uRiMucBCxbht9REV+80P/7PehtsqNJuNXYu/U2lB7ejyvFWqVkvoId0Xo68rDp86X?= =?utf-8?q?6Fj8xjCiVNuGkwzJqhpKaXTIa6S6s+Q/tulH2l0e+kKSBEEomfEbUxK4OR5546mn0?= =?utf-8?q?IjAOqxO1XMuoVChHpVMY/jtsMXH4h9R8W01gfx8+GZz9bobBYO98IBSR6pCFAxG6X?= =?utf-8?q?TjcPw+zJU8JtkK5cjtPOiXvEsB9tzkWE0t+xOWqO2OLD9zAZYE9WBUDJ9JEPjvNs4?= =?utf-8?q?StIS/kCL3ghqMOLVXF327tpHrJEjf44JIaA=3D=3D?= 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:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lRTcqPH+E/lRJYcbGlLw3Rte2s3i?= =?utf-8?q?lvAuRIuQvNl8YMjj1VlsL+l7lcKQk26vDJS1RE+fq6Ra8pp9wPKZ5EfuYFHCaKt77?= =?utf-8?q?PpBEZ3srZ2H44gH0Cn5jO4NMrAnanBe4k5CrLQ1C2XsFMqOa33KyYV3f9SfURIvIO?= =?utf-8?q?CEzKQSA/sE39FhT7ARo6fzM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MjZeSxS4ibdJChCGxa2/6BId6+SgS2meykq6/JSfffQcb20j+S?= =?utf-8?q?2COKzakXcdGxvQmeZ1PN7myqaRJwO0xIwzKlzf0mMiCSIrbGPNcahHnEKwX7IR+Hl?= =?utf-8?q?KAJgZGZ01ZNIzh/ugY1qOfgeEA62L2qgPOhLWDyjI+ecv1Hqe7lpyWc/fRCuQJ0K1?= =?utf-8?q?dzkLCKtUdotCa7kRxkhr6I+Mosps+n+3crH2yzHzkK0C5gIQfbzoiPtktuxmeAeIh?= =?utf-8?q?T8ilgiQG7UHnp9X7s5JC+641FMxtKm30Af3yslBzJ95cywX+qhw3jUw451SZ774n9?= =?utf-8?q?7QgzbAziII/HHK4GrXTA+ufN+QVuchuS9NrrD2yx45eOeFjs0+T52/KW/vMdQqKBC?= =?utf-8?q?h+zm4bn9M/SB/QMAeFu9aOrHSFvIyl0g4gQZCsM9tK5SUG6bP5XPJvGvC7XklW6W0?= =?utf-8?q?/eRUFnWfUFlikde1FJ4PJGi9l1isl1v/jltZ50qaZDmS55eu7HF0yQ10WMOnvnJ4L?= =?utf-8?q?vRv2xfyU2TFknHuMsDePJzSytf02iBjiQ5j6w1Hw6Lec25IbCUKyE8w=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 5e81507e-e936-4135-8f20-08dc62b40d4a X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 10:07:43.7707 (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: 5Wybz9jA2ZxsQdRibtxuJI0ZWo1dweiTk8ka3qXKTk+A4nk3m5eka1Pya37Rvn96s2iWvVNemKiif5toDj5NlWhDxsIjiq+5hqEU1jvRxi4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7885 Some touchscreens are shipped with a physical layer on top of them where a number of buttons and a resized touchscreen surface might be available. In order to generate proper key events by overlay buttons and adjust the touch events to a clipped surface, this series offers a documented, device-tree-based solution by means of helper functions. An implementation for a specific touchscreen driver is also included. The functions in touch-overlay provide a simple workflow to acquire physical objects from the device tree, map them into a list and generate events according to the object descriptions. This feature has been tested with a JT240MHQS-E3 display, which consists of an st1624 as the base touchscreen and an overlay with two buttons and a frame that clips its effective surface mounted on it. To: Dmitry Torokhov To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Bastian Hecht To: Michael Riesch Cc: linux-input@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Javier Carrasco Changes in v9: - touch-overlay.c: trigger a button release if the finger slides out of the button segment to be consistent with the button press when sliding into a button segment (see touch_overlay_button_event()). - touch-overlay.c: (nit) remove braces in if with a single statement in touch_overaly_process_event(). - Link to v8: https://lore.kernel.org/r/20240320-feature-ts_virtobj_patch-v8-0-cab6e7dcb1f6@wolfvision.net Changes in v8: - touchscreen bindings: fix description formatting. - Link to v7: https://lore.kernel.org/r/20240119-feature-ts_virtobj_patch-v7-0-eda70985808f@wolfvision.net Changes in v7: - General: return to a single input device implementation. - touchscreen bindings: segment instead of button in the label description. - touch-overlay.c: define button-specific data inside segment struct. - touch-overlay.c: remove fwnode_property_present() and check return value of fwnode_property_read_u32() in touch_overlay_get_segment(). - touch-overlay.c: simplify return path in touch_overlay_map(). - Link to v6: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v6-0-d8a605975153@wolfvision.net Changes in v6: - General: use a single list to manage a single type of object. - General: swap patches to have bindings preceding the code. - touch-overlay.c: minor code-sytle fixes. - Link to v5: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v5-0-ff6b5c4db693@wolfvision.net Changes in v5: - touchscreen bindings: move overlay common properties to a $def entry (Rob Herring) - st1232 bindings: move overlays to the existing example instead of making a new one (Rob Herring) - Link to v4: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v4-0-5c6c0fc1eed6@wolfvision.net Changes in v4: - General: rename "touchscreen" to "touch" to include other consumers. - PATCH 1/4: move touch-overlay feature to input core. - PATCH 1/4, 3/4: set key caps and report key events without consumer's intervention. - PATCH 2/4: add missing 'required' field with the required properties. - Link to v3: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v3-0-b4fb7fc4bab7@wolfvision.net Changes in v3: - General: rename "virtobj" and "virtual" to "overlay" - PATCH 1/4: Make feature bool instead of tristate (selected by supported touchscreens) - Link to v2: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v2-0-f68a6bfe7a0f@wolfvision.net Changes in v2: - PATCH 1/4: remove preprocessor directives (the module is selected by the drivers that support the feature). Typo in the commit message. - PATCH 2/4: more detailed documentation. Images and examples were added. - PATCH 3/4: select ts-virtobj automatically. - Link to v1: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-0-5ae5e81bc264@wolfvision.net --- Javier Carrasco (4): dt-bindings: touchscreen: add touch-overlay property Input: touch-overlay - Add touchscreen overlay handling dt-bindings: input: touchscreen: st1232: add touch-overlay example Input: st1232 - add touch overlays handling .../input/touchscreen/sitronix,st1232.yaml | 29 +++ .../bindings/input/touchscreen/touchscreen.yaml | 119 ++++++++++ MAINTAINERS | 7 + drivers/input/Makefile | 2 +- drivers/input/touch-overlay.c | 263 +++++++++++++++++++++ drivers/input/touchscreen/st1232.c | 48 ++-- include/linux/input/touch-overlay.h | 22 ++ 7 files changed, 475 insertions(+), 15 deletions(-) --- base-commit: 0bbac3facb5d6cc0171c45c9873a2dc96bea9680 change-id: 20230510-feature-ts_virtobj_patch-e267540aae74 Best regards,