From patchwork Wed Mar 20 07:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 781442 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2094.outbound.protection.outlook.com [40.107.22.94]) (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 D90AF3D3A2; Wed, 20 Mar 2024 07:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.94 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710921503; cv=fail; b=VxcV6jn3KmQLtPWIAN1/FX0zKBGLOab4i2dgPniqCOB7XSxtbO/VQybzHDoSI9EWZLDegxpqqM6WdW/loH1OjqArGZpVKboWwF+Kf6PmfMhujaRoNDoz7Dj8x3aSMh/++JlNaVw1Gp+nQRV5hM0CBpzJO86WvMNWEH0+TYOYCwA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710921503; c=relaxed/simple; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=LBgeUvo3SZ2CEnMEzueHT2+fPyIPllGxmCIOW7YqHzw+oJOUqkhSEzHoeMR0wcv8OA5wfMPkGx5RB5XKx4o4q74IIMc5w4GPHdqKr24g2XE2vkJlEYrEb2SdfwSt1tjzg22NZU0ZEiDCO3uFzY2Nm2aK/X43gjgFAioJp3Tortc= 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=21Gv6cL4; arc=fail smtp.client-ip=40.107.22.94 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="21Gv6cL4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdJvp34sTn/Q9Gk/Nvf8nMshRjWB6ygMpRpYHDb0wmpgY+byUPyP65GsRO8HmGBG5WEah6iXwiJuonbeKOO12acr0zjIghEblkVZfGqcRhHHeshL93oHTf2Gifx80iJJvz1Pjh5hHelbYfk7RJDDGiXBKrYyZ/GXs6sOw5pAQzC9Bd3DQ37pLlM3mRIFSMVKobEBY/bxx/aMSTaoKq0DGJDBlrx64L2G1hcNCeUWHxq1ENwhwTmkBNlc05sZ/D2yj/C+ujeklXqy/567ZocLE/D813FMa6QGYWZLGjv2tIsTJTf+kL/epaEwTORqYg3ZW2HSLmFHB1C3slLTDu8ctA== 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=cfCKh8qkRYDppexZq94R3dAz72VQ+zdbfI4I6qb1Ddtb0mX7WqMpau1zKuCaK/TeonemG29heUnaKk05dVe8zHnhbqIpNqCe9CaBqh5Tn3tkxylb6Cpo1LeyeCjEeJbNUIV49WGMHF796M03DP8AXkdADfzZNK8mnaul0+rnU43p8mC6FMKEMN8T2t5AE0dJQx548voFEKJxkvahZnDH2YK5RtIPTufvbzjCo5sws1p7eaMGXx01GDY7Xvin8eBvUMNEbMHRpkcGGzKKLkh4Xp9KM5L74TLzKBE+XRA0SKWUU3y1Ihool+TqcrT999/uAuJplPq1J8eGSN2KJTjrrg== 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=21Gv6cL4ShvdUCH9xl/IE/OQnMK4nFBsCejNn5EabWS5NsGYR9pkZqHqa2IOmP5l/1uVArWe812abOoq943lPc26gzojjVhplAoMTNBPAyDbDya5gbmOL9RT7VPQHtYW6fJLhHGhiB7mTmTjiZ3+MiC1az8vHle5Guwh9lQfqpA= 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 DB4PR08MB8056.eurprd08.prod.outlook.com (2603:10a6:10:387::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.28; Wed, 20 Mar 2024 07:58:12 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::9e35:6de9:e4fc:843f]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::9e35:6de9:e4fc:843f%7]) with mapi id 15.20.7386.025; Wed, 20 Mar 2024 07:58:12 +0000 From: Javier Carrasco Date: Wed, 20 Mar 2024 08:58:06 +0100 Subject: [PATCH v8 1/4] dt-bindings: touchscreen: add touch-overlay property Message-Id: <20240320-feature-ts_virtobj_patch-v8-1-cab6e7dcb1f6@wolfvision.net> References: <20240320-feature-ts_virtobj_patch-v8-0-cab6e7dcb1f6@wolfvision.net> In-Reply-To: <20240320-feature-ts_virtobj_patch-v8-0-cab6e7dcb1f6@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=1710921491; l=7148; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=We4djLZrQmwTewoy3TXvLCuEcuRF2BZn64gf0yEafpU=; b=xbHRhMZf3j2RJXqiOH5VwThjrghylI62i7Te0nmyw8Px64oiXiYMacbBViloJUCZ3HqqDv+aM Z2sWHhxXg8UBYqqzDHlrxHDujW/M9PxYuxbM+9oMoZ2a7EWMlXHchxj X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR07CA0286.eurprd07.prod.outlook.com (2603:10a6:800:130::14) 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_|DB4PR08MB8056:EE_ X-MS-Office365-Filtering-Correlation-Id: acaa3bd4-d3d6-4005-8198-08dc48b37d39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sbOtxcf5uWKR60WedFeSXS2tSSPlMGRZkP9aC/uXFoNfv70ktWU9Md26zWwtrNu1hNqLJ+cWH3+wt/AsFiZk095RekLUXTt7wWnhr2oc+gV/lTb/rQPaD0HnDhgtybL+xCCtyR1BRDBKHGj1ogQjxaYuJEInbDNG1bUtlXCFwmWBVLCIVcxP+V1larNCh7ZS5Is+E3V4L0z6Reteul3/qdZd5L89H78MGdi+vHlmT+XfnjD2T90kMJV8w8IPhDwK0XETLLFDrPv6fUd4GYKM+j0Vc89x1OdNZWiJ7Gg9LgkWOguDi+tUg+iHHMHNMDYtK/PzkeMvFCKEhzDGEbHlmOh6XPzvQ6FCM7QOnnlAQ/RMF4tNElC5reKZnk48VpAQNL11/tqNkWa5CZmHf6lWeqMh34/m7b+4nn1lTZC+TnWoNxMglGGqnuSahbqUKKOA4s8W1qOLVOYZcYpd2lb8OnIJVUhkRDkRGdgq3CWQcHwO3otMPVpwyo0Ik05nhfa+Ny5uZiHoELwVTktXPb/KWXFdQHLM4kfKD0dv7kddmhL/yJC6A/JnXH18JVqhT+d4b8P6ZBCIFS3TYBZlKn9RXQCUp19z24AVw/leWDrLHWMG+R0QvLB+1DofvbdegZpocWVNrb9lFOXz/qaqgSlEYDJ643NgAUmRydUZbGxvu2aDesBYINOOTU2HYdBcc9GyVcQI43j5m3xWUkRNa3Y3ECt4+b5kKnME95bVxQMyGzA= 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)(376005)(366007)(1800799015)(52116005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hmogTsHP0I+O6p8/pIaZt+tkGsfu?= =?utf-8?q?CTR7B6JX7oXZUH4RdRFKFLXvhxVEJA+wH9GBG5VMAMwEMz0zkvw0cfrq1OfwEJAVp?= =?utf-8?q?71Aq7Skcb5jXDd3DQmlsLdeAuru+AzLsHrtV8wkHYkZKhQ5iWqbvXaiY5bPk3lQ9L?= =?utf-8?q?SmfVr1W7MeMAUBHcN5JXjsowmS6vwQw/3Y+qgoCuhF1GjU1tMfQgsLgubM8tz547Z?= =?utf-8?q?nY6gNvTbMT8ckAR2lwciA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QNHyKvwMz1DIbhKbfc4YAt/hFMWeaGIhBD4ssK9YVQb?= =?utf-8?q?VBO3jKA0bjsFTFbCqQ6H704xXOGAYoiFtlHpNd8vEHriMFvrlSaT1bGj3/ovXg/gX?= =?utf-8?q?+PLuZlW1bObNpd3HmstS/S7h6BEmfQ/oiLWf7I/4uxXWWPdINBo3EUDrvLQ5MY9/U?= =?utf-8?q?aElr3iQLvB2GQGemHKQ/pzpvZzbdLB2yJDnwtlKfvsRxGSiW+ttStcI8lvH96wDPI?= =?utf-8?q?QWansYxNHAKa7yE9LB3nh4veHSeIY4dFWvU4ZF8ATQQaoxsPhWSjkH1vQpJ4lxSbc?= =?utf-8?q?4F+QBRwLGwdWPtpBMBQoEbY1lBhqYd7PhSb5cUx0BW6Ly9sZj3WLmoFOCQk8DXlSE?= =?utf-8?q?2T6J/JBTGugTwoJKVyrv+fOkxK8H3MynT7X1iaYH2TmYc8bYYtaFN5Qdx7nvuduyF?= =?utf-8?q?ezhn0SOqPHk4qXvg42b/5u2ulbx+/VNBmktAHV+FpyQpDapn0C3HA/Y=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: acaa3bd4-d3d6-4005-8198-08dc48b37d39 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 07:58:11.8159 (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: Y3MmJMPNSRioVrs0+cBcYF5+tsn5XWTJhLhLYV6SV2GpBpmdMrdBM8s/ispNCwfB7EIb/dL4hsa0OElqQPHEXskPZQe94MVO38PTAFCuHKs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB8056 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 ]