From patchwork Wed Mar 15 04:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 664326 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 AD13CC7618A for ; Wed, 15 Mar 2023 04:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjCOECU (ORCPT ); Wed, 15 Mar 2023 00:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCOECT (ORCPT ); Wed, 15 Mar 2023 00:02:19 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2075.outbound.protection.outlook.com [40.107.95.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 114F03402C; Tue, 14 Mar 2023 21:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XTZbbUCuVaMG13BovGaQBKlCGTt5u5DcO6beSai27DkCGYt3ndH29h0p675tjyK7rfaw1FDqkinsVBpgwLr99aTcCr6zU7UK/L13ge5vETJ/UUPffrlbtzNF1qc/QI/6YLIHhYdKF7Uj0erB3qdBuhf6Bb8C7rJfDQYkDMyCqGR784baQH9g6qXYtFZ6qDzn34L9T9WJuf7ikr1XNpXLHWnwif80IbsGj/QVn0w8axskGTY3JgbG1so5SUa++EXIaPldt1UfbIGfezZyvQsKbrR0smSE52ViF9+FCqf2Ay3NgDs8fJ+HG4KYA35NIUyOEfEQlKcenLND2uFSfYTHUg== 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=HoKWlroqSJwvZksGQMcLleLe6BXzyWOY/+HRNSjMYrY=; b=hxyZoob7M+GRXKRV4Tlnb6s8aLG8g112B2282YtXn1+Vct3jA8yN5XeFAZG/hjVHmSRHelulq246OaeiS5SlZgXpFwyy5os3egIZBRQ2PmBgxW9dMW8OY2E4UMRqZ68W/c6rnrdeH+Fn+dzw7g7RX5w1K7CcHBozN0kL+XX4UDF4Bn+wFXzm6UaAdyw+/zgs69j1qHp3d0XK9pgH+2htTSgSHhI3S9hhHMF+Zwh2GKOBOJgyGgiVHhxeX6vjs+6CFfYNyktm0EhZD2Jb1Ucm+B+I932/I05U3s2KiW3OLKb2D0gGw3holRM8U2YcHpjLvJLMQJfi1C1LGKhbTyNCIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HoKWlroqSJwvZksGQMcLleLe6BXzyWOY/+HRNSjMYrY=; b=wTJlsyst2eMV4Fv68gU2dILGsmpVAotZ0i4qRy0EMYU1lIzcIP78e7+YbhRczSkYJUfMXWLV3gNmNM0VmDViJiwmcLmffRaqTSINMS3e+0t0Q7rV+BIiH27L/Trhu/k5+d/U8MMldbOxuPcHgqN53t1rWCwc5liSXnINhLhb6hI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) by BN0PR08MB7487.namprd08.prod.outlook.com (2603:10b6:408:157::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Wed, 15 Mar 2023 04:02:16 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4%6]) with mapi id 15.20.6178.029; Wed, 15 Mar 2023 04:02:16 +0000 Date: Tue, 14 Mar 2023 23:02:15 -0500 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v2 1/4] dt-bindings: input: iqs269a: Add bindings for slider gestures Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SN6PR08CA0017.namprd08.prod.outlook.com (2603:10b6:805:66::30) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|BN0PR08MB7487:EE_ X-MS-Office365-Filtering-Correlation-Id: f195dcb7-b2de-4209-9e9a-08db250a107a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8XRkRR983O+SFrPsMUk7q0QcCIumJhzup4i9Nr9OPMh0tO5A02Z7Ci4AH3XmKZSQPZKHfMZ646cGr39SaMRFB+Ra7P5jTHN9RI6ndD1EOBRu2Tci+DmXayxO0ILtEcl7JgO0FuCb+22kOaNGwpdAKAiER9+RNemAmel4eNaoNlgs/dibQuKRZ9HW92gFQSNaBGs4UI+W0bqBsit7Q38IFWTcSeTuTj3ZQqiih6rKdseTvqebqfalAe5fZ++peeLC4Sznl2/Aw5k0hZP0qd1tgcu1zkc+0f3W8RLfza+Zo4zVzmciO2dZYpyKYO8Q3XzBRzX3+Wxi6YoeIMOYstaS63c9doAJHMfOIkyAqULFyfbPutJvf6ZLuPpUpZbZodQO2XrcQlxoC9XzVlKSOjM53/+cUdAu8grRXlhZ7jwdhTfjI9g6wpSLSCWVPPOqOIRqlGFyyueJhAEjvPs7E3UPEPVxJ3LMGov9+8A+7K/0HXivCNysm/ig936E9zL4MjPXkY3K0MvUxB07oyNET0hRREi/6PU476ARBkkCbw50mmouPXnNm1vKaJlEbRP4+Q/X3JwwKAMNT0gzmyEadcib9IwgG3n5xk/91JpFLHdCS4bYyPMeu2hBGval5LwVXIpTJpLOFwx04D13GlHoebbsrw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0801MB3774.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(7916004)(39830400003)(376002)(136003)(366004)(346002)(396003)(451199018)(86362001)(8936002)(478600001)(5660300002)(2906002)(4326008)(41300700001)(66476007)(66946007)(8676002)(316002)(66556008)(33716001)(83380400001)(38100700002)(9686003)(6506007)(107886003)(6512007)(26005)(186003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1hP5J0TFuyeVQgLs5L2J45UuIwNU6NdGw2Pp84+H768lk/xdvMUXdnQUn2vDn1X6luwA/smZ2ZAayCZ46ngUeXzVDRcXqy1z8CYtj6fG6PaZnKqy6N6QUOAzOL7GCh2tZSeYXAizBe3JCGeM6itaeZN8109L9i/zPhftvLaC9GyEufxtoTdm7NoW11CmUfLst3B/D/i9zj8Z6tLVqvojreC3QkQeXQNDxAWX2c34xbp2L2/hVddI3umyaL/D35LYH0g/OqQu1gKM+IXYuWzlJduGL8sX3DHfrY+cnmOLYpZertsgcqk1kQbwdpy9ckC+YyUyGFX1mRVq4DhRFSRW2T222jXRVi0bx5MB/cDphzOVI9X5Z17WdU2JahnOO3BtqnHyIiAe4rib0w6588xLRWCc4uBfJFnwykOwQfVOgOI+o8GrZXEkjbVKOHiXFU0o/li2WdiSR9tz/7YbDkXyctdEOFbU0Ub8Empw48SDCwaFNvWqnXwTGaKTvh6YZnD63SzPYRPbE7QAQI926DqbWyPtpWkpWwGH42s5qCtqikn5QFERZN9+HxO10PNXWCgZMIayAMVmp5YlsUJNRVcFRCi/7o++HKG0YCrJUQ4mL0fJoykqR5U9nxagx/iPFZOlBIBm10D1RoWhdO3u3L3IQxXxl4WKpFWzt4OJWP+2kbQKhCAclXFoqCxgedGZiZveDT1k9R736cmpGLgyJoDlm5z0mpfd8Qttfd84wc3/6jE9LFwwVvpzn/ifTwdOsAjgKa+k828mfYc+QlqXQc+C/8Ac7VZKvt1/tBiduA2yL6tOyRJNmUJBZ6oE1dS4kGmc3vvXetKDiN9y45+hdOV+ST6PROpG8cy5seHL//N26X5rK0Z9R/gEU5VIJ6RZiW34q1CmqXWBnaCFnn8S3KkttH9PXTnzyJARMPyGHQzE3gPnljmknCrRl6MYpzTqRWHSPYTuI2bj1mfQ/QNdE/n9voIHb+nF9nFsq4aPKWmFwbyhjkD3euc4A8CbK8JZl9M542tDffc2sZmlXfaFstNbLGK8cNiAWl6h2OsTEN/vKQEKGpqI/CxedSO3hDjNlAgouTMYuL1VTHiuCPiCk5jttUwOKDQiRTmcShVMwnV8SxzIClBnxysDFQ/oIT0VQLogW9sTTMJcDVH4niewlLje71XyILqqhouPgeFLO9Uajmz5hXz85n2CK9ej/Hn6ZfdZVoZWfFatxqUcCDS+4kdTu17+BldpBlGmd6mzjXtb6DlSk+aWWWB3lCo0qFaHc3hw6XSD/cKlik+i2s1gogDOfdtNR/nDCsbGK/b8oLntQ5OncbCFB/SbKYCrrFPgs3RdUfUEeVtEy+301BoO95a7hSvAyphdV/AD62pAw5QZDZTg9qRO4MMmsIKBvmugFV8ZyhT1q1ROYAtFS0nq2xRf1nRl58O39wbQ7ACaFzqgIhv/HK8bZFeMY6uZxyMriQ1uyVC/DkTHrKidY0pKeZmrafJNoPd9m3EHkWy6vtsGcsrupYM4iahLYVcWvgbl8mBbVJgNSxaFcHI17+ezW+3mWAberZz1siynx6+OIcDjk+hXY4VQQy5xkKS/NzzjeGaI X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: f195dcb7-b2de-4209-9e9a-08db250a107a X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 04:02:16.0835 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y3Y2Ou0J1O2D+0Z89hhFFpBn4FnUlGz4gBozPMUavgUILeL+GQQm9gh9b2Peno/M6UIgGKIss9BcaGpkwZZQEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR08MB7487 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds bindings for slider gestures that can be expressed by the device. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- Changes in v2: - Renamed 'azoteq,slider-swipe' to 'azoteq,gesture-swipe' to match IQS626A and noted it as depending upon 'linux,keycodes' - Dropped the $ref declaration for 'linux,keycodes' and referenced input.yaml, which has since been updated to define this property .../devicetree/bindings/input/iqs269a.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml index 3c430d38594f..b42f07542d27 100644 --- a/Documentation/devicetree/bindings/input/iqs269a.yaml +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml @@ -9,6 +9,9 @@ title: Azoteq IQS269A Capacitive Touch Controller maintainers: - Jeff LaBundy +allOf: + - $ref: input.yaml# + description: | The Azoteq IQS269A is an 8-channel capacitive touch controller that features additional Hall-effect and inductive sensing capabilities. @@ -204,6 +207,63 @@ properties: default: 1 description: Specifies the slider coordinate filter strength. + linux,keycodes: + minItems: 1 + maxItems: 8 + description: | + Specifies the numeric keycodes associated with each available gesture in + the following order (enter 0 for unused gestures): + 0: Slider 0 tap + 1: Slider 0 hold + 2: Slider 0 positive flick or swipe + 3: Slider 0 negative flick or swipe + 4: Slider 1 tap + 5: Slider 1 hold + 6: Slider 1 positive flick or swipe + 7: Slider 1 negative flick or swipe + + azoteq,gesture-swipe: + type: boolean + description: + Directs the device to interpret axial gestures as a swipe (finger remains + on slider) instead of a flick (finger leaves slider). + + azoteq,timeout-tap-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + default: 400 + description: + Specifies the length of time (in ms) within which a slider touch must be + released in order to be interpreted as a tap. Default and maximum values + as well as step size are reduced by a factor of 4 with device version 2. + + azoteq,timeout-swipe-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + default: 2000 + description: + Specifies the length of time (in ms) within which an axial gesture must be + completed in order to be interpreted as a flick or swipe. Default and max- + imum values as well as step size are reduced by a factor of 4 with device + version 2. + + azoteq,thresh-swipe: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 255 + default: 128 + description: + Specifies the number of points across which an axial gesture must travel + in order to be interpreted as a flick or swipe. + +dependencies: + azoteq,gesture-swipe: ["linux,keycodes"] + azoteq,timeout-tap-ms: ["linux,keycodes"] + azoteq,timeout-swipe-ms: ["linux,keycodes"] + azoteq,thresh-swipe: ["linux,keycodes"] + patternProperties: "^channel@[0-7]$": type: object @@ -484,6 +544,14 @@ examples: azoteq,hall-enable; azoteq,suspend-mode = <2>; + linux,keycodes = , + , + , + ; + + azoteq,timeout-tap-ms = <400>; + azoteq,timeout-swipe-ms = <800>; + channel@0 { reg = <0x0>; From patchwork Wed Mar 15 04:02:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 663658 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 8B8FDC61DA4 for ; Wed, 15 Mar 2023 04:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbjCOECg (ORCPT ); Wed, 15 Mar 2023 00:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCOECf (ORCPT ); Wed, 15 Mar 2023 00:02:35 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2086.outbound.protection.outlook.com [40.107.95.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4B723A54; Tue, 14 Mar 2023 21:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJFBcIMeFWUPI7U4oV1QwrN1saFWFoqGbatYTTkmkkfMaiJR80P912/uXirQtEeN47pPZp1MVeOiFEAUtmSSoycP/ixmvhdE0ushUAhHPankz1e3U4oRp05gvHmqbPrt+fMERC4+NH1RfNjVrLzBotRjJPAq2OsjZJ88mwf0UhJRv3Dk3VeHpO61z32rYmHpbDJr1IfpaHyTzMZyhc44Rq2gSkix80J5BMhO/tfNECeeFVd0MUg1bG5Gh/SPfMQu2CN74PwoIWHXmZGY2vy0wyQcMMr0WAV5dBoEmG0UXLpbSpLCWtrl9/FiPDiUllKak/MevW3XXBmg+oSG1SGH1g== 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=ROw+IEDh0XBBkIURwanwzODFIHBaLIXQCMIpM+V+Il8=; b=IQhK/ljnXlEKYPFNoVb/HSrqk5aXLn0i1YhrPAdbC8vOtbbEvb/SvHoO1+AUaY3MtnLgRE2d4V5tUrj5TMWNMtuK5Z7ER1/PRjsmwRP+soL+wFE6yjN1P4Oy5nDtJRUoF/3gt98SVOdeGOUZc4fBm7dsAOp1Zhb8Gn+q6FY9jNWUxe+pC4CBYpxTZmAccX0wgCjgBpz7JgJFQ4TPDNgrl5C+RGYr99z0VP4pfXYQR9t8agvJwXp/VO3OgZVoVPLaLKubV/8HZOB5xchs8roSSvWt6BHKXnt3h0GHov2EDg/RWTl3E1ac3OAt10mv8CqFqWpA885StkhlkrU0d56euQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ROw+IEDh0XBBkIURwanwzODFIHBaLIXQCMIpM+V+Il8=; b=b6aclBsg3MiRjBtpo5t/YEQAfiri6s0NIksupdefKfrEJJWZDs/55EcgbzZP8nvhdSMWk6XJ+rGAZHC79O2luka7FWPXW6U65aOkVIAETboryIhENQxuFm9oehNrhEJ4B+b66bzTMqZxialw7c5R4aj1t5yDspfNBEboZHQpEeQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) by BN0PR08MB7487.namprd08.prod.outlook.com (2603:10b6:408:157::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Wed, 15 Mar 2023 04:02:31 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4%6]) with mapi id 15.20.6178.029; Wed, 15 Mar 2023 04:02:31 +0000 Date: Tue, 14 Mar 2023 23:02:30 -0500 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v2 2/4] Input: iqs269a - add support for slider gestures Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SN7PR04CA0240.namprd04.prod.outlook.com (2603:10b6:806:127::35) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|BN0PR08MB7487:EE_ X-MS-Office365-Filtering-Correlation-Id: cc0dc7f6-0979-4ba4-dc26-08db250a19a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yHwD19lAlTmS6LkeCPonnpth0bmFXmshLFsMd/ES8Q/X3w9bp9d5VBa4ST1KuO8EwBFtoiLO432ai5NDaYmM5TwJmCyJvYegZeUGXXNYdixcIAKJdBYioOiph0Z6DDy2u2IZax8W7CQ2lhN7XThK+pYrIceuQYV/XZG/sfK0GqKdPr7JBBa22wQ31PktFV/8S+XnDvxEsgyO/3nfgXaXh9FxJqP0Ilv6LucsoSFS4BEbnAi2UIVQxDWOdFNrzOeii9nJOM2Th8meAB/K/MjqOqRsB63HMZMvF7KU+KfK57Vgp6AvK1Rt/NgkYseS8eywPTT12ds1RFg8A6h6miZhLLcKKVSjPWTgEBreTaoINKNAkalhO9zZrRydcSGpBzDwdv0Tiyzi8/e5kROB6wjzHrKj5PFD+8PFLlJM2P/mV0KXIKe9Kk75XmVHNCiF9y7d+wP1aGZ3zfeg0/G79xBgt7qhxquKibti/+RiOEffG00f6+3rw1FTDanL6DNS3XmehPIUKcSYriKJnYm6w8Io5vvCTl/yRsRkhjnwrbABX3MZ0XS+goegoVS/nXfNReU19b8xXBWwzIhopbJVLdmzTtYnf927j76ofFLuKkuMHFiO8p++11CQgoBNoyAOHwnrC4bBY/x+xpGgZ8g0gq8MEw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0801MB3774.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(7916004)(39830400003)(376002)(136003)(366004)(346002)(396003)(451199018)(86362001)(8936002)(478600001)(30864003)(5660300002)(2906002)(4326008)(41300700001)(66476007)(66946007)(8676002)(316002)(66556008)(33716001)(83380400001)(38100700002)(9686003)(6506007)(107886003)(6512007)(26005)(186003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B6AF3ChzSexaggkbnYjYQEf+sObs2K/5ABbIhvuPLGSEIu36i9SB9XJngclbcqzseDtxLNklz3VNtMs8VfMz+vQ/A2yTowpUK+YW5pYMNB1wBp8VKsY7pIs/C9umQIXSvs3IIj3AlnyXx8NTGw5wW+7GLNFKFz7PF2zMStLfXM5lc4hV4/YT5uPfw08mbDo0/wApgIt2VCtMNiYty4zis7kxh/6KuNjfhtFjaXkdLf6ehxkQffIt30RfvqKDWUzOsC7vJJPM2VH21hnLzLe0OOh8/a2Zhy548Md6pLYHtUOTNnndoMzT5Hanj+muc3f7WeJb5Pz+U++blMxb1qoqwxcVAkFnRwLJfQ4ZnGR47RjV5/lwCfGkkY6/hSWXCMiJ8DWJW9ItTS+5IqfL6fKmJECNtz9U5xpnGDZbyB0HEkDDvA1k9xJwHZhy80gZvfpHpIDntYh+NqS14FWwCUHdqRqtl9F4dnoai+IUtCXn9Ra9Bu+xWJZmsXfMomdvA+figWoDDvbeuKUuVA+yql2CAUOPXtMtVETeQFGeXCROl23j0ub0DMYzdEHLM7TYiRvF1JgceFe91q/A6CiF/lJjJqHI7Y88FeDV/Enw+ryuUc7gb89Bsn47wTgO1uhvlUBoznFp+GPkSp8gAmkvGndR6VaQUG/BVsmNYttlZzsdHVwFhKogiPmy7POlWZtMVPsv+xTbQ5LHYD4m5m6k4rHiB3KBM6lp5mAG90FJBvOsh6MWR+XXwoQrLG3myiUa6J7S306j1Lo28M7f46IQkc3X/VIJRv0bBqTis+vZLfJi+uzGxDC+81kDyWgtzu7D80rH9jREu1B4gpzv1R8hMBwqo/RO6R6+MbW6OJ4Oo+wsCtfsUMy7nYqDpYNr77yVNbbEbsZWxS5qQycgI60DY2xQ6CTXL8lpRaR4DwxTjmhKXjkQqeY8dIzzIc2HXqYYFdy9xUx6NzB8bFm4avG9UIVvkG420Xw1sz6/3wJ7D6IwaVfVzHRuKTNN8ugSFSrhWjIfbdvIkNMvp44q/Jxe8DoZ3lLxhFxs173YFiER4PVdEoXqPw+OZj8fIwp/XzBgkrZcolc+ScKnPRwC3iuiuwUnqJoAFsLHMh7o19O2RjJU0JlMJGAl67/4+GtUibYPnNKvVE+tjkQWU9rx/x3T713VG+D6kw7dzFTQbsVE6R7kvzkMU/41hCmmIgwCiEyKYj32upL/oIB/O8Qi8rvWA+w/qiW1mxlJ0ItMuJ4BlPHiJDFoolAcGi3LvOAgDUGQLFgupTlIfKVXVIMW5+7ZV5qiJ6jlLHW3tO+GPBtoZm0dEdJWwbczbrz+e5wCzs2K1BrKgd8IyKolyAlJGDZVzEX2/Yzt05iNSAY+xiDuZdWVXrlPfW//FPN267mGclWbR79v4zanqZN88NuZ6YUw5jePCvc8vrDmBNWiDkzKXyonHt7h8OdRPFXZPFVrl6re8DOcFikx4Bm2hgI8MJiuDzyjHEZ3V/6HXC1+H016GrMCdbuO2GPKTxMahBHFYoESBvz70NgU2rbKBDkq78Zqu37jCjmL42OnHr5bwdAlAFr5+Ct7Kal7YWPWgW7IOsf1jV+i X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc0dc7f6-0979-4ba4-dc26-08db250a19a6 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 04:02:31.4729 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JqYagoKGb+59TPkeiXxJRgrVT8Ogiys1lObCYt3elkhTab8tgNUVudU4lvnxSFHPWeKrKPzxyNIlAE2kpLJTNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR08MB7487 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support for slider gestures that can be expressed by the device. Each gesture (e.g. tap or hold) can be mapped to a unique keycode for either slider 0 or 1. With this change, raw slider coordinates are reported only if the slider has no keycodes defined. This prevents unwanted mouse cur- sor movement when expressing axial gestures (e.g. swipe) and also eliminates some unnecessary I2C traffic. Different revisions of silicon use different tap and swipe timeout step sizes. Apply an appropriate scaling factor depending on which revision is found. To facilitate this change, store the iqs269_ver_info struct in the driver's private data so that other functions can use it after the driver has probed. Last but not least, a former reserved field in iqs269_ver_info now contains useful information; give it a name (fw_num). Signed-off-by: Jeff LaBundy --- Changes in v2: - Rebased onto latest driver - Renamed 'azoteq,slider-swipe' to 'azoteq,gesture-swipe' to match IQS626A - Renamed 'gs_code' to 'sl_code' drivers/input/misc/iqs269a.c | 220 ++++++++++++++++++++++++++++++----- 1 file changed, 191 insertions(+), 29 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index f4c3aff3895b..aadb24f8a638 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -9,6 +9,7 @@ * axial sliders presented by the device. */ +#include #include #include #include @@ -26,6 +27,8 @@ #define IQS269_VER_INFO 0x00 #define IQS269_VER_INFO_PROD_NUM 0x4F +#define IQS269_VER_INFO_FW_NUM_2 0x03 +#define IQS269_VER_INFO_FW_NUM_3 0x10 #define IQS269_SYS_FLAGS 0x02 #define IQS269_SYS_FLAGS_SHOW_RESET BIT(15) @@ -53,6 +56,7 @@ #define IQS269_SYS_SETTINGS_ULP_UPDATE_MASK GENMASK(10, 8) #define IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT 8 #define IQS269_SYS_SETTINGS_ULP_UPDATE_MAX 7 +#define IQS269_SYS_SETTINGS_SLIDER_SWIPE BIT(7) #define IQS269_SYS_SETTINGS_RESEED_OFFSET BIT(6) #define IQS269_SYS_SETTINGS_EVENT_MODE BIT(5) #define IQS269_SYS_SETTINGS_EVENT_MODE_LP BIT(4) @@ -69,6 +73,7 @@ #define IQS269_FILT_STR_MAX 3 #define IQS269_EVENT_MASK_SYS BIT(6) +#define IQS269_EVENT_MASK_GESTURE BIT(3) #define IQS269_EVENT_MASK_DEEP BIT(2) #define IQS269_EVENT_MASK_TOUCH BIT(1) #define IQS269_EVENT_MASK_PROX BIT(0) @@ -97,6 +102,10 @@ #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) +#define IQS269_TIMEOUT_TAP_MS_MAX 4080 +#define IQS269_TIMEOUT_SWIPE_MS_MAX 4080 +#define IQS269_THRESH_SWIPE_MAX 255 + #define IQS269_CHx_ENG_A_MEAS_CAP_SIZE BIT(15) #define IQS269_CHx_ENG_A_RX_GND_INACTIVE BIT(13) #define IQS269_CHx_ENG_A_LOCAL_CAP_SIZE BIT(12) @@ -175,6 +184,20 @@ enum iqs269_event_id { IQS269_EVENT_DEEP_UP, }; +enum iqs269_slider_id { + IQS269_SLIDER_NONE, + IQS269_SLIDER_KEY, + IQS269_SLIDER_RAW, +}; + +enum iqs269_gesture_id { + IQS269_GESTURE_TAP, + IQS269_GESTURE_HOLD, + IQS269_GESTURE_FLICK_POS, + IQS269_GESTURE_FLICK_NEG, + IQS269_NUM_GESTURES, +}; + struct iqs269_switch_desc { unsigned int code; bool enabled; @@ -234,7 +257,7 @@ struct iqs269_ver_info { u8 prod_num; u8 sw_num; u8 hw_num; - u8 padding; + u8 fw_num; } __packed; struct iqs269_ch_reg { @@ -285,16 +308,33 @@ struct iqs269_private { struct regmap *regmap; struct mutex lock; struct iqs269_switch_desc switches[ARRAY_SIZE(iqs269_events)]; + struct iqs269_ver_info ver_info; struct iqs269_sys_reg sys_reg; struct completion ati_done; struct input_dev *keypad; struct input_dev *slider[IQS269_NUM_SL]; unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; + unsigned int sl_code[IQS269_NUM_SL][IQS269_NUM_GESTURES]; unsigned int ch_num; bool hall_enable; bool ati_current; }; +static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269, + int slider_num) +{ + int i; + + if (!iqs269->sys_reg.slider_select[slider_num]) + return IQS269_SLIDER_NONE; + + for (i = 0; i < IQS269_NUM_GESTURES; i++) + if (iqs269->sl_code[slider_num][i] != KEY_RESERVED) + return IQS269_SLIDER_KEY; + + return IQS269_SLIDER_RAW; +} + static int iqs269_ati_mode_set(struct iqs269_private *iqs269, unsigned int ch_num, unsigned int mode) { @@ -1004,6 +1044,76 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) general |= (val << IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT); } + if (device_property_present(&client->dev, "linux,keycodes")) { + int scale = 1; + int count = device_property_count_u32(&client->dev, + "linux,keycodes"); + if (count > IQS269_NUM_GESTURES * IQS269_NUM_SL) { + dev_err(&client->dev, "Too many keycodes present\n"); + return -EINVAL; + } else if (count < 0) { + dev_err(&client->dev, "Failed to count keycodes: %d\n", + count); + return count; + } + + error = device_property_read_u32_array(&client->dev, + "linux,keycodes", + *iqs269->sl_code, count); + if (error) { + dev_err(&client->dev, "Failed to read keycodes: %d\n", + error); + return error; + } + + if (device_property_present(&client->dev, + "azoteq,gesture-swipe")) + general |= IQS269_SYS_SETTINGS_SLIDER_SWIPE; + + /* + * Early revisions of silicon use a more granular step size for + * tap and swipe gesture timeouts; scale them appropriately. + */ + if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) + scale = 4; + + if (!device_property_read_u32(&client->dev, + "azoteq,timeout-tap-ms", &val)) { + if (val > IQS269_TIMEOUT_TAP_MS_MAX / scale) { + dev_err(&client->dev, "Invalid timeout: %u\n", + val); + return -EINVAL; + } + + sys_reg->timeout_tap = val / (16 / scale); + } + + if (!device_property_read_u32(&client->dev, + "azoteq,timeout-swipe-ms", + &val)) { + if (val > IQS269_TIMEOUT_SWIPE_MS_MAX / scale) { + dev_err(&client->dev, "Invalid timeout: %u\n", + val); + return -EINVAL; + } + + sys_reg->timeout_swipe = val / (16 / scale); + } + + if (!device_property_read_u32(&client->dev, + "azoteq,thresh-swipe", &val)) { + if (val > IQS269_THRESH_SWIPE_MAX) { + dev_err(&client->dev, "Invalid threshold: %u\n", + val); + return -EINVAL; + } + + sys_reg->thresh_swipe = val; + } + + sys_reg->event_mask &= ~IQS269_EVENT_MASK_GESTURE; + } + general &= ~IQS269_SYS_SETTINGS_RESEED_OFFSET; if (device_property_present(&client->dev, "azoteq,reseed-offset")) general |= IQS269_SYS_SETTINGS_RESEED_OFFSET; @@ -1012,10 +1122,11 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) /* * As per the datasheet, enable streaming during normal-power mode if - * either slider is in use. In that case, the device returns to event - * mode during low-power mode. + * raw coordinates will be read from either slider. In that case, the + * device returns to event mode during low-power mode. */ - if (sys_reg->slider_select[0] || sys_reg->slider_select[1]) + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) general |= IQS269_SYS_SETTINGS_EVENT_MODE_LP; general |= IQS269_SYS_SETTINGS_REDO_ATI; @@ -1106,19 +1217,37 @@ static int iqs269_input_init(struct iqs269_private *iqs269) } for (i = 0; i < IQS269_NUM_SL; i++) { - if (!iqs269->sys_reg.slider_select[i]) + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_NONE) continue; iqs269->slider[i] = devm_input_allocate_device(&client->dev); if (!iqs269->slider[i]) return -ENOMEM; + iqs269->slider[i]->keycodemax = ARRAY_SIZE(iqs269->sl_code[i]); + iqs269->slider[i]->keycode = iqs269->sl_code[i]; + iqs269->slider[i]->keycodesize = sizeof(**iqs269->sl_code); + iqs269->slider[i]->name = i ? "iqs269a_slider_1" : "iqs269a_slider_0"; iqs269->slider[i]->id.bustype = BUS_I2C; - input_set_capability(iqs269->slider[i], EV_KEY, BTN_TOUCH); - input_set_abs_params(iqs269->slider[i], ABS_X, 0, 255, 0, 0); + for (j = 0; j < IQS269_NUM_GESTURES; j++) + if (iqs269->sl_code[i][j] != KEY_RESERVED) + input_set_capability(iqs269->slider[i], EV_KEY, + iqs269->sl_code[i][j]); + + /* + * Present the slider as a narrow trackpad if one or more chan- + * nels have been selected to participate, but no gestures have + * been mapped to a keycode. + */ + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_RAW) { + input_set_capability(iqs269->slider[i], + EV_KEY, BTN_TOUCH); + input_set_abs_params(iqs269->slider[i], + ABS_X, 0, 255, 0, 0); + } error = input_register_device(iqs269->slider[i]); if (error) { @@ -1167,28 +1296,62 @@ static int iqs269_report(struct iqs269_private *iqs269) if (be16_to_cpu(flags.system) & IQS269_SYS_FLAGS_IN_ATI) return 0; - error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x, - sizeof(slider_x)); - if (error) { - dev_err(&client->dev, "Failed to read slider position: %d\n", - error); - return error; + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) { + error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, + slider_x, sizeof(slider_x)); + if (error) { + dev_err(&client->dev, + "Failed to read slider position: %d\n", error); + return error; + } } for (i = 0; i < IQS269_NUM_SL; i++) { - if (!iqs269->sys_reg.slider_select[i]) + flags.gesture >>= (i * IQS269_NUM_GESTURES); + + switch (iqs269_slider_type(iqs269, i)) { + case IQS269_SLIDER_NONE: continue; - /* - * Report BTN_TOUCH if any channel that participates in the - * slider is in a state of touch. - */ - if (flags.states[IQS269_ST_OFFS_TOUCH] & - iqs269->sys_reg.slider_select[i]) { - input_report_key(iqs269->slider[i], BTN_TOUCH, 1); - input_report_abs(iqs269->slider[i], ABS_X, slider_x[i]); - } else { - input_report_key(iqs269->slider[i], BTN_TOUCH, 0); + case IQS269_SLIDER_KEY: + for (j = 0; j < IQS269_NUM_GESTURES; j++) + input_report_key(iqs269->slider[i], + iqs269->sl_code[i][j], + flags.gesture & BIT(j)); + + if (!(flags.gesture & (BIT(IQS269_GESTURE_FLICK_NEG) | + BIT(IQS269_GESTURE_FLICK_POS) | + BIT(IQS269_GESTURE_TAP)))) + break; + + input_sync(iqs269->slider[i]); + + /* + * Momentary gestures are followed by a complementary + * release cycle so as to emulate a full keystroke. + */ + for (j = 0; j < IQS269_NUM_GESTURES; j++) + if (j != IQS269_GESTURE_HOLD) + input_report_key(iqs269->slider[i], + iqs269->sl_code[i][j], + 0); + break; + + case IQS269_SLIDER_RAW: + /* + * The slider is considered to be in a state of touch + * if any selected channels are in a state of touch. + */ + state = flags.states[IQS269_ST_OFFS_TOUCH]; + state &= iqs269->sys_reg.slider_select[i]; + + input_report_key(iqs269->slider[i], BTN_TOUCH, state); + + if (state) + input_report_abs(iqs269->slider[i], + ABS_X, slider_x[i]); + break; } input_sync(iqs269->slider[i]); @@ -1599,7 +1762,6 @@ static const struct regmap_config iqs269_regmap_config = { static int iqs269_probe(struct i2c_client *client) { - struct iqs269_ver_info ver_info; struct iqs269_private *iqs269; int error; @@ -1621,14 +1783,14 @@ static int iqs269_probe(struct i2c_client *client) mutex_init(&iqs269->lock); init_completion(&iqs269->ati_done); - error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info, - sizeof(ver_info)); + error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, + &iqs269->ver_info, sizeof(iqs269->ver_info)); if (error) return error; - if (ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { + if (iqs269->ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { dev_err(&client->dev, "Unrecognized product number: 0x%02X\n", - ver_info.prod_num); + iqs269->ver_info.prod_num); return -EINVAL; } From patchwork Wed Mar 15 04:02:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 664325 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 AF890C6FD1D for ; Wed, 15 Mar 2023 04:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjCOECn (ORCPT ); Wed, 15 Mar 2023 00:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCOECn (ORCPT ); Wed, 15 Mar 2023 00:02:43 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2064.outbound.protection.outlook.com [40.107.95.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF17423A54; Tue, 14 Mar 2023 21:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQT4/LtjdQc/ZLYmK9SvkqCRBo4aZkLFiXcZgMDOci6Dn/WaK1eVc90a2ourVgLLSBf065vJXYV8fIq+xIXNM6sQzuSlnO6r+C4zPIMNTxb4mrcrP977Y0NbcGhOIdNMCozeksWO88KhpWr+6Jwvpgvd/i1gMfjSgVpW7BQUgAbV7idJS05voROqCMPn/1KrnIUW3p8dxf0afe91Ne60iQ7C0u5Wp93JSTZfU6lxtbycsWvxsmTnKwGWnuGRGXZ73q7IWH56Jx1r4IlfilnEbFItiaByGl3PhNVaM7vdsgYCuZ9hlfBvgf1d9PZkbarN9ACJ0UtfnNYFKf3XSREMig== 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=TmrF2mH0HfCfd9gvHQUZ/nIT4ZUD7/yr3F3VmSk5VhI=; b=ZKWIjEXPyoN4o+Y3hci8gh+Y7/ALHYwA/E+SHINBNleJodpplWT9dXoM3iahL7UvuTVHhQbZ01YcmlPdiouBZ2Da2pcflfEIPyguu2A5M4AbchL7YI+5Kbfoow2+vGVqcsUUw1+VT05J2L9kpY1hxNTnmplkTg2b/GqNQjTOd/9JyTzlZddG4XmK2HVxIbLjEQlRdXPjaB6cbZ9mpgZHGNbZtReek5sCjLFngE1f0OzM+q9ElgfGndAKWlx2QVdsaevwFfdjd7gIkWyrvXXa5bVnYoXXB+prGmnQh0M9kCyEUQhSw7u/v/weoJktPZkuggaiA8SrX2Is/3YyAxAA5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TmrF2mH0HfCfd9gvHQUZ/nIT4ZUD7/yr3F3VmSk5VhI=; b=E3SwyWkkVWWop8USqLhgjWsFICdQoV8KfFUGuR3ch0xulu1U9ZJKzk3okIbc71WkzgNtbJK9vVDJ0JK5uEP8G+3bF+wjd7RehZgAq3Gq7LKhjYmeyLx7Xp7nz9rBfGy19iLatwd705gCPLrCDujgmD5JzTJG8ashZJNY7aaTssw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) by BN0PR08MB7487.namprd08.prod.outlook.com (2603:10b6:408:157::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Wed, 15 Mar 2023 04:02:40 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4%6]) with mapi id 15.20.6178.029; Wed, 15 Mar 2023 04:02:40 +0000 Date: Tue, 14 Mar 2023 23:02:38 -0500 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v2 3/4] dt-bindings: input: iqs269a: Add bindings for OTP variants Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: DS7PR03CA0168.namprd03.prod.outlook.com (2603:10b6:5:3b2::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|BN0PR08MB7487:EE_ X-MS-Office365-Filtering-Correlation-Id: 87a62e7a-21be-4185-1fd7-08db250a1ef8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KVEiETMsmTt2IPruNbkXmBlqIqdkVrWIX/3qx/KT0FNDaEonR1/W/2nARNtJU1oiZPmaXl9bhWL7+87CvLOkgHwmfhsuJH+gx7vnWwJ0Bv0HmDyjCODszGeTIdxHvoH3lskcLkzZA/5M1Lbie8XnvhJ3up5NHgdAPTMAMOsnJtaQ5pekI+mOeu2Ehy6fvzgme++jO1J6yAwciYkWG8pKjFZijzXhl29dwLRDWYrMQlzXGWeMn/gIvb/z6wwm6Wpsp13i7ZQrrt6ZBr0V3MS8LRNGSfis4fQpDZ2Cuj+ltEoY6Z3NzTnBkU230H58ihfafIbanf1FHY81LWVOwwbYZOYPINLUqK6sAswooRlnAjFovnQsrATm3fP6jAJbNYdGJGQj377i3e9QK/x+JnvJxNAJGilWwjAcLhw+rR9fIaqofpZPbs7IF3HSywN7QCr61BnyMx6jRvDhb6ub3TH2K1Xa5syR8QQS1hPdLgiGr9YGuUfHWJbbBX1DqFMfA7R4VVZDq9qPzh9RPRILpa7wH+lWjckCRJN+ixX1ImXjO2uiHK4GjcwkMKJsbB55kuPilNHXdwpseoUrWztmcpiIqf7FzgTQfBGfgT+ZDpxnoFeQYp0JmRxgc9jEB4n0Xd+TX0GlTdX6KOMwfGU/io+Gt/pLaQ9nfrS6m/Rvv9WxDyIDbUZNU//67f0Wzse5rn8L X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0801MB3774.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(7916004)(39830400003)(376002)(136003)(366004)(346002)(396003)(451199018)(86362001)(8936002)(478600001)(5660300002)(2906002)(4326008)(41300700001)(66476007)(66946007)(8676002)(316002)(66556008)(33716001)(83380400001)(38100700002)(9686003)(6506007)(107886003)(6512007)(26005)(186003)(6486002)(67856001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HVeUTsSVEiyGvHoCJipq72oi6LnpIrD4yf78nlmxfV7m0BDkSNbYPT+KnvKeSUfww9z9mlkjfdX4rnikYTfO8vRTlrj1ZVwfvLLIILGy6pMdQfN0yzOZmvEd6vwbGKuFdYQS3Ujj6M2JG4+wlbMpsYIFIDg9W98dw1Llk6ngx2zBKYs4Peqi5IaFD16GnDDDsPMdHjo670NOu5UlRrL0hxzzniBKG6mP4vzmBQjqiP6M9L1NbMJcMW1Xa9xQo6yyQ4dYXXCNw3C4rEbodipz8dU2RvTSRbTxa5wgfdvLzoPOvWzpd74WUoCTruCGbfBKKAj3axHaG9gPuv0H2nd4MD0/CXo2aj8gEJ+Q96HChW9FCImvrq1LLkos4cr4N7u6uaideDCl5u5YOPlrew6s51j2FLIaFcQUt5f6pQIF8DY4jQxUyjOVrQC2LoOLmeEfxO1+oS3bsn3dAl7IQ33073O/w1qV/czHfn61+KKEiWnf9Jipcte2xpCCAbXJLv/2MT7yCWAlnM0kPELYLSRd6yZv/iaWvNVwodI5OBIjemdczXyZ2oFd8EAfiBTX+OkEdqjBNZ9ccoRa/TOYa9oWeTfG3nVz7G+mUFo59E34taRd8xebEd0YRUwGUOIv1SpmjzQCVROLdMok+YssjIcFFBJK2UvkBSzbyk8AitDeu1YCkrdz0jfTmHP2HbduIWNWzUcpZukIKPAouuQYMY677n618R42YxUGb99oGPrp4a1OeymHEbnEk/97njsjinP1sXtPcxgFaKNr1TMAeFLchT+12ror7Syx/MU89GZ4x68s5wgn3aSnkzcKfT2r9RchhCXNILTtX2CHMpGzPhehv/GP4Su9aBawH+K/e/WpLfD4VebEIBJZs52t3c2ye47pB8mIylP5yyDQD7qzBeeVg7ANpYn9zR6YPMW7W4NXBE1mUs2woiBWzrlXWsIb0I3G+8QVMs0Oisj7Uz2npVBvP2ZW+ZWeEGUpoM/cuvzbkn9BhzccPkFsWoETX2g4GBbiwv/67X96kIZRpSRL3Dcm3bE4Djtyg9Bds4ySLFoKLrrejXEzm0EzcAU2Nq/po6MeZWoj+D6jTNxG2vianBjX0wMKwA6w68RAo636uE53Sx91Mk4XgrsCZHFmFIH2SmFFAPG21XCAEppgJwmIlvCYB9+4rPARBtUYNyats5KL3BRaKsc9iz+I5IueLwPHy1zUtYOo9F8+LG/yaf0eEmCXBcRvPAvDoHU/otRyKGtJckiDfAtwHz/CL9GInwcxG9UY0SDz5lBn4OMtX74CSjQ3WaDI2ufYIIphNR58H8iwaf6AFawTZFS6ESszyW65aFTDzCawephliDKe3ScnYKtN+ZaFrLCZZ8HtJLE3kzv7LkDh8Byzao4vWmQqmETKXuJXZjzsp1CnKpEyCAKS46aUEMkYHipVkhWSSpZttpjLHN9Z5kweTPzwlUBb02NSPueOq4gy4qbgy1z4lwmUTuFk2EwUZVCHQ0aREshL4K5ZMdYbzJDhKfgEo9rbV69pBwIZrp+JOfvF+jiLc0WrNnHhq5apNjiDfukv8nd32Rg5pQLw7OFwVv7ed/rgdfznHYMg X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87a62e7a-21be-4185-1fd7-08db250a1ef8 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 04:02:40.3785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xZIs34Jr2gRm35nlr7sEV+27Mr0nyqGUMVVRossGcSTP1dpHoKISG+VT3OWv+FxHFBYvEe06zMfUP1Xflhfgkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR08MB7487 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds bindings for the D0 order code of the device. This order code represents an OTP variant that enables a touch-and-hold function in place of slider 1. Also included is the ability to specify the 00 order code (default option with no OTP customization) explicitly. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- Changes in v2: - None .../devicetree/bindings/input/iqs269a.yaml | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml index b42f07542d27..2c3f693b8982 100644 --- a/Documentation/devicetree/bindings/input/iqs269a.yaml +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml @@ -20,7 +20,10 @@ description: | properties: compatible: - const: azoteq,iqs269a + enum: + - azoteq,iqs269a + - azoteq,iqs269a-00 + - azoteq,iqs269a-d0 reg: maxItems: 1 @@ -207,6 +210,16 @@ properties: default: 1 description: Specifies the slider coordinate filter strength. + azoteq,touch-hold-ms: + multipleOf: 256 + minimum: 256 + maximum: 65280 + default: 5120 + description: + Specifies the length of time (in ms) for which the channel selected by + 'azoteq,gpio3-select' must be held in a state of touch in order for an + approximately 60-ms pulse to be asserted on the GPIO4 pin. + linux,keycodes: minItems: 1 maxItems: 8 @@ -514,6 +527,21 @@ patternProperties: additionalProperties: false +if: + properties: + compatible: + contains: + enum: + - azoteq,iqs269a-d0 +then: + patternProperties: + "^channel@[0-7]$": + properties: + azoteq,slider1-select: false +else: + properties: + azoteq,touch-hold-ms: false + required: - compatible - reg From patchwork Wed Mar 15 04:02:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 663657 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 59E6AC61DA4 for ; Wed, 15 Mar 2023 04:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjCOEC5 (ORCPT ); Wed, 15 Mar 2023 00:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjCOECz (ORCPT ); Wed, 15 Mar 2023 00:02:55 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2081.outbound.protection.outlook.com [40.107.95.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5E4034C2B; Tue, 14 Mar 2023 21:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dKRf19k4MBi7PAwSqyG+0oS8vKnTrtO5x8/Gy3mWugykdFF/e+RVxBTLa35/dJskwZMLtYPIjfz0zQzyk0xitVQ35FHG2BAlraZCq0gMLo42MaV4VePpcyBTptiVOcQ/0MQwu5wDViyRBB/ZAt4ZMAZRPkn3S8Pu2lwY3F06aUVKT51bzLiWZ7xTUkY1yzL5bfxpNCWu6p6As/3ZIiRnfS8/w9V6RTdEXqvd0NIRzzCd5d4rv38uYXq7Wrv710MERmtSHycwpY364bPfqdJTTkGLacEbU5d0KBpG3QYdEvmizHLGQKCSjahp3iB6gLoxhll91Isz0o/2ZpeOIubBxw== 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=OWa4FNhtz8fl8Z9Pm5iYyMy7OVOZTawsB/7gcvYf2D8=; b=fbYZysnILrucu50li61+tD10vqDAyCdYVjCxR5riVGX2Fz6jImDopWhdIXBEd0T4fMYnvQJeDRS9zv0ljyvVMN5rAhahafDaAh+Z3cqZDB0NSIRJdOv4tjl0yrd64OuC7zuwTa0KTmf1o+I5SAnOZF/w8kcdAKYULb6rOXoAOfagrTRXgTP7/cErxIWSE7NcZEtvgSig2TpDZl17vtQz7YPV+gZICCXIUx5lUtD9415EAAiQH0v+jo5rm46LzXKiICKeZPUDFBe57K+CdGyaemiKeq8vf907QDT+A1T+PfbqK7N9yuzTbQtqPJwBQF5Su0S9O8P7D6+iFETezS7CIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OWa4FNhtz8fl8Z9Pm5iYyMy7OVOZTawsB/7gcvYf2D8=; b=IOG8PhckkYcHVDSk3JIOLsCQObVJwy0ZoUACzVjojpWZcvhvgNV2UEzCQ0SUH6KUHkcX7AwpsJiNUtmzSPrE9H2fDUKzteDMQ4aNq0hYqH6LCbILiOsYHm6kUEN6asU1WZT3FQNHngPO+mUxdzrYIKZ2vV18/lh2YW3ZCdIXGs4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) by BN0PR08MB7487.namprd08.prod.outlook.com (2603:10b6:408:157::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Wed, 15 Mar 2023 04:02:48 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::4e0c:f94b:5d28:66e4%6]) with mapi id 15.20.6178.029; Wed, 15 Mar 2023 04:02:48 +0000 Date: Tue, 14 Mar 2023 23:02:46 -0500 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v2 4/4] Input: iqs269a - add support for OTP variants Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA0PR11CA0017.namprd11.prod.outlook.com (2603:10b6:806:d3::22) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|BN0PR08MB7487:EE_ X-MS-Office365-Filtering-Correlation-Id: e9c1a067-b012-4182-98c6-08db250a2377 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jNpr4KxIKmMfp1X9byCr0d0mTNKdnLEoA77ot7LKdss28KD9QtpjMbJhfTqwSt/NMIdRrK2WnHJEY46O8mw6w4gaHnQVe6BzTOH6rcxkJHRgvASsmtIxAs1QXOa0cTgVhqxezmZAmaXUuGjMDZTYLsOHHklmxcvd950O2hh9+R0+MJvaZvgreTYEzEeqHW69n65QdB1wu88ILerQXNKz4K/lh/Voqs8kOMNIebQ8kZpvU3jg/AzcQxQiFtclIbKUk/RFvCjPPN3dm9oc8DYIFsaKcXLt9PBjwy5HrUbkzMhKNLzV6HrXA9DZ19FAyxZrbomp5yN4gdBzJPgYs5Jhn8yq2t2YrwuT7pgAv03bpUcC4RVnfYPKhg7N1Q3INAEF4KduY6B8PczyPuclgD5eCHbZEWO/w+GHsXGu+NdY6ZYjg+IoiqtNkJx/dn2KLbTkD4lujQVNP1zYOWJN5b10nSu1PoDGsliOWWeKnpSEqlaHakM2RYeD2N3uORHN/OMjMiCVeZyeyxtdfU/8WT7haJzAY9SGb2L3s/QMnI3nDQcz4z5GnATpb1ON+D9cvZOvpzNHogNwixavsFRLuoyZwe+pGfi/GW2ZkkF0ej623uuTnUJ3M0UzfvM/XEDSsaQTNDyXQWyuwVKoQTCaZAd2cA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0801MB3774.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(7916004)(39830400003)(376002)(136003)(366004)(346002)(396003)(451199018)(86362001)(8936002)(478600001)(5660300002)(2906002)(4326008)(41300700001)(66476007)(66946007)(8676002)(316002)(66556008)(33716001)(83380400001)(38100700002)(9686003)(6506007)(107886003)(6512007)(26005)(186003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yG2+158KR9P8zBJPsu2pKV+SfIok3WnmvPKLHlViIUk5Ek7pbnITwfC3lXqsGPmufD+Lw7ZTKqtbpmOoz1HId2TTxasmn93LwegmcrRxJs7gyhdh1p1QQCrQ/Bp+SwFF1YzFNHlDhjiH0Sf0PZavgQ92N43GGXOCiMvzbLwqPjAY/xErld2iIjJhyW/HoPF/gnyhkbOiOebI507+xW+rpFkJuo/clgxX5wSKRXOpMF1QdiLYdZwfjAwoeQqUFAF8lJEewhZv3UTeQPdJ1pY+pGykIBDV59cCpxkWNqoupAEro1f9RYSdBg7eQNVZV6vp7mB6hUwC1FYTa64X1GV/8FVpTvX+ONvbJhem9eLldxdkGnM7Vvi8uAPalv3Jo1Ug4ZnvS7rJ6fmzJp7/noRFY9qK8iiuCAP9MNNn/kw7hRNnZegv/88SMePJ72kAfzOxDJmclqHAOYAsnDttMHbWpyRFz6dPwOfCtJcPSMwp5jxZmLT4YDrGkXbnP9lbeg1eiwjMR3XxZ/cg2bDwdLOflEiJyQiY0e9i71TsGzNhOSeujBP8ak2pzo+2jdeR+FoTRbEIZw9jVTiMPf9+Ne3WoFA8UDXA4esTAPO0MD0463/tOVkssdmkqeAv29NlC8YCsXsqLJvs+RWTDFCZSIez+JOUUQgP9vmX41aJU2KWpb3Qn3AHZwkL82i1kLDVVdjr2wTyich9lPW7j/iOsjdYmYnz0cxjZj0shDOqWzomD2OgY52AUwgrrnhkK5VHAs/dKhUaX+75gmCHr2GV9k0IV1G8nvToZrvBPQEF0xhc4K8UHRMo6d7EpKSQ5NSEAnvFpluw2L7wulwePGXRY/X0QkupKvC6T8tVWswKJvWGcKX//bDAxt3JOpsDErKgNNUuoI99XHTPBmegfFM7UTzILXxUggJKJG3D8gGN6LqWcdgFP4q1XOnKZX13hJ7EcKSvrSZ1jU1yxi6WP4Mx/ki7L+zaABmjJJ+TFVdBdKfJ2HvwiSEe03jpVHhJRx3KH09e1L+yjAEbQ8/4lnnamoZ0s+L6uZ9oNXCLqEMRvSXKF6WWFwSp5W7qmxfU55jkAkyvRhSYGW4O4mXDBOqa5etMH0lqY9JEi8W94p2wkkadt6fvFwUmZNXrT9R22h3t9p2VmqXfpnJtvj68eNEGFu9euXRThO8edkao1WeufdcZLHeDUXrBY/VNPaL57u8C/LWvMmGhuHXc3Q4TTNnplyxlhEAHzGLfTjR/+OKxGjA0Zg4ywqG1seFSQW+D2oJJZsgAGLNG5xtR4KESGkcWteomkQpl43YcMteqEm80DRudQcxpBU+BfTWI0ZoYntYGl/PlNVRq8Jg2j9WjABUROgh17QvLyt0GzABQSJFNTPtXUjelH/u99AB/j/W+Hq8w0bZ5v56n12ClypdeIHcX0LEahfqzvAWb74E2j+DcMRvMo1KxDjid5//R+BVpeSWgPuXCkGZirmIBM4gHRJZ7FGWHk066EZwmIFpKs1Mg86ZIvyMa/VWgP1emai3dloAR/6izRH3L7hyMAA0ehTf8SGNFJtWM43han/eQKWfhVxd88NMJpwdNnDTj+CsxOVfZbd8o X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9c1a067-b012-4182-98c6-08db250a2377 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 04:02:47.9248 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jMq/G5sySGZWmkTkAL5cxp4drMs4zs4qtUQsZx85Wd7g/ZeokxaXjQVkl+poL9R00bDD3JQxy9TFSxIUp/YAGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR08MB7487 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support for each available OTP variant of the device. The OTP configuration cannot be read over I2C, so it is derived from a compatible string instead. Early revisions of the D0 order code require their OTP-enabled func- tionality to be manually restored following a soft reset; this patch accommodates this erratum as well. Signed-off-by: Jeff LaBundy --- Changes in v2: - Rebased onto latest driver drivers/input/misc/iqs269a.c | 94 ++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index aadb24f8a638..5611d249d204 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -102,6 +102,11 @@ #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) +#define IQS269_TOUCH_HOLD_SLIDER_SEL 0x89 +#define IQS269_TOUCH_HOLD_DEFAULT 0x14 +#define IQS269_TOUCH_HOLD_MS_MIN 256 +#define IQS269_TOUCH_HOLD_MS_MAX 65280 + #define IQS269_TIMEOUT_TAP_MS_MAX 4080 #define IQS269_TIMEOUT_SWIPE_MS_MAX 4080 #define IQS269_THRESH_SWIPE_MAX 255 @@ -151,6 +156,10 @@ #define IQS269_MAX_REG 0xFF +#define IQS269_OTP_OPTION_DEFAULT 0x00 +#define IQS269_OTP_OPTION_TWS 0xD0 +#define IQS269_OTP_OPTION_HOLD BIT(7) + #define IQS269_NUM_CH 8 #define IQS269_NUM_SL 2 @@ -315,6 +324,7 @@ struct iqs269_private { struct input_dev *slider[IQS269_NUM_SL]; unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; unsigned int sl_code[IQS269_NUM_SL][IQS269_NUM_GESTURES]; + unsigned int otp_option; unsigned int ch_num; bool hall_enable; bool ati_current; @@ -325,6 +335,14 @@ static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269, { int i; + /* + * Slider 1 is unavailable if the touch-and-hold option is enabled via + * OTP. In that case, the channel selection register is repurposed for + * the touch-and-hold timer ceiling. + */ + if (slider_num && (iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) + return IQS269_SLIDER_NONE; + if (!iqs269->sys_reg.slider_select[slider_num]) return IQS269_SLIDER_NONE; @@ -565,7 +583,8 @@ static int iqs269_parse_chan(struct iqs269_private *iqs269, if (fwnode_property_present(ch_node, "azoteq,slider0-select")) iqs269->sys_reg.slider_select[0] |= BIT(reg); - if (fwnode_property_present(ch_node, "azoteq,slider1-select")) + if (fwnode_property_present(ch_node, "azoteq,slider1-select") && + !(iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) iqs269->sys_reg.slider_select[1] |= BIT(reg); ch_reg = &iqs269->sys_reg.ch_reg[reg]; @@ -990,7 +1009,43 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) sys_reg->blocking = 0; sys_reg->slider_select[0] = 0; - sys_reg->slider_select[1] = 0; + + /* + * If configured via OTP to do so, the device asserts a pulse on the + * GPIO4 pin for approximately 60 ms once a selected channel is held + * in a state of touch for a configurable length of time. + * + * In that case, the register used for slider 1 channel selection is + * repurposed for the touch-and-hold timer ceiling. + */ + if (iqs269->otp_option & IQS269_OTP_OPTION_HOLD) { + if (!device_property_read_u32(&client->dev, + "azoteq,touch-hold-ms", &val)) { + if (val < IQS269_TOUCH_HOLD_MS_MIN || + val > IQS269_TOUCH_HOLD_MS_MAX) { + dev_err(&client->dev, + "Invalid touch-and-hold ceiling: %u\n", + val); + return -EINVAL; + } + + sys_reg->slider_select[1] = val / 256; + } else if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { + /* + * The default touch-and-hold timer ceiling initially + * read from early revisions of silicon is invalid if + * the device experienced a soft reset between power- + * on and the read operation. + * + * To protect against this case, explicitly cache the + * default value so that it is restored each time the + * device is re-initialized. + */ + sys_reg->slider_select[1] = IQS269_TOUCH_HOLD_DEFAULT; + } + } else { + sys_reg->slider_select[1] = 0; + } sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS); @@ -1137,12 +1192,30 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) return 0; } +static const struct reg_sequence iqs269_tws_init[] = { + { IQS269_TOUCH_HOLD_SLIDER_SEL, IQS269_TOUCH_HOLD_DEFAULT }, + { 0xF0, 0x580F }, + { 0xF0, 0x59EF }, +}; + static int iqs269_dev_init(struct iqs269_private *iqs269) { int error; mutex_lock(&iqs269->lock); + /* + * Early revisions of silicon require the following workaround in order + * to restore any OTP-enabled functionality after a soft reset. + */ + if (iqs269->otp_option == IQS269_OTP_OPTION_TWS && + iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { + error = regmap_multi_reg_write(iqs269->regmap, iqs269_tws_init, + ARRAY_SIZE(iqs269_tws_init)); + if (error) + goto err_mutex; + } + error = regmap_update_bits(iqs269->regmap, IQS269_HALL_UI, IQS269_HALL_UI_ENABLE, iqs269->hall_enable ? ~0 : 0); @@ -1772,6 +1845,10 @@ static int iqs269_probe(struct i2c_client *client) i2c_set_clientdata(client, iqs269); iqs269->client = client; + if (client->dev.of_node) + iqs269->otp_option = (uintptr_t) + of_device_get_match_data(&client->dev); + iqs269->regmap = devm_regmap_init_i2c(client, &iqs269_regmap_config); if (IS_ERR(iqs269->regmap)) { error = PTR_ERR(iqs269->regmap); @@ -1897,7 +1974,18 @@ static int iqs269_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume); static const struct of_device_id iqs269_of_match[] = { - { .compatible = "azoteq,iqs269a" }, + { + .compatible = "azoteq,iqs269a", + .data = (void *)IQS269_OTP_OPTION_DEFAULT, + }, + { + .compatible = "azoteq,iqs269a-00", + .data = (void *)IQS269_OTP_OPTION_DEFAULT, + }, + { + .compatible = "azoteq,iqs269a-d0", + .data = (void *)IQS269_OTP_OPTION_TWS, + }, { } }; MODULE_DEVICE_TABLE(of, iqs269_of_match);