From patchwork Mon Apr 22 10:07:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 791056 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 712BF50280; Mon, 22 Apr 2024 10:07:47 +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=1713780469; cv=fail; b=hqSHtawKvCjs/4HXdwGPtMqTa6N8scfTXgfrXP8wNoX5VbTWBwgS5KaQ5w2XhqAlTWePjp9WJ1QGBeKpUiPipoYInFZ9wYqC5BGtEOj+DUZJi5qO4/zyjsXwXcMPamQgNyzuW04gpyJpd4WAhneN3t9vCCq8Iy0TQdKsxTG6wsw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780469; c=relaxed/simple; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=nejg7ieqakLzDhNlsMXwTVasVLI3BAbi6BJqwyJA2sNw8BNSkkGXlyhtaUX3yEBugU2YJUGCrSu1RrSMJ5llr2ZVvgLBWL/FhPGBi8fHBUpyjTlzvmKFTbMfBXVz/GITmKH//qMLX/6lInYVL7NB/r7Mk//NiqZy1+ymf/9WNec= 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=H8WUzLp+; 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="H8WUzLp+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVYmKs2EJB0bRBy0l+ZPHIz/FHjPFZNjU0j37qLoSakvDZIX0M3wssO1R/9qavRGcnfqwCY3W+T6JAFbRrXa9h10opyRN7k/k4U1zF3fTk24HOU2dAv5C6ZcbFfMbhu00DYzrd3CYWwzstZLJyWUMadeqCQDOGjAR8SI7o31yHJK7XgJAbiMlOXC1X4wY05RLElwfyS/tLq6iUyJ/gRtB4/p+gNjoHhBaIelOL1mihj/rMRHx+RqB5GU1F2nast20osPGvL5Z5yeSi7pbT7PhVXRZVOx+BdIujZmMk8T3iYshr9S5ZooOfAG9TXnaM5wcu74CsafVsZkfAHKxp67DA== 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=adibL7lvQiAIXT1YwZmP5G7daAB3Kuwxo1L9KUSFaz4gzsP4EMFr9VlboIJIAW5f+bybEZyG0cKh/LtY2KHgCHYRfgUnndNhER2HBPUeTB1WnkUqLOsEt5C+BQvNpqpaXs1UwjLL9TvOBOqHuMHuu2DxD/0VPbYXN6Lbhon2SqZcA/JxET1o0R3PWv3M1SFXPTF362hSrI8lcfYK2RUhCud50fr0+V0QvDHrRdZkR2BlQ+YYm4PHrjI8UUa7s66+T7PYOmzkJWynIS0JKqzKSU1xCmZp8C0DpTh4K3mS9yV6j9BnCIeHuBd9jwNDF84/eulzpKRRXowUT51cNyQ4qA== 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=H8WUzLp+rXEtwEw0nx3+XvNC5+3Gt/E6g08B8H33aD2+2C0qLxfgjDz50rzebpWQU44reH/H/vhl54eNuaUd1wT+1wWRPh3Lb1JtZv/rnHwhwi8whf/9zw+gmZkZsSdPNdUxv/DysUj5PJMqjrMrVEuPcwEpjYJWDuJew8nGBWE= 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:44 +0000 From: Javier Carrasco Date: Mon, 22 Apr 2024 12:07:37 +0200 Subject: [PATCH v9 1/4] dt-bindings: touchscreen: add touch-overlay property Message-Id: <20240422-feature-ts_virtobj_patch-v9-1-acf118d12a8a@wolfvision.net> References: <20240422-feature-ts_virtobj_patch-v9-0-acf118d12a8a@wolfvision.net> In-Reply-To: <20240422-feature-ts_virtobj_patch-v9-0-acf118d12a8a@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=1713780463; l=7148; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; b=iUybbeYwnurMTqQP5jqT8XMsCqrn4WHlnrhQK0/wtZO9q7xzpPON4JsIdKsSJ7jipH6YpeGNf 0/Sb8Utv9m6DszcLtI1YmBUo8Pg5MfXpdLBWXrVNIYXamQyhxFPe/hs 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: 11e8eb70-faa2-46a6-d2c3-08dc62b40da4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?q?OT4cAufpRGXFq2KujawXP371mnXOvCg?= =?utf-8?q?UehzJ3Wb0mpm34/UoRFnYUDn1e8Jitrf64oDT+8PO2JhPiL+bD7m00i8lwQQPlJA7?= =?utf-8?q?BHOCvPvAge2ZZlamtz3yNGyZdjVv0oJCgMr9u7uILViIpsSwWTdXOhN4233mQR/oI?= =?utf-8?q?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xw7xvYjub3yNr09O1+1NG00KpH8brWolDFtOBF49mTLuq0ym/B5Zd?= =?utf-8?q?YiUha0Ta+RyImOsvBN0MAZkCFuyk6PKocCLxwoJGk/S74t64IbOWe4ATtR3c5geeX?= =?utf-8?q?OYd1wc4E8fCfwr7UOKVeGMyJkqpvabWD1CyWyTcgKJ7gPEBwdg/aO/zeuWvn8nrIz?= =?utf-8?q?Dzd2/+PGV7gJUmKpmm19bINVzUojockFar1z6nm9YdF3M1KNxNY7hXNons94KSvrl?= =?utf-8?q?8OSV5icizBIwtOhBqVgNpwdtDgQDKTzxSEw=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?V/6rotWEdZBl+6uFOlZS3rbspTb8?= =?utf-8?q?sGk++z9vaeLN0qsgHnJMGBEMuWH70Fu+OXydQ3R+hudf/lj7FpfIWMIBIdIgXm1kH?= =?utf-8?q?jIlelYnZ7cUVuAVQaAA9qmzy3znNme4rVtuCHQ0vTIgjKomlaaKKbtaZB5Cf4N6Zn?= =?utf-8?q?78inhyGp2xG+e5FPWhG3YpcF9wsOl+n8NQ2Pn6X4WAOnHVXS2+bxMZHUo2NULpPbW?= =?utf-8?q?E/MgCpLhrisUvbiS/sVDrlmvsqCb4c7pzLbny8EqybxziPs0Yr80TlL5Az2FVz/Hq?= =?utf-8?q?QntsA5LFeVk8bvvhaoB+2RX29sNbiOzpgwmeasfa/xio2dZKK/ov+pvPiGXHC79tJ?= =?utf-8?q?uKvPJ+ytlJfQNxm16MdqIpxYSyIUk8Burfv9Oa852naarswNnlNveuf0CyM7tdOMN?= =?utf-8?q?KPsYQVhoId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03X/cDKqY1mCOadG+rQR1kRf6Oxj/I8QrqHtPZ0dXnhJv+6tLN00PGZUkf?= =?utf-8?q?A+I6AZ0XvCI6aMivpp5QtfFxTGGLpk7UzIaToudFlD7k4x/EAjsvsXlNAW6Hh9axW?= =?utf-8?q?K4TBP//lojHWmcnbePFqc1yXhC0HKAV8ZtKEbrBzw7f/Urn9IDlubHumA9xRp/R6X?= =?utf-8?q?lAqAIFl5UTAkHUX7EThOHdvhFiyIt3u5Hr1MMrmKyfWzsxWOYZZa/puAi7g807Tzv?= =?utf-8?q?dzDrqiKmN/5TkCS9cfH2Z8gGrksuBQDSIwDpxtnUmVlv2l4RZqfGb+s=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 11e8eb70-faa2-46a6-d2c3-08dc62b40da4 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:44.3662 (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: OpKWzflexGb6shr0zRBwBw4vKr0oXv5MB3169SMSahMfovafnb9qWftXbuWkPA9lcFaBk9o4DcKvG9RuUbaeH7/Hccf8DalPaKImcCXB+u4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7885 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 ]