From patchwork Mon Jan 1 20:02:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13508702 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2056.outbound.protection.outlook.com [40.107.101.56]) (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 85A8BDDA3; Mon, 1 Jan 2024 20:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=labundy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=labundy.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="t2HLRW+I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G6q5XOaWDx2BahuOkHbH4w3JU6txbeWuEaMZ7xkJH1Yx7unwgiJbqh6sA17WbPwtVJeqKSBhVUPbwgmnKXBsdW9I/rNVshf3mGBAgwhGXyLQkL2Xhe0AgLEp9EleBb6LYkWcnGDWJftqFUZ6FU51vHmr1MuFXVip6j3iRwNgvzc6wTh2v10Buj/1MEERct0bvyPuYwtkzH04Vsw0BAD0nvmtIcSqN7HuayUEz449Vcgv3CFf21OIwAm3S86FnRyhYEvfZw0ZxNmL+3zsKGfcdIgw1aKpWgoKOlTtDx0fDlX2RH+hSBUOJ8FkLu+Sw8COeBwv6tXRrpH1UwIrcGbuOQ== 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=Rml6F6bSp61M75Y1kvqxFht+16k+zS36AV938sxmSC4=; b=ke4VaLCYYn2RiS6YrSNM6dK2epemiK+/lSkMAKEuZaPnOlcxq6YT3Ix4LN6Zog3+yHnt4kGaFIuyVA6Ijfauan9cabPouUxA3GVjCwNsA7fA5cAnpm8K+eVm9qU9WNeLeSgpTcEqpMe1Wrju1FwwunCcLmRh7nRHEid9m5TQBepTeMFZGnpXwSjPo2Py3gMw51GDo3KVJYpNTrKrNTPdTK3ZxmSsgZ/DUmlzY3kr2eiBghL+VFJpTc5WcwxGHuMKE0iUtKKqsOD9RLMf3phS20v5lhzhfDA6ZjIOUE73PP65atjUvlkroUBOsN8sDys5gm07hTuM2cyJQbs594OE9Q== 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=Rml6F6bSp61M75Y1kvqxFht+16k+zS36AV938sxmSC4=; b=t2HLRW+IKCY0+amPzTVaTJKYisXRqyanXCCUrkjTv8WV3RFRgj545f1AFZmXfWBetq6i3Wjav7ADs/7rLNhsdC0CcjcYPNuMSemq1ZWaHaIxYbKk6Hb3nPk6NOOjQm524EIRrQw/1tnXsVakkkpEnbKGAKsRatQaWNBkakpCkbA= 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 BY5PR08MB6423.namprd08.prod.outlook.com (2603:10b6:a03:1e3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.12; Mon, 1 Jan 2024 20:02:08 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da%4]) with mapi id 15.20.7159.010; Mon, 1 Jan 2024 20:02:08 +0000 Date: Mon, 1 Jan 2024 14:02:06 -0600 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v3 1/4] dt-bindings: input: iqs269a: Add bindings for slider gestures Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SN6PR04CA0103.namprd04.prod.outlook.com (2603:10b6:805:f2::44) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) 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: SN4PR0801MB3774:EE_|BY5PR08MB6423:EE_ X-MS-Office365-Filtering-Correlation-Id: 65b6ba11-4cd0-4ff3-1154-08dc0b0488e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9BZ1W5T1EOUrT8reQe1uhqV7tPiMZWX5cdkXt/qVhfy/R6EyHB3yQbg4PeSghLpCkRTA4tXUjrq61BlWgy1FPnwXZ3nuskDPfEwMUh7TwWOHUHb5hdxPyk9CVckAChbkWNra7O+EfBefSjM5Ww11N/L2Vjr8FTy9M+9aHTMenWzJBIdAGJ0JQOnoRfhqguXlnBdLnrcbmfAZvHHz0WVvj6VxgFJarkdVLktdOVnzW5Pd9TTdC5c6mjdd/qZ1oUw05dj6unekk+ZRw6hSG5+OwwQ+LqNdXHFMbl8dJWHKRX8I1MgrkkycX4iOu9hyHXFh6nrt8Vfc7jtqoQpkSMXIw1lUXRMpxQcw3AfiD+7bI8cJPVtn0oLXRpOJ9BHTI4D66MIv2hh3IdeYAjnyTT2MrY/MlTQjwtavDiDGIPEahOKaGK6a2nmXuO3OmMGT0W3ura0lmXMURXRlbPHKe41vHNSoPOZEV47wXEkYhiBj+diR8quiLDvTgh30NC3i8PfzE/QfvVu9LWZkQxIMmLO7dES65bzo6OidnIKKOPfPB1eJSKaVgAmJC45vJP1hE3/w 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:(13230031)(7916004)(396003)(39830400003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(2906002)(5660300002)(41300700001)(33716001)(83380400001)(107886003)(26005)(478600001)(6486002)(6506007)(6512007)(9686003)(38100700002)(86362001)(66946007)(66476007)(66556008)(316002)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Fl/lAX1BJwnw340RBrR+ECvDRbhPnGjeymtSyv1mh8yJxU+/yKiw2UxCdPflVZXpbwEj0/XAN0FLZMX+/Yc9p51fLi46aRF/r22zcm3NYJrO1rdTOx8kOBVf2sndcfaVfRdRrTEwcUPWSv1wkMn/axeq5GF8FOdzOvHk2DHZjl5TfsN4uN0sObFR9V4rF+j40oSKiEbKHneIu+i6yFZG982hQI2BHESdvKYy03czY/dwlB/IWgvpjhUymHfukEneIhj0+2g0Ukgs0gVYj727K9KHIoJveeD1TMsWA3egLDc/ou6uIgaL0Zp5RuM2z4YrKuJIe8VsA2aS29cJKfVjgeG0CrsrbznDyFBUFCy5QazHNx3t566jiQmWYtLRt1MEygC4XrFFnrsRf7JH0D1/I/knOKcQz4QUVjJpvA4+wOOXr4iEVArUvWRRhqwCETUaaAIbla5pt2W4+JpLBi32IVQuei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J7GYX5G5uZeBmo03JnI1ePYduGcQSjGsz0vkFDRlG5CcvvmquadOVR X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65b6ba11-4cd0-4ff3-1154-08dc0b0488e3 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2024 20:02:08.5398 (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: 5qoW0z+aUiWri/UL6j20ikt1UDgojx7MZIpJkLK/6XjOk4WpSYP/+G5ivIpavbvVcRECgVowC0znz0REWBmPWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR08MB6423 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 v3: - None 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 Mon Jan 1 20:02:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13508703 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2059.outbound.protection.outlook.com [40.107.101.59]) (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 503F2DDC5; Mon, 1 Jan 2024 20:02:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=labundy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=labundy.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="maYgu2c7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L2bA1sTYRixOYFFFaTAWH2k+WYGAtpASRq72/0apWT5Eapkht+nRtfci1LGsWr3ilxXMvfPkiuWg/vXOiOLZyXhzXBRsWmr7qzTBkOWvcsES3Ng7AxE4qLWwJeDmxoxVccooKXKFEMvooRmfAxzg+vigJDcJEg0YBhkDSWmz4g0K+oBPEUEwo4oOZ0VfANct/5nXGh1dyFyofiDFKhYg63662cIEa8xS6pINGkyIMOLLD3WQ7vCARFIh2rCSUUdCBtVzbdaRJzjMclpACZqd06knLse1KE11aclde3OhW3RK3etFu1KJvOrxNMJogVtC1rM/MjY+Z2SsxDx9bFRURQ== 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=D42fcXg2ouTebvmsktgjE3fK0RK0Ht5CfeiinsnkWeQ=; b=a3EaK+nyfVD0uK3p1V+J5LwxMHH0GrYHzzecakj/GILKuPGCpHsJRGewN6Zc6+0787vxDz/nYVDly1+la0/HeoBeCvhiPpErumT5KiZzS3SsEkCTxjZY8AFBKaZq2zn4a4BNQrPWeTKeyWXqXx6DseJSzBb0Qii0yEFt70MTnNA2czvtxm7mfQ9hNV+uh1ZmWr9EI61bvICUkW98h0hFylzNTSA69Z2NoONg+cO642bsvLSppfT3Ua5ipfvMnQKbvKatfs1hPwSiBQbZ571nEqYZGrUEzSHgDGoYpMkH9JrnrJ/z1IB2Wxt4Sz/QNA1/gg8NswIVUK6BTZrIT5oskw== 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=D42fcXg2ouTebvmsktgjE3fK0RK0Ht5CfeiinsnkWeQ=; b=maYgu2c72rkslrGhnRhCFGkvB5yGZ5aAMSmD10FSyX9s+zNl4TvWfau/0Y7fi5oL3cUQ9XWvn/ozbUAcOCDPfIZD/vJtSNwQ1ZmhMnCSVGVdK38NyOp34eMeOrzTaR6Q6ui5Xn8ye9purZfatjqTuR9NzZ64rO0u4E1xgcvX4qI= 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 BY5PR08MB6423.namprd08.prod.outlook.com (2603:10b6:a03:1e3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.12; Mon, 1 Jan 2024 20:02:26 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da%4]) with mapi id 15.20.7159.010; Mon, 1 Jan 2024 20:02:26 +0000 Date: Mon, 1 Jan 2024 14:02:23 -0600 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v3 2/4] Input: iqs269a - add support for slider gestures Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA9PR13CA0061.namprd13.prod.outlook.com (2603:10b6:806:23::6) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) 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: SN4PR0801MB3774:EE_|BY5PR08MB6423:EE_ X-MS-Office365-Filtering-Correlation-Id: ff5a9800-e739-4af0-5036-08dc0b049370 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WQeerdIPauRBiQ2hIqmy9WVMRhyDMsTD1ofN7D3lWd3sEBUgrzNiNPohzQCFAU0J5OSO894x0Wt/kgNEU6JD1RqJEu+L2IVaXzh61vEJNtDQfF1c65aKj2k1Yx6esj3UuapEsaMy1h/+5iYD/F6LRsUJBKo/9OByykDxETzkUBczbm1tV+egw8w5UTKfpFuf6H0KehQg1LH133LJY2/zmrNWQ2piMoHezRD14fj/4iQ1fh9C39Ixo7EWDludk6yQJVIJtzWDruaPf24y2mVN5iKa1G3NA7R/cPIQYZqyPFt/Vdk7TVnTGFG6Vb/KVXjluT8MszGecIsIfdctO5vTA7JBRbw1v44qF3H40a4h5aV3U32NGyqev5Yd13d1PNlIOZrmXog/Chdyvf5UGhSlgFr4wYwNX6GDBUA1J+ERxO+hcv2HhwdDPFe3slvNhT/CYtk39EC59gvoP0RaPSGoG5pVmhyVYn/Tdlo9YaDpo2c6m8hNBqkEM3ViCzP++1eHgpeclmyOK3ylH9W+DUnuEkjtLRFB4LY6j9IsMCuX+rAeDmezZG9EQ9srWy6WN1kB 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:(13230031)(7916004)(396003)(39830400003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(2906002)(30864003)(5660300002)(41300700001)(33716001)(83380400001)(107886003)(26005)(478600001)(6666004)(6486002)(6506007)(6512007)(9686003)(38100700002)(86362001)(66946007)(66476007)(66556008)(316002)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VJGh3/NPA9SOoXiAnJKNrzmu0szQaG0MIz4ad4heMLsaxEhdXwHsBDm8M+C5+T3Xj12l7d42w/iQt9XIkoDUKMxnWyQmoRSfC2LxXEtvaqN4sFz/e4UDnJEo+eiunlbWz1rnYSc8VcZsZ8KG76o65s93cVZiVuQy6eUJN0xvImjfMHJfzrkf1AvEPMfjeTwBdX3WlCwh1hqJWT3Up9A8vISWXS9OnHZCg8SCFHweD2B/SJ+4tLzkl1MXoReczzWhZKuHWryYv14Wm3m8fG5lAsr26dU4z9a6cCj0GgUwPiN5jGJfPe87UNCO3XyWFVLTDfjdbvlnZOEWHFx12pEd2EYkxMqRI5fOTqilOVe6KsCQ0jzImUBMCZcTwXj3Upjq3t1/ktv/vYkap8Tjr0qVq0b7Y0JwJYjFnxm2oaUbFKO181zj/CB0/W043fNLgwf9qOfU/SqGoIEwdp4WrF8WcO50fBI685IuJbJ9t+NpqoLKr7hVrYlE6xImoZLG6yrV3K0VdqAdL6bFxx7TPczckwHV004K81i8oS/mq/JrPGeR9OqoCpvWupiovCS9z2jhXP6hk2tKoYWBGhCR8k0AF+3doU5qts+tfN3LjEihrSGgDSH3pyMj3fhemblEfMPM/yr1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B3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2024 20:02:26.2460 (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: V3yKGK7NcnUG5DtU5SqSSpwoCUBAn5Zb5Jtb0nYeMOU13wRRVmNope2+ALTuuBRFj6wzCWsCXDk6ftzR6L5PpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR08MB6423 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 v3: - None 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 1abce35b955e..0d0b5cdc7830 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]); @@ -1595,7 +1758,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; @@ -1617,14 +1779,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 Mon Jan 1 20:02:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13508704 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2079.outbound.protection.outlook.com [40.107.101.79]) (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 4DB68DDC5; Mon, 1 Jan 2024 20:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=labundy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=labundy.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="tW6LdFbh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Blz5YYNwcXFNP4w9J5mJFmrvJN0tJV0v79/1W8oElengRzpOuQwbOkly/n27jTUo/MhC5iwbrJXIFXZv8FUfzm0oL7Rm7gYhxIw5zDasFTt3xsINEgstqHkvyoSyUIK7gUXGCHQd8qZW6MuRNMrvfJmKMOH2VO86cpTmXo5ePvcDSRp8C5XtUPsDwPc4WZndqXLsmh4KEOK2OlGMGVz1JT1GHX/KJMyZiTbWZ75RbMsP2xkxMNFuLFxrWglEdekitpqJ6wq3pgZw0f/52u1hvDa4qRwsBWb1zseHy34+heZv0lo/bMJwqLV0qY00uSvOYb/+zaMCPp/3k79rOkZqgQ== 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=h5dsOlwRZCEVOolfoPTSFAsien1bsaD7/eaQPhvfo48=; b=ogoJWw7R6B6KdBuyZ6nSIyN7mHTuoS2gmZ90+XOv2Vv6TA3DquZYUz1Pl8dUhsRzr6Dq+Y7dUqpmihhduIvXYhZza1YADtAYzP1kGGFnVHaUo9XB8iH7Rhq35v10ZUhsf0uA6D9z6GkA8QcitdT2ce70usKJHWjkOyd1EOAuKj3fYC7q2wfVRGwqpRCFmCQbdhq5G1BCE+zhey6QNPfmqx/DnprcCy6nb03wzsbejvclZ+/Pm7Sw4bNVVAkd3EQq4eYXP3tXyy+0SL3iQpEhiko0W/3si7kXUNDkHA1lLPnlRFRvGrK3nFNC1myxNsydQnTN5j405QsS0vxsefD7Iw== 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=h5dsOlwRZCEVOolfoPTSFAsien1bsaD7/eaQPhvfo48=; b=tW6LdFbhY9Q0o35NS6AuilxgTMc9AVUfzngcxgmDYbcHUo3/U/wSkIOJVPQmF8V33mvXAsnYEuhlkoeoNqZzaC9QGxV8NE34uXrbd32q2l/L5y4huQvVSA+JrI6Y3GwMq/DGChootreOFV2xSbHGJlaSquzrQ7m6wk+SFrcD3v4= 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 BY5PR08MB6423.namprd08.prod.outlook.com (2603:10b6:a03:1e3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.12; Mon, 1 Jan 2024 20:02:37 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da%4]) with mapi id 15.20.7159.010; Mon, 1 Jan 2024 20:02:37 +0000 Date: Mon, 1 Jan 2024 14:02:35 -0600 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v3 3/4] dt-bindings: input: iqs269a: Add bindings for OTP variants Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA9PR13CA0055.namprd13.prod.outlook.com (2603:10b6:806:22::30) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) 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: SN4PR0801MB3774:EE_|BY5PR08MB6423:EE_ X-MS-Office365-Filtering-Correlation-Id: e5a16476-42b1-4dde-2113-08dc0b049a3f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZapC0ZSw+OF0Wmar1YJHvZX3c415iVtAYsDGLoAD+F39c5jyF6EPCdR2lBMvuCqbLevS7IETEPIhMzkpvPjnXCq9Lqv4F7wLssx3Yr/0esQvh8eFgtnhfM/Yr8tKIYyLgR7cv4r4OM5ZI16He2F+FeqX50IeG5enGwhqwabbtr+pC+LHgTleF1h8TGf8gSy6+CiOyHZc6W2SqxN3kHnBer2fE3rszLBDJhb8DHROxQoE8OoFMayaoiTqNYzDa2rN9o0OVuLt6wiPxi4NxPdXEjw2P+W2I04bislMS9bH7Vob4qs6JzP8GLypsth9ZQBunkt5QqN8levdPwUaPIt9Apk8qt4aw5hE4e9NTwKCcSLxd2hzBfU6RcnKniVJZUofw8LYuYLWNEEScVJlRNqeqQ/02LA2r81gNdQo6rBK2QXjt2iFXWSUJt5s8Vi1cpLKvlQFmHc8b2amyCUh/9gCm+Mzyn9R713or7NSmD85bGq2zYImQzO1LgaSsZXd8dmGnIL4/G3lwYDkpRytUUI/dmxjKJO4e0T2VyE/g82UqiOBApt8ipx30mtVi7rTss3+ 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:(13230031)(7916004)(396003)(39830400003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(2906002)(5660300002)(41300700001)(33716001)(83380400001)(107886003)(26005)(478600001)(6486002)(6506007)(6512007)(9686003)(38100700002)(86362001)(66946007)(66476007)(66556008)(316002)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: as7USoY5iJVsYUnsI3YLMC1pyOyjOqINhmw5OzPrUxe1xjp6jY92P1BSKI25+MqCTpKDgcyATjcMgoDbfri6oBeL1daF0WSlI5DvaPqR3AoHRtoXhPPw0FGiY1OD1I1Hr14pxdECWVZFaghBKEidT92gF17XfPJrurR9OfGPWSVlyCg8ITheFUP/D3pIOEP+GLsC2OTrP4X+JIaxuaXTLwxp4uvCQRAtuO/wHVEybVTCMV+VM+gxjOhRsfvKXsDS5MLy8H9xU3UwYYi6Yi8Z3wU2FojXSdDdWU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Q5l6seoIJ9A+rd+9HfJ9k+deEruOoL6DtdDltimRY5s1xio+cRxfPHWEU/ulHGc/BZr2JK59S3hQweVyUCZOJpjFiqbI2mtdJM88uG9dCu9/L6RCvHaknOLm0ClI/In1QeVAxYXPUXo72PCToIgerTp/2uVubLaPiLgol8u8KaeoNkCLIhqxwXKQ1I7Ka+lb5dVEzqtANuO6cppOmt3ka5VTJLmF/uiSdaKUl1SwD X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5a16476-42b1-4dde-2113-08dc0b049a3f X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2024 20:02:37.6952 (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: Sqt419mMa3/QppzbDZd6qEu3bN0pUG2mywFlhQ22RemYBHAExjQXw095uOmOZgVKCejL4PONJvTae8yfFq5S5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR08MB6423 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 v3: - None 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 Mon Jan 1 20:02:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13508705 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2060.outbound.protection.outlook.com [40.107.101.60]) (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 422F5DDA3; Mon, 1 Jan 2024 20:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=labundy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=labundy.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="NLCQ5KQ/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P/vPDeY7O7RSnWq9XfvbutsnINUw8oGjI5/mcKE7yWf+cXYNLJSQh72QrKK41CxPAp7Mdow4A9linT7TuK1A28rLlxVPiKkzzZGPPVlVH8UZXEo25T5/wTEDEwUVpVYCDEQB1wCTOvUz0pTQnZv746cIzQGubLxA/dPCOP/n90FjOIeP+tILY+BOrI+Zbn89akcD8fk537DZ9K4GuhzLjqWdg70W4q63nBZzAMNOg9coCHQu2RI8c4jWxw8V9ar0eBKNPL6a8BLGQkyh5GNchEaES6wd+Df4X5ZgqXATZ780gRJamzBeJJSqogDSYcJCRPJxRJvSfekR3EXz7v/XcQ== 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=sN3RBBn0JvZA2N14Njx8Tte4g490sseYPn3vsHXft5Q=; b=Rs3Kb5RRSYCuZfiBv3Wea95FJuJ1gltbu3wjNUfjUvN/RWpaak3vi6DDA7WURq1/rHeJGqbc4ONxVFiNSF1nznzKn2U05mXyTQsPe4hKFRA6JTYt8SqrzW43HLvYAEFazVpGzmIm+HLGnx5IrBZa3KOTXqWmosd17r7Gzkf1eVLgpGLaBqEx6noH/g9pMjsPdxqMNR13IMkXWzy9jZRFKi/ier8m2ixjpzOIgTldGNlS9aMrQlEZ5MoDsSq5T+vja+3LnaGVHcTtu5TDIM297conewvQejLn0HDpMi+LSbc2fY0JC7lWt3dd5AgHxLnhtjTzC8QM31pRhrzTN3HVLw== 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=sN3RBBn0JvZA2N14Njx8Tte4g490sseYPn3vsHXft5Q=; b=NLCQ5KQ/JL5op9+0w9oVQi6KZZqjWaPmJxqrfFYGK/XmgKG2E3RCHaXGwmK0kf+Pm2bfnXk5ibbvPg03qxrYu6ZadP7nCrlzcA7hgNOTCwecifl+WdrepLnwCm+hkViT4sZAnZWG3GbMpSWqr6Nh7BnNE1oxrf2p7whxzSXg/aw= 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 BY5PR08MB6423.namprd08.prod.outlook.com (2603:10b6:a03:1e3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.12; Mon, 1 Jan 2024 20:02:47 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36f2:78d1:ad7d:66da%4]) with mapi id 15.20.7159.010; Mon, 1 Jan 2024 20:02:47 +0000 Date: Mon, 1 Jan 2024 14:02:45 -0600 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v3 4/4] Input: iqs269a - add support for OTP variants Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: DM6PR11CA0037.namprd11.prod.outlook.com (2603:10b6:5:14c::14) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) 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: SN4PR0801MB3774:EE_|BY5PR08MB6423:EE_ X-MS-Office365-Filtering-Correlation-Id: a35c7bf8-943b-4393-c169-08dc0b04a039 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +RVjqqkOtPjM4NJA4DkR2L0ioPi21nQpUMifOCiYAX5fM95Oi0E8SJA922U20/NwlEsU27c5nng2mU5wqQh1WAg+asYAkf6bxixhFXz8c8D3J4OyZ5d9qdd8k2S6KrxttSHM3QwfgOADpHoyXpajtdVva9ucY1cP/heu7hwVdeZNonilYN/kCbURTJgxuq4fGH7GMprfXxftb5pU76lzW0Cqr1Yu+kUe0GLR/1E2qyHtvaPfGIEWkj7l8nTFz6XvauMXdfbwXeU+7z26XEqgS3GDPcAzH7FxFMCcaBvq3gB2ngDc3AD+x6Micw734G4RW02aWb0acL85USZq/3AR1vLRozvrk1g/qcySilFVNVi8XJocM0r1x6U33RML2H077caODRXhXkJTX8uY+K5mDOuhcy/4I/4TgbuEkp8u5RIfqggGIAL8uGBLRpwd666WicOs7Rg0OOpdbdBw6ql1EWKh+CLfYLiF6hlxNt+IvTGpjuFlqRlDhgtXiLHglVwGZ7FpVrmbmn7MLRV+++Rw1g3PestLSEhT+UeUMWf9KN2PzFaIK/kF8QYeGU/EMKGF 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:(13230031)(7916004)(396003)(39830400003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(2906002)(5660300002)(41300700001)(33716001)(83380400001)(107886003)(26005)(478600001)(6486002)(6506007)(6512007)(9686003)(38100700002)(86362001)(66946007)(66476007)(66556008)(316002)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w6A9Lm2I3K8wkOmCcR0kvy4KDpGY40AmCnnxaBB/OEnTAL+AnjEhpu8vzygT0Z6zUFjl4hRVoa+CEpdD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Obz/1aIY46Q8WS/Ro+sh2IZsgWQ7E6nKaSQBL/odmR/KQpK3RgderQX70JAleL+jQIbdZvUO05OCrIZKUN2+LJP6UvZSP4JA2HiTiU3l+dx7QMbf4ZQoEWtT4t6q+J+Iusy5ihONC6x+cZZnnEqVzH+26hB0YZ08Wgk1+ltxMGELYlY6sD5DZOIYTsJ6tIJC/TOJQHTUFobzzG312qpIS/7gt7/XVTESTtYXHqNtKSA/HMAyCsgnWZwWPXkOhcUPd5Tfg13LTxkUj9Umnu1UGRd310l41M3EezMPQfxy/iKKqunql2v1wCRt48X4hMWUl8ktP9nV2wU/3hVZAZVtX/JQj0MJdWRUlglB3k+w5Y/axzAHvRI/91hpq9QhPA7EkZwRfK95BFkSR880UtA86s46NFidlj/YFIKHsrEDxBMVqoqcuJESap7i1 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: a35c7bf8-943b-4393-c169-08dc0b04a039 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2024 20:02:47.6882 (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: drALcH04dT5k1PVS/gA+2FH3k5+GZWTBh/cwTLK+ELJgNKCrGU9EovpGQuZIssPQpno98lzVI7fAIOwKhW7vSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR08MB6423 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 v3: - Replaced of_device_get_match_data() with device_get_match_data() Changes in v2: - Rebased onto latest driver drivers/input/misc/iqs269a.c | 92 ++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index 0d0b5cdc7830..cd14ff9f57cf 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); @@ -1779,6 +1852,8 @@ static int iqs269_probe(struct i2c_client *client) mutex_init(&iqs269->lock); init_completion(&iqs269->ati_done); + iqs269->otp_option = (uintptr_t)device_get_match_data(&client->dev); + error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &iqs269->ver_info, sizeof(iqs269->ver_info)); if (error) @@ -1889,7 +1964,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);