From patchwork Wed Jun 26 09:56:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 807618 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2134.outbound.protection.outlook.com [40.107.104.134]) (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 801D116F0D1; Wed, 26 Jun 2024 09:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719395789; cv=fail; b=G1be8I3gD1SHYKhJWUL2lRph+w6MJULPb/wU1jONrk9QCtrjUYz+1BFmefsCXY6CTQ0x8keoKj9IaW6oLRCSnxvQ0G2gHCXoJhvrbUVisKscIUrr0C3rJNj5M5w6IBfrjUlnpMti7IlwgZ/CugUdPNSsp+EvYHx7QT6stmed2rk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719395789; c=relaxed/simple; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=b2b9TFFpQq8jxF/XoIkRuOkMadgttaOOBaxbVxkk44tlZzgYIv53du4AjziaNY/BI/D/E1WREINszmESdg+KCYRn3eF5hM22w/N0l0VXh+v08p3d0peeCj/0OAfSkZTEWR/sHiJ/uInnUvqHZ1hIxjzCZ5XleHgV87NiDi9meJg= 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=UiCYjQIc; arc=fail smtp.client-ip=40.107.104.134 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="UiCYjQIc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCi1vMbb1booEQ5+ovz0I1f0yzfOLOU1RRSwuc1iA8zAEhpwcAsnmw6H88lymkzowhriWAbhBuWW90Z97o3dQCzS20b2nRRqXwrtXsFXH0UTBGeN7GZ2U0/D4VY5bKk0Yrkg0prsCdWJoWqo7DzZ/qKCYE76LUddSQs+lX1o5uO2pVcL5mxd8UdZoy5SCKV3db/umOnEoxZQ84RYVcILt/zuS2feDZ08d1HXos22nB4nAciFFbXnkqkG1ZLmITjvT1WiEzCB3OWRlyw24UkGTowq3h8RySkcuXSbGjjQ2SuHi01n1673DxJlGs6dNdveQA/xzsgCPPDEWi06evRgmA== 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=lRUe7KDkC01XwoHUft0RG9xZV2wyedfrobtHpSyaX+g=; b=FBeMhlwBUBqcwB8kFqb675DwjdqoqL5RGoP92ljtj91MzpRNLuhbbgq8dCp8990E5v/JzGYTdl7aOapBO2i308yPP0uv0a3bQ7RmWVY6uw/Yy4QRpV21pu9XduKYvfmSO+/vRVIu2yKG0Dh6xnDtWsml0NcP49piemrmQnxaEPDbai4+DaeD8RRPmKV+F+v9QZoLQxfCoiDpO730hg8fjE4yO64IgudbEC5HtGS6xaTMPBvNJMDzunhZXMh78Zalo8acCos6o5AtmAg/5SDkGD+/AjtLJI4gEM4MP0D2dnT1Te+ZQy9r6tQzzY003FzgD/oLEcxbJKw6OGjP9SFJ8g== 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=lRUe7KDkC01XwoHUft0RG9xZV2wyedfrobtHpSyaX+g=; b=UiCYjQIc9WzBNVC78GkJQ1CUJR3kFZYFiI14+ZrLXqk3Kht1J2Kh0qE1Hgz9QD7tlsblVkRIheq3LTvm+Ez/Dm57PB5Ay5xAb8YmuYzwIgzgBKtRIBIjsPUhCNFr6M+gtSMJRuptABTrled2LeLdgJKkZumPXFGunZ56xmrDttE= 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 GV2PR08MB8679.eurprd08.prod.outlook.com (2603:10a6:150:b3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Wed, 26 Jun 2024 09:56:20 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1%4]) with mapi id 15.20.7698.025; Wed, 26 Jun 2024 09:56:20 +0000 From: Javier Carrasco Date: Wed, 26 Jun 2024 11:56:13 +0200 Subject: [PATCH v10 1/4] dt-bindings: touchscreen: add touch-overlay property Message-Id: <20240626-feature-ts_virtobj_patch-v10-1-873ad79bb2c9@wolfvision.net> References: <20240626-feature-ts_virtobj_patch-v10-0-873ad79bb2c9@wolfvision.net> In-Reply-To: <20240626-feature-ts_virtobj_patch-v10-0-873ad79bb2c9@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=1719395779; l=7148; i=javier.carrasco@wolfvision.net; s=20240617; h=from:subject:message-id; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; b=YlK4JaFidAVMRn33kw1XiwovX2umUaWolUAhUf5+jWXp1ufEs4jEbzu5fz9EoCQAQOa3fabxz 4NqfySMMCDxDjKgtwxROK1H5apOPE6b4GAotRXyhlnboxGs1HI7BdAE X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=hfASRUP6l4lf3Lo2mjLM085/h37dT3m0Qj1HejXDPDc= X-ClientProxiedBy: VI1PR09CA0118.eurprd09.prod.outlook.com (2603:10a6:803:78::41) 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_|GV2PR08MB8679:EE_ X-MS-Office365-Filtering-Correlation-Id: a988b97e-b829-4cf2-ebb5-08dc95c63a86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230038|366014|52116012|376012|1800799022|38350700012; X-Microsoft-Antispam-Message-Info: =?utf-8?q?SaCwmkPQDJC8C6lGfhJFg6Qv+hku3WX?= =?utf-8?q?VuV45EgJDpVc7p328KSzLkmvcbWANo8iLyAiOiGHgNCRzLKq1E2236xMi5SS1tF/O?= =?utf-8?q?moX9oWmYBwiQvwViwl3v7Sp6ilSmjLr5ve1YcGFqw8lPI2+OeGqLMEKt6ZQFzzUqd?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NDlc85LnhadiIi/EitvgMJx+oueLHO1oh55EUul8x768GNrHJvDrf6?= =?utf-8?q?d2PZJ2kbg23Mx2mEpn28FSF57tfpiUUrEk2G+tnFI5zJOYf3SraLWf3+ZZ6Tc2N9r?= =?utf-8?q?yykYNh6yanXRRhKWNlrDMpScZJwKV/b7yn+4k5ACfPIvMTRPtAwOqbrbu1i98qhMx?= =?utf-8?q?Ds/0H224E3CI395z9qgfqPRnOMaTbkz8gSZgeg754ub61s++XmSvdSp2fM7a5chTA?= =?utf-8?q?uofaKygFyqbAEiaccRQJGnC/Zvw7636jwsfMNZNPRGu4M9oHXDct6CNbFHbqQ70Np?= =?utf-8?q?DJCFNfbgfZoBaHmSrfHCgY/bw/kEbcSzgw=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:(13230038)(366014)(52116012)(376012)(1800799022)(38350700012); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LbSOYh43TFaWX3UEXFlwI6lr0Yx1?= =?utf-8?q?hsC/llruA0xGGlG1/EKSRU5OvqkIOvFzFtvS9BEyqTzE5K0on1El+qrVIl6LwFQbz?= =?utf-8?q?/StB3ZsRkwa/F5f9U+rqmLjmmMPy53zPV8WlmUklxKtlXGn4J8drfKEIYw+Rxh6oE?= =?utf-8?q?84EQJWcXs99MFXSpV+eyhZPjBE6ISH2dEv99WvwJjziTZ3uUjUWXKLCRTuxP146uC?= =?utf-8?q?g6oiOem+kq4uFL3XxZZNdHv1HVauyGRn3/iBd9qFQQ8VH38atKhcvgfpMpcyDibMo?= =?utf-8?q?6B9lMugouaBg6JDvKxa2zmlnOoF7Mu2BhkBlQFnkmTtvmLXBhkIi2h2nDrMB0v9rg?= =?utf-8?q?mB7N0o3I2cGa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XMxNM6IAZGMPvi4rlzS5gkjS?= =?utf-8?q?cZ5UBgHCCphH2WileE6FS0BhZwONE6pJztHcV/uWv+6dZXiJhR0QDj1dLDJr8geB7?= =?utf-8?q?pWhi3mKSJKMjpLCC3adRnhXmpIfANghJ0+B8RbDABbESA0aYbZ/TNIa4C+jb81ryF?= =?utf-8?q?8cI5M95GnU6VrUqSS1aZYhDM1klOBnKP9SzxqIxAF/dxrokN0yUaY8LLvUKYSpG3f?= =?utf-8?q?SXYoPleQk4ZjOLB1WWqqnAmkcNBXL7Qawbc8MRiNvTifpRynXD7alnDw+Er8UF2kh?= =?utf-8?q?NwwtQt7xlMj17Z87u3YEVoLZrM4DQU2tF8l8u+R2Haq6tY729a9luHQ=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: a988b97e-b829-4cf2-ebb5-08dc95c63a86 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 09:56:19.9003 (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: wOIXqecYMEBws73wjpv2ogeZLtE/2K7L2Vig7BGKlg2ftbB0rvFSVDUs06qRXh9NmE4YdMi8nknm/yuaONedUyGvwHKETn1gTTlBNnjVEIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8679 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 ]