From patchwork Fri Jun 16 07:28:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 693407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FF73EB64DA for ; Fri, 16 Jun 2023 07:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244952AbjFPH3i (ORCPT ); Fri, 16 Jun 2023 03:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245003AbjFPH3U (ORCPT ); Fri, 16 Jun 2023 03:29:20 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B519B1FF7; Fri, 16 Jun 2023 00:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KW2ZCjVcqrSx0jJJlLLU7fs2bTIcKTmMuywe8sLkT86jEszPKNqzDzBhZ4pyZ4LxhrQ/aG0+27njd9YBuujK1+cz1Nhr6BS1evM7Yv5oPI2EGHDPDQCZaJYANKtkf/5G1pv/M8jJSaj7nxhrKsmCrraqx66Ct8yqy+I6dPDEwHBdTCzRRhlnMvs2aYRQ2f0L1iGC+1Wjlufg7CxlTTH8YQdEsHH2TQffbLgWd3SAGWH17N1R6g5nmx6t92jUxiXSiJB7iwsiB1pi+JAgicxKQjjju6W8M3BNXe4se0PlEyXenJ1oOFmD6siRt3BpGJOFEk3c+VmcFJh9UlT3YXPlYQ== 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=luM64zW1esd8nyMkAcQ8THDxfES4R30WKA+gJAsMMcI=; b=AUbat4JMqQt1TGV8SmQOr/VMdRZmWMLUXRCj6SETZpfkSvW8yZnIGRTVzG1qDH0QYlbK7WFIcAXmni2OKjYB7RM9/rRYURe3UIwQcxq3LkF9WTIHeodSodsiHqzGTggzXZ5RdM5YwpxxCz6NVK7YrRwZghrWDEiAgiSut20he4OF4xeUvWcJQnPT+cecW0/XpzoeSiq808GonCPbOHi+JriH/QLbf/9/lp2tlPuvh9MNFNL02TxxcPwnkxfxGLbdkHBvb9MMs5+AcHOO0SmBpWS4rFkZNlt4SUpEeIyXJ1MEqKqIzUBmn3oJGT1qowkRy4Hg0nyC3cQOiI/GwtP/mg== 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=luM64zW1esd8nyMkAcQ8THDxfES4R30WKA+gJAsMMcI=; b=1hSwE+AkBP3lK4OdE+U86rxzxh+ufuxjKTvQrlmIeLNW1bReCVKFkezxq2YQjPakciT0Wlj1BZPSRgYyju1PNjuNun5LFLygEhIWIckugUpePEA4HaDtV4Ul/j3iym9djP4QlgaPltgTWdTn+HSn3Y51HpaHw3IfloIc+1hNxNI= 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 GV1PR08MB9916.eurprd08.prod.outlook.com (2603:10a6:150:a6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 07:29:10 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d%4]) with mapi id 15.20.6477.037; Fri, 16 Jun 2023 07:29:10 +0000 From: Javier Carrasco Date: Fri, 16 Jun 2023 09:28:52 +0200 Subject: [PATCH v3 2/4] dt-bindings: touchscreen: add overlay-touchscreen and overlay-buttons properties Message-Id: <20230510-feature-ts_virtobj_patch-v3-2-b4fb7fc4bab7@wolfvision.net> References: <20230510-feature-ts_virtobj_patch-v3-0-b4fb7fc4bab7@wolfvision.net> In-Reply-To: <20230510-feature-ts_virtobj_patch-v3-0-b4fb7fc4bab7@wolfvision.net> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , Bastian Hecht , Michael Riesch Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686900549; l=8153; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=KNTIfSGexgxo0tpiTfZ54RzJDduakcxWEC2nJNHuT4s=; b=ltNIhCOlY0PJqO16dKMpSugz7WDUxohG992RsHoBdVKwGna767TwF4PHsB4W/rrEgU+OFPTAU aJ/OpiRbkckAu/gvx3+boq6voCh3LQ8bLDWcwPB1y9nCvOnSP77rTGF X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR07CA0197.eurprd07.prod.outlook.com (2603:10a6:802:3f::21) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|GV1PR08MB9916:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bee18e1-eb01-49d8-b904-08db6e3b6049 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LZvAZ+I2ruoVlLg1Ha1+PWtFBhlIURvB0d6Urq8B3txBIG3Yu8Wrfmcv8OFUZXmVgYBoHYkHO3mNXbneSCDFEY+SRpxqG7uMscr2B6H+2//fGgkSDXkhYS0oInebMvtdIHmFdUBKTpP9f8r0KAgLWCOEYROl4w5xqUES0HmIrdBkFDDq+emVMdVHUlaNmo+PwVBUGvobql70yuywY57eHlxi5lJKP6TdZuVe0yf6I7sNSHU8M591Eo472lrRJuiO09U7VxokUpZcmKlBA/3dOM91LGrdtvhm/SVPbNdC++AaN+028iF0kBWnh0XuvNSZBP/45llbvZMQCNSyXYAJmv5mGoiVI+X1aFRiuGEW+lAcB/2JDnmB6dI+AYgkymszT7ERj6fb4EPn1qgZLuHCXRwos6QgkG34P3jyxhbhJ6ALO7w8mayAgNmpLIxQMdUA4g8ZoKmBeVa3TNjzYhnCR2YuEV5BYP8H4Cxdopb7THWBNfF2UwJBhF/rUc2gFvgP7Y6mFg5XI03aNRO81yU6IiOHJ57Eyx7FKzhZSdRrlF6FQ4FTdYD8ILOU/5n80coJacopTLmdugaddYDnRB75yjtiiui9S1Awcj+67tVUjKDuQ2hFrXbFGmuqlEAZHrr2 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:(13230028)(4636009)(376002)(136003)(396003)(366004)(39850400004)(346002)(451199021)(36756003)(86362001)(2906002)(44832011)(6486002)(6666004)(186003)(52116002)(107886003)(6512007)(6506007)(26005)(6636002)(66476007)(110136005)(316002)(41300700001)(38100700002)(4326008)(66556008)(2616005)(38350700002)(66946007)(5660300002)(478600001)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SlJNz2/8Imm0uHCNEuENfdPWmKwA?= =?utf-8?q?KECA54h6Lx6T5/BLVAllYRfq89ksSymU4C+nUhvSn2chs53Oezp/oHeK3UiJkJd2W?= =?utf-8?q?hgX93xujYnjOMqcOLibjxAWDqorWPu3creOhPzhS256icv+2dKqZsgOlzc7/gbUUl?= =?utf-8?q?tda1LMVxagreyFtbcYuKhkfbLES8UWSTdsq//h7kvmEJ37hvdj/KVqWCzB0RJIFTF?= =?utf-8?q?gsRitvpLDZ9W8L5LYh7GuoIRY0t+6xVXc+qKTy31JXDihVeS0W2nXcFIRkXVMAUXK?= =?utf-8?q?345pVCc1aAuJNzYvsDYfy0CiGwKsxoK7ardgoE6vxzbF7V1GlcyPF1+S/lUDla0e7?= =?utf-8?q?tDbDFlsCxJwlmD8uwsvGeAqHRur3+HPXVLxMMXbMpVj40S7BoBRLbKOQJb8a3Cwcq?= =?utf-8?q?ZWzaAVo5iZgt9+N5BUBiVusO5yvIabps20x8oTqLe6rxBdDmmo2wzNzUclfW0tLYa?= =?utf-8?q?fMmvxgyAfNw8trQ7greLB+q/nglEcGEQdzUwCgILgtNYigj5QyeWlKn7YxUFOmqgM?= =?utf-8?q?qcrXUmAtKzLJeSp/GsaIW8BVTZ9dynQWAwy8ZKvGvFeT+c4pSeQ7d5j1l01w2BIwa?= =?utf-8?q?RjrtiN9FLWUKlXzT48ZLXlqCYLuxkYsvQdxXk+/uQ9vulKUdvQmr+rjbiczSx7FhQ?= =?utf-8?q?IwoRzYIPGPXjUhYDvdngbAxjSyyQRWDUIY+Ap2xTCW/waosPsqv5Mqa09gwV2yU6h?= =?utf-8?q?peNDw/R+xm23ND6cg8ngF4uFMHYR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bee18e1-eb01-49d8-b904-08db6e3b6049 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 07:29:10.2145 (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: 3QQ+86gE2p/f+p2e8ci9dm6n5aoN7KdgykY7g5ANs/oVziFWr4/jklFSRq27SAM2ItSF61r8MKUUkRX7/jolAEDqxNFueIBdptN3iJmB85E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB9916 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The overlay-touchscreen object defines an area within the touchscreen where touch events are reported and their coordinates get converted to the overlay origin. This object avoids getting events from areas that are physically hidden by overlay frames. For touchscreens where overlay buttons on the touchscreen surface are provided, the overlay-buttons object contains a node for every button and the key event that should be reported when pressed. Signed-off-by: Javier Carrasco --- .../bindings/input/touchscreen/touchscreen.yaml | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml index 895592da9626..6f5d7ac5560e 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml @@ -80,6 +80,145 @@ properties: touchscreen-y-plate-ohms: description: Resistance of the Y-plate in Ohms + overlay-touchscreen: + description: Clipped touchscreen area + + This object can be used to describe a frame that restricts the area + within touch events are reported, ignoring the events that occur outside + this area. 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. + + The x-origin and y-origin properties of this object 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 overlay-touchscreen (effective area). + + The following example shows the new touchscreen area and the new origin + (0',0') for the touch events generated by the device. + + Touchscreen (full area) + ┌────────────────────────────────────────┐ + │ ┌───────────────────────────────┐ │ + │ │ │ │ + │ ├ y-size │ │ + │ │ │ │ + │ │ overlay-touchscreen │ │ + │ │ │ │ + │ │ │ │ + │ │ x-size │ │ + │ ┌└──────────────┴────────────────┘ │ + │(0',0') │ + ┌└────────────────────────────────────────┘ + (0,0) + + where (0',0') = (0+x-origin,0+y-origin) + + type: object + + properties: + x-origin: + description: horizontal origin of the clipped area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-origin: + description: vertical origin of the clipped area + $ref: /schemas/types.yaml#/definitions/uint32 + + x-size: + description: horizontal resolution of the clipped area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-size: + description: vertical resolution of the clipped area + $ref: /schemas/types.yaml#/definitions/uint32 + + overlay-buttons: + description: list of nodes defining the buttons on the touchscreen + + This object can be used to describe buttons on the touchscreen area, + reporting the touch events on their surface as key events instead of + the original touch events. + + This is of special interest if the touchscreen is shipped with a + physical overlay on top of it where a number of buttons with some + predefined functionality are printed. In that case a specific behavior + is expected from those buttons instead of raw touch events. + + The overlay-buttons properties define a per-button area as well as an + origin relative to the real touchscreen origin. Touch events within the + button area are reported as the key event defined in the linux,code + property. Given that the key events do not provide coordinates, the + button origin is only used to place the button area on the touchscreen + surface. Any event outside the overlay-buttons object is reported as a + touch event with no coordinate transformation. + + The following example shows a touchscreen with a single button on it + + Touchscreen (full area) + ┌───────────────────────────────────┐ + │ │ + │ │ + │ ┌─────────┐ │ + │ │button 0 │ │ + │ │KEY_POWER│ │ + │ └─────────┘ │ + │ │ + │ │ + ┌└───────────────────────────────────┘ + (0,0) + + The overlay-buttons object can be combined with the overlay-touchscreen + object as shown in the following example. In that case only the events + within the overlay-touchscreen object are reported as touch events. + + Touchscreen (full area) + ┌─────────┬──────────────────────────────┐ + │ │ │ + │ │ ┌───────────────────────┐ │ + │ button 0│ │ │ │ + │KEY_POWER│ │ │ │ + │ │ │ │ │ + ├─────────┤ │ overlay-touchscreen │ │ + │ │ │ │ │ + │ │ │ │ │ + │ button 1│ │ │ │ + │ KEY_INFO│ ┌└───────────────────────┘ │ + │ │(0',0') │ + ┌└─────────┴──────────────────────────────┘ + (0,0) + + type: object + + patternProperties: + '^button-': + type: object + description: + Each button (key) is represented as a sub-node. + + properties: + label: + $ref: /schemas/types.yaml#/definitions/string + description: descriptive name of the button + + linux,code: true + + x-origin: + description: horizontal origin of the button area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-origin: + description: vertical origin of the button area + $ref: /schemas/types.yaml#/definitions/uint32 + + x-size: + description: horizontal resolution of the button area + $ref: /schemas/types.yaml#/definitions/uint32 + + y-size: + description: vertical resolution of the button area + $ref: /schemas/types.yaml#/definitions/uint32 + dependencies: touchscreen-size-x: [ touchscreen-size-y ] touchscreen-size-y: [ touchscreen-size-x ]