From patchwork Sun Jul 9 17:06:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13305914 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 90EAAEB64DC for ; Sun, 9 Jul 2023 17:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjGIRGq (ORCPT ); Sun, 9 Jul 2023 13:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjGIRGp (ORCPT ); Sun, 9 Jul 2023 13:06:45 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E428A4; Sun, 9 Jul 2023 10:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ig5U73BE9FF9hh3WG378ZsKiYeecWvem4/xtgpou+Ajg8zt04NQUCIj39C8Qsz/zVAQsVXjaMvCoEWAiVM8Mgn5ABnEU8u/PmMJl34XCiE2tgdDZbVnT33HH9WzAutunHby2tavCInx27bjc2/Ve7sQT5QpU8MAtV1qpmS0pyIZrVsQMICwJH4ylsBfiZLL20IfzR9ikN84GmOMrCQFV3duzD/Z23xm3ZvoPmetM62TxIlIYWhLZdtsV+UoTN28HFTG18mCY32d18Lvl5sLxoZXcHp27U2QBQCR4bptdjZm4p+eDasItTol3b5cE0GCg17CubUBVQ21Q7cCQ1nF2+Q== 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=K3zQcwDrCTThyLlfJ12rElR4LlqTxCUd9ibe/BKneTw=; b=SjST4oItpZBPRTiYoiWldyhsrnad+QZQh8aA2upqHZI4bjZ+zAsoRJurEIhuEywFEcSFQHbPFGme8VyGqorXZ0MZ3nOcS2JtJDNbq6H/hWQqPiSuZFFqiik+n41Vny5tlg2hLirxakuOQ8/GB2cVp2wOnZfhxn05hbdcg9lg8bTem3l3hXxre9yF/dylkupow2caWvUtsDCXrRJA5sic7au9dEpUfuJI24b6RArl3pN5Yuid9eTuqj9cPGjaGb5XQ3flgMfJdZy6Y8LR0ZTYNrhP4wMbO31LLJ69fmZvpZJyXJMpqynnm3IA6o20F6Fffo0qliDFlC3RVgDJRyJ2qA== 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=K3zQcwDrCTThyLlfJ12rElR4LlqTxCUd9ibe/BKneTw=; b=rB4pp3iBSntSe+AyL9bKFaoWgjnD02oOX9iv4QJ9HLNGyL5ltAYjY7AIrgZP1dbNzGypglbuayuxbl5aT2XwlUBFJw8ytjBE4MVZD94JfzM/BJlHUqvdHE5MUDeCSVUKypQYghnEe2LW/xF6Mw5uL895vrYKfRPWOowKeJt0tTw= 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 PH0PR08MB7020.namprd08.prod.outlook.com (2603:10b6:510:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Sun, 9 Jul 2023 17:06:39 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae%5]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023 17:06:39 +0000 Date: Sun, 9 Jul 2023 12:06:37 -0500 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 v2 1/4] Input: iqs7222 - configure power mode before triggering ATI Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA0PR12CA0025.namprd12.prod.outlook.com (2603:10b6:806:6f::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_|PH0PR08MB7020:EE_ X-MS-Office365-Filtering-Correlation-Id: 960df375-f4e4-4e41-d991-08db809edc64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZUfH+5ZmPZUf9uI3egbY8sN4O4bWumvdep/ZEXDnUZ3snmqhEATm7sm78sBgtdmmpqObQMkUdBdUVvzu9IebfIevl4RL4hatOlJ1OwQT2ZHNFd2NcFjbBPsgvY6jrxegm/khVRgrdHVBAOmKjop1kAh9ON8/ZqcYsN2P6puYhxaWyPUvu8j3GX2aHFVfAfwDZceG6RMLUmmZ8QmBJYEIu0F93oNNzC527YWmmY+bKkHRpX+SO/S/Czh3LsGFB8+Z2VSma6IegHwYzYx3sKcY9u9AOYE86M8M5Lrotu5aD5ixs9wV6Bns4KV/QugxJghQeD7cHDYM2GMR4OIhfD/etLHXGyJ352VNgIGPxJscSivui4DCD9p/1ofYW9a03Seo8zuS0AnBS+Ige/1RUuRl0RFBpqUyc7upGvzLp/hvwTO7fS1k2iChFwM2Ux0rX+lcg+vly5Z/B93Z855GxjReD2xU/mopqbC3tasizrfTQC77x7GD3vE4Bh4qqtCeQXJurArby5BU4CEYQOvUIBP9sEdpBIM9rTPMF/12k0/GT+Qll3dyTmXk9FFSd6uStN+n 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:(13230028)(7916004)(136003)(346002)(396003)(39830400003)(376002)(366004)(451199021)(86362001)(38100700002)(6486002)(33716001)(107886003)(26005)(6506007)(9686003)(186003)(6512007)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vtEma8Syjs9TivK5PYJE+f6zkUWnENJOY57m3LvUZGiOrTCtAZGJ6lgZfFeVGzsvWhhB9qAceZvnFHc/6M70pJ6g6J2tX2MzQhd0vII2x0jaHbkBliiG27hRPZ5tq0Dbp6how+0EN1cYB5DI9z7gVmOQMcmnNXWXAqVsRN5ph6w+iSodAVKJIqPtiaFj5IzJnxch0esk/U+nn8lJVc79q5QstaeLMMiVHPf2OWdiLmfprnKnSUy1NwxyfXpVuPMx4A2p5x8tX5m82jL5xSwKquzp98jY65Zh0Z3L+25nxvVaTMSXR2KRvppaWd3ok6YPXwHr1pn4iBYWQ88v7JcysAt7c3Aerv7vw/k1biy4uGY4+ktns4VfahagSorW+EjvQqsWYyrDLz7mxO460yVE7Ao5vy7UA4DJJRQiny0KYMkCqLR8++6uBECjqrmsGrQxudc2Nlg8a1xkDOw+AU9cAyxtOnUcpa5/wTad+thET9vCYclKySQAS+aCWcRXW4ELJnU74w7r9SdzqpRJL3qmALqneqgNUA/RJ/nuAcIgtJImdUBA97yqbmF3Ol2WSec4SyAtKyVY3hNZLE5K6VN2Fevyo2wvTHhGFeyufn4XdJFGT3YP3hNSRrhMfIOOgQ6mfc7bHwRNGeU6ZlPtHZ8U7f6qJ+u6BRKXcApTcIFOHazSfA4Mch6RPsTCLTiBGGNFxivshETJQrl9ztdcR0hiFYHZFSudjPVaaRxWh7E2q8z1f6VOFaYBGXlBBzQsgS+D7OmjTY71k4PhxZ1/urz1elQF6IsanV5T1k+bR1ppz7a5gDdfcQNo51WpsK4yVvdAHVvhMjCcbFw/NtwXGXryWCC3UifmLwWq83GTtqDHofTvMQ8efeB1SlzW08BJ4WnO9h+Op90k6KD6t/Nb+tq3ONlsO8iMAvIgEKK/hHGvTToql9PFDpCUQfChLWToqNn83AcmnA/tlB7o2OaAQseRMROTQT5yvvq2Kh14RaffXztZBXCN+OKcL6zNBFrmtpj/I131azDgjLHM50ZuSvxE4uafAYrowsz24V58LD0b7Vla/B4bL36QIAtIubQowot5uu/AOKjXptC1OnxZECNYQ009RErTVMPnUWlkUFZzFXjukeH9NmJuM9NGefnb1ptiSab0TXvgj1zn7jCJYE/PYJ9JkEDLshZqK9sH1WWMLEjkIpRHecnkcJgQQ8MFVZ3hNUt2qG4S01OdKr5jLhL3bm4w1vhhfopqMBEu7Y7lIQl+6GweE6E0/WO28QZED9Co1H8DEL5j/lDrDWSWdZWnqPOFnJNgWLcJRWSjJhMIa9nMG4pUQVHZyVUa8pf8fSlwW25dPQ2L0gSO6xs/5Fci4lGqp9s6WAjrAHx1xVTHOjyEyE8rMdVnCyhz31RRYcXK4yZ4DC7IYV5rmZTHqlZ1iDGu7zDzjYxEqciK6gbaZspbmWHe6T/Iun/iqPWxKR/pcYoaO5zZLov0NAH2nZpexa5lRuF1ftZtzyZ0/K1Gg/C9+ZZ2Ty+kUrP9prC8wloMexZnBM7oehdl7udoViTMXc6H1Vru5+GYVQWay3NL/RZN3f78GuKnmS0acsUqrM+g X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 960df375-f4e4-4e41-d991-08db809edc64 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2023 17:06:39.5272 (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: q+93ahavhbcpw9fsIdvnBLlFB6Qo7lmcYDqRq6Bk2akWlYypGd0sRgu3trdazX+X36Y/qwr5vyMNmEXPIbZ1xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR08MB7020 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org If the device drops into ultra-low-power mode before being placed into normal-power mode as part of ATI being triggered, the device does not assert any interrupts until the ATI routine is restarted two seconds later. Solve this problem by adopting the vendor's recommendation, which calls for the device to be placed into normal-power mode prior to being configured and ATI being triggered. The original implementation followed this sequence, but the order was inadvertently changed as part of the resolution of a separate erratum. Fixes: 1e4189d8af27 ("Input: iqs7222 - protect volatile registers") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 096b0925f41b..acb95048e823 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1381,9 +1381,6 @@ static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222) if (error) return error; - sys_setup &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; - sys_setup &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; - for (i = 0; i < IQS7222_NUM_RETRIES; i++) { /* * Trigger ATI from streaming and normal-power modes so that @@ -1561,8 +1558,11 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir) return error; } - if (dir == READ) + if (dir == READ) { + iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; + iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; return 0; + } return iqs7222_ati_trigger(iqs7222); } From patchwork Sun Jul 9 17:06:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13305915 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 37C6EC0015E for ; Sun, 9 Jul 2023 17:07:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbjGIRHE (ORCPT ); Sun, 9 Jul 2023 13:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjGIRHD (ORCPT ); Sun, 9 Jul 2023 13:07:03 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2085.outbound.protection.outlook.com [40.107.94.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1B4E7; Sun, 9 Jul 2023 10:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lERVV25DgcnEEM27oEiwz2sfubT+dt6/fmxbuc96aUU7khgUnoEY0FsujSvEc+DwsMEh8GtU+nO9R5nskzubpaUCG3zIeNl2+rXSOC9IGFUF6FXos/z99OH9bBTjEl4ShgSNi1tgiHSTsmHt1hFhZdLzdn2LN28gDQPjo+fpRY+jegV3KGKoHXvSQJzAvCsdJOVJzRM4r0jXKPQubojNx3QsnTF8XQIMeGdwTRpwVmZz+zoxTMhAWwQXE127GpnxldJrJARSFm+FtacBArhQiIWwBP54QK5eA9GUnvMxNVVR8/pjyqen8piTbX94uNFasIQ7yhSjfTTcmPAQ5n8l3g== 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=ZFkE5uoZqkr4LkeK9kUEeXy59JxDo+7JNTh+hdPVJF4=; b=VDCtDnfJj5d9fdkNqVJjQ/CoZrOz+liwY+vFlZVi4OgyvF6Od5zqmykNQwzH0S7BjhG7iANBKkqefUs7OFICfJJPRnnaYQoLL6YEFi8965S1uc4YMYsRHjJVaw2MR4k3Pj+RpnilRX7F5RcWYQJr052mXtxuIlHNmcSIkS8MriFg4T63psrslmNmbZAB4zCTzw+VVnp3ZkY0L7bLXGOzcuGu5vcuxGgbJWKav9qfxgPw6rh3Ghp1smbw7O2dVwafH/RkT6AjVw2XmZhVseTZTIoIBqznRflkDJdUPMUq7Ui3UXVYXajxRrVxyeaptj7dMHLWSz1nSjrHnbhLQhsLjQ== 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=ZFkE5uoZqkr4LkeK9kUEeXy59JxDo+7JNTh+hdPVJF4=; b=xZRO6xgEGUxSXT1NxIgq+pnWcdQ9UktTf2g6P0ccN+t/iIc8ZZueNbdoTQy6TeQg/0mHNIHZyI3cPg737zcbs9e0bV9y+COUaGUAkiM7s6JQj+LVb671zesSrrGunhDotecMEZwnj8qukUy0UWTQwDiizy9r/8BuVmBEhSRg8Nk= 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 PH0PR08MB7020.namprd08.prod.outlook.com (2603:10b6:510:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Sun, 9 Jul 2023 17:06:59 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae%5]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023 17:06:59 +0000 Date: Sun, 9 Jul 2023 12:06:57 -0500 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 v2 2/4] dt-bindings: input: iqs7222: Define units for slider properties Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: DM6PR02CA0076.namprd02.prod.outlook.com (2603:10b6:5:1f4::17) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|PH0PR08MB7020:EE_ X-MS-Office365-Filtering-Correlation-Id: bb667944-1725-49ef-93f6-08db809ee889 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kBR6tvr0iYI0U/GfF0Oi+LrUl16HeI62MFTVC90vC0M4wVUwSifwtrc/bvhiczqUn/vaNPoBs8ESwo/Xvth+keeBS05WUkSSxnKFdTGp6ZghcSkG7uNBfxUduH/1H2cS/kD85+4znI1TzsMXf0H2iERH5bLUH3t/432RcKrrGmNulX2hLSiAs+ixgcxkt7ymuLX71arFbQWyGbO9DZQkY75FSdvkN3IsYp2NmaMMFX3EJiLpD3ag/mdvHhbQ17U86qtYU/JtS2yzHt0i1UsbIpSBZPjhaOuZfLtziHsS51qgkBPvpL4Zc76ZqThvczDbPtaoQc/gXB+o2NkAdheWaJqVpfX8pL3mCUkYdIXAWKyoxYqQLZo5vFqZNIuS8frd8XunF35RZSPQTzzwZM7f8yZ3l6g1rdkUOSGx0vljLHMILqOKSg+uhu7XCgUiuyi3P1SC6/kablPGNaIjMyPE1cwBjdIm+cTunIs47QvWypJj6wtdHGlGIAygvkJfiDSZRjYt+ZD6jwLVyXrNfjeCwhoUlgiSJJvJIyv9Fwv2rIZd2YRP2E1KyzmCzZIG5BZK 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:(13230028)(7916004)(136003)(346002)(396003)(39830400003)(376002)(366004)(451199021)(86362001)(38100700002)(6486002)(33716001)(107886003)(26005)(6506007)(9686003)(186003)(6512007)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3lYwwQp8YpVl9edHA6VCGmve/HkXd3pgMbR5UfQrQzTH7fqBDqBGMBB9gOTbZUrWKot9pq+mD4ncshrIfC1ZkH64ZAdArX9WkCs4Dy6Wvxtm82uMDI5Nf+JaP07cA07f7v//9pPf1Z4H81tglWd4A1wTwBsq8aA2u8rp1oRMpa2CxExOCWC4D1uWA4ExhkHJE3MiJh89c/6MzYvcpzgMtmnPBANmKpB5fryOphNk2yla2wUCUMEVQ7yR7Ks03Pg7a3z96jMIT0WB/7CKBdPGZASCMHDEX7EYrtT25rC6rOECJXme+bqIOcE+9oRU0UHeTrt/d3zwesIj682WWReqwbxD5QxkAOp8X1CE1365HAN9q01ckWeHJIqxhinfFLQEXeNGJLAcdC25DJ0bhKFFvPoSmqtL7HAN9NPpxIKZaPEskELwYaZVrSKRY7cCB7MswVcigbtmN3X6UJMbPObSGC0PTE6qD1j1uwDcEJh3p4yd+o5LqQf77Ll3cwFZ+FkYqLks54v6tRvztXOcL7P7n7410uekhNGc0RzMVQhcfOYRppX3xsy1G/PSQ6oOnWiaqaVXtMsFOWA1NFXPkK/z8JmnNSjCtW9UwR/OuxuswFS26F44WQ0pcBbh7YwYb/74lSKyn5APopZO5wDEeruSCJTdV4JEeX9xgP1CtxqCYmQFx2ViVtKgqpbFA8muAozG04gyz90i2QXuZxvfywjRbPrrnvbe8ds5ygQepvfbrwhBf8rzLVjRwRQKtrPLLRM0UdgBLWvSyoqO0WQtrINxZVH+1nJHwz4eW9onB70wIGtql1nky4XKc8qwZt/cp6hfPBaekJer6g0uToJmB0oF97pDzIuueK0WExubtXKOHARo77mu7TlW5T9uwH/b+JSTEvlyaRusuBPSacEo06Xv8wu6ed3ulLkI9hmJ+xgymwr51e1+cuYN68p2ub7LdwtnJbOe2b75FwtENVvrHFmpAIeoogLDlXDrgqUj3urT16VRvBET9jhfQ53ArG1aQQ9qLf+oFk1XHrurYwMsRXOB24kJ2QUiBidry7eUtjhYzZ8avpEQ2keY/kkMDhxfok21Cv0AnrmvEKI09q62wgwWBgTEDr+a8qjRR0JBj2qImLwD5b+EnieLabJ0mwLC5Dt+r5sXO5YWR98AjV5OXdbAOzGXmrMm3Yd89Yau0Nsg/JOBP9+UOzSa6PlaXkcR4G30GsBoF71exmE/XuSMeZiQG3qQ4MuS2PTp7V5LtQa4Mr/zcXf31rAdlk1mMhDKKmXVGqsS/5llaI/3uV9tE3A5kxYpx2QdRLfgYXns3GaxiODFkt5H0drTc8LXZ8Y8veMO1JQez8tlX6Gso1uYKfIvlqqlbjFtYzMJOkT4gC3bGh7C3+RfNwpbCIYR6j9eT8RMt2+ETNj/36SlGlh2VI3ocgYqdosTts9NB22gNXtijAWSAkgcZbgTR2Cy4Qwdlc8LdttcGZAHFKK9QX8zDF7ug9+k7C1meTYs1UcPmSS7pHz8AWLDZfvEXHw5gatznWzMnOMSyg00JpUaekB37QSNo+xtrBjqlT+G1TwpYOeDw/hwiG+igtjrMTj5lwEsTAAC X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb667944-1725-49ef-93f6-08db809ee889 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2023 17:06:59.8818 (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: HTy7fvEjOsFpb6ifYVaORGFAzBCZ6VNg/MQDK4F4eaGITfjrHfalndSdrYh+1I1n0FKT/NBXWMigoQdD2YmtDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR08MB7020 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The units assumed by the 'azoteq,top-speed', 'azoteq,bottom-speed' and 'azoteq,gesture-dist' properties are unspecified; define them according to the device's datasheet. Signed-off-by: Jeff LaBundy Acked-by: Krzysztof Kozlowski --- .../bindings/input/azoteq,iqs7222.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml index 9ddba7f2e7aa..4c8690b62ce0 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -521,16 +521,16 @@ patternProperties: minimum: 0 maximum: 65535 description: - Specifies the speed of movement after which coordinate filtering is - no longer applied. + Specifies the speed (in coordinates traveled per conversion) after + which coordinate filtering is no longer applied. azoteq,bottom-speed: $ref: /schemas/types.yaml#/definitions/uint32 minimum: 0 maximum: 255 description: - Specifies the speed of movement after which coordinate filtering is - linearly reduced. + Specifies the speed (in coordinates traveled per conversion) after + which coordinate filtering is linearly reduced. azoteq,bottom-beta: $ref: /schemas/types.yaml#/definitions/uint32 @@ -595,10 +595,10 @@ patternProperties: minimum: 0 maximum: 4080 description: - Specifies the distance across which a swipe or flick gesture must - travel in order to be acknowledged by the device. The number spec- - ified for any one swipe or flick gesture applies to all remaining - swipe or flick gestures. + Specifies the distance (in coordinates) across which a swipe or + flick gesture must travel in order to be acknowledged by the + device. The number specified for any one swipe or flick gesture + applies to all remaining swipe or flick gestures. azoteq,gpio-select: $ref: /schemas/types.yaml#/definitions/uint32-array From patchwork Sun Jul 9 17:07:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13305916 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 0447DEB64DC for ; Sun, 9 Jul 2023 17:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbjGIRHM (ORCPT ); Sun, 9 Jul 2023 13:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjGIRHL (ORCPT ); Sun, 9 Jul 2023 13:07:11 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88848126; Sun, 9 Jul 2023 10:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XMe3d3gug7Wt/uJYqP5PyKoTTWLplVdp1PBmxEZuV4K7PeBtudvsg8Jyxze8oHmRM96KhyM7yR9FrIVOAm/z4G0AvB/mCkqgmpLUZk0m+IiL2d2lspPTt2lJZIFv3a/8MfQTRMT+zMvAdTY6NAB0P94nqDxAmVF6fYtFHY0f3+n7TpV3xkMD/WKbUkd0/GMw+x0yVC1WXWC4j4VNVlPuACSn7h4yj1d5cPSUSI8I6nFQP3A20idCzK3niLchmhbpB4X19VsB0fXW5z+vxaUIUFNhpfp573ogJ5+ym7JNG/e6MeBwK63ugkmk70U1EaHwevxnylpptzL8E0FOkdymtA== 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=kjEMF61EFWqR5SbYouY/Tz6F9CG2rdvXCQUgY9j3YnI=; b=fAZFvpPfmUVSZGLJrnTcM5G1CuO5xfW+ewvOj+8AWwsz7CUzLAQ2uF8yDAcgxtneViWLHW8fpM+7sRUy2R+PV5RvTM1cjxpIchVOV1ukiqJufm9iisBPeEEL9+i0kLQTErqP6bnCRbK0CwtVWVzMzqn02hrLrVgdxSPzdRqXWam2BsiBKJPzFLoSanYzuK1+AMLID3W3x2dF5GR9C6952s5hCAmIaNyIal/15cLmU5/CgTxAvUqZTgKnzheIZ6PQY0AtGskIWeJn4XXSo+HXHPDlY5LG+Q9F8Z6RAzX9i6IDJ7Syvd39HrdN7jLvjabhyPIWd8q8ULLxQzBIxFN4CQ== 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=kjEMF61EFWqR5SbYouY/Tz6F9CG2rdvXCQUgY9j3YnI=; b=LELmixv1rpLlff3Qsju3V43bJCRjalfPHkBwOrRqSQj2GuPAJ9/tggeW4cMxE09K9ERg1BNbiLamfMvO1pSObfa+h5ZHC6u6fwc0E2VPKTbzq/yHDn0ElPOvKrDVMlcunwnX1EGkV9Uz9x5vJWG+d1BbVcAu1pq7YB6fR73bTaA= 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 PH0PR08MB7020.namprd08.prod.outlook.com (2603:10b6:510:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Sun, 9 Jul 2023 17:07:07 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae%5]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023 17:07:07 +0000 Date: Sun, 9 Jul 2023 12:07:05 -0500 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 v2 3/4] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA1P222CA0098.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:35e::8) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|PH0PR08MB7020:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bfd2304-d2ab-4707-32f6-08db809eed10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RC1V/dN2+mxtBNAVLsbcg8oVn5MatPS17euRM9HtYx02qwHsovoj0xcH+usv0fZopJ6vjLLY8u0EJ7M1TGqC0ikm4tDAng24ISLCLG0zoXxp9h5t9Fy+3OXmPX348yXL1QS5yMBgoPPrDzMSEoXRtqDvIje+NrMYoVJdQkBkOlycn9g2tPDkgq7XL2XeXwnUqeu3HG0gUs+lZ/lexCUWCCir87NUzsg5NiYeCaFpDTr+jpKXJT8yfM8i7PzQNzIFuJMtD4BD+BlgzgrOyWFDoy8bWSZVQNhRH3YrdQ8V5BiFTkAfzbxi17chhysdOPMFpqss3clcucWDrqi+YXkiwsQ+s3JJopWSnIvJti23yoiSQFjPGJljqOvaly+aq2KLQB8xlVPn/T/tIIqutsRhr0w91O7TnZS0uckcRHN9S8yxfw1a2boqV+g5DynQMBIwdxJCQFI7vmw3Kdx1lsxOEv/YVgzn1sNuVvoDbGmGCMcioXOZ4ESS+vWLrOnYkFs1MRkbKMee3fz8agZhQMbRtIriCxzm5JmK6PfhgArQzH2o9znvT5bBFSyK4xUTV43QTVToaNriKzP62s/RHjREe6quVpB7zNdf5oWjRchf85Q= 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:(13230028)(7916004)(136003)(346002)(396003)(39830400003)(376002)(366004)(451199021)(86362001)(38100700002)(6486002)(33716001)(107886003)(26005)(6506007)(9686003)(186003)(966005)(6512007)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(4326008)(41300700001)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yK5nsg54OcUKZAZs5VfKAikMLsA2Zx57KM1diPATnBesgcdo97Yv7m4zVimDkP29RMwUgvy1s/pb91Lu7MQUIyCCoboTrRstGGcMUFvZyukF/+30qRiIrXMWd9EaeYbPWOv92xUcxzpPsfAXnfFLtvNXbm0/CVtd0FojMiQoJSW6Q3xIH93fn/fm1Nc1+ozQM4OarnwH3xvHhopoP5mXonDm/kgWR0Wz770ygNT6IPy8DzFMcgEM8Op3SAqHnJEs+vvPgGRxDPstvnBLvoesap9nUg7K+79ogfOw3C8kbhq2vAt0k+C3iDzFNjbsvSfO3ruSAsrVMcdKKQcXZHSvG3SU4dKLFufrDAVH59tSuv13WHId1K3OkCnYJqGdSiqBl+xEVI0PUrIso+nUt8tm1o2sSpQSAf+MAT3xSpLPJkcm0bc1fAzsyBFdGMmw4y6P8C7YcTPcYXU39r6NtmB0Wec8npy2eN5Jj7/6m5nm+UXOKZmRrryashpN/b+eodVAEvEkcz/1PC8xqDkt/EHOaG/3vAbeRFmZDQCq4X4pJ/YP18F4SSSAcsvu6Is7Igddxz/iiHyUN0wDUOf43drg31KZ+sIVL39PMsGzzg9c0jSHklYtoqoYU3LkxN9sjoKlQyebFT/UttGs80rjfE7boH0uTm28kdm9H/Z1jjsVxQEylnmbTUh6BGLz6PB0ZJdRkwjwnQJYLycbfG1SWtbr7ji6agmX1IK8jAq3TPhvRMH/Vbs2aSFOA7cVNcMy/8gOrYSE7ik0/6CBrmrofTFujl0mHVg8DXwojCqjKdCFM/D2V26/gMvZKXs6NHVhe5Rl4jrzK0V8sue43x8ay7D4IOVY6QwoCpBgo+6QghlTSmlGRUrDa97vM+VkF0rBG8B9kHbLr/FZvCs1kkOxfHjajesxhCwOdRTluqg50n03GLTZe7yqEdO5WbM0Bb9gS7G/PgFMLDfVQIrGiBNgD3eFdzoqW+rorF4u9tOoq2GBrtcHvKno+WQo2k/cJ0UKkp52jRJuZaYrYhEI/zASqmV1pCP728JaO5KsXr0hUwANZG7Vv0wfGwesEPXviPqJMrcNJlTv1ykcXL5qBgC4+Zzx7w6uquem2krotxn1D9wVBrwlbaL2stbSke1gnNLBhcW+0XF5xdxux68GMqTn9WnugBto6Z80YhwGrUPkEfjXnYSXBGyFKCIQ7NEhPplNZyGwcymabSZVygA61JTDIYlvxBS7186dgFCxr2KtuTW0kHcJik5ER4SHdOJqr9RTZxsJvXPcekH4f5aexL+8C+cdPs30E6/M+UmQU80F7r6cLFtDduPIEiZ1jBNTkvumo677PO/8Mus2UBS4h9AJQGLMPVh0BO2jDpnhTLsyQvqCHMfyxx2OAZo3g0OVFtWngAOS0HrQVE9pvSG/5eGh8feJRdEafhB9mK2nNHb8oGDwf9xbCBMPQOtAVbUNzZJMNZ2i+TUubuUBABCt8DodiNQbyXGcPXcVwFKbS5IsJo448fG2HfQSnVBXFKf6qOwrzUXnyJcP2CqeEfnEZ6Rp28Z8p0e41r6yMZi2bOz+1fXFLr+wM1jXr7Qy0D3XikHOw/jM X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bfd2304-d2ab-4707-32f6-08db809eed10 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2023 17:07:07.4929 (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: q8CFJSE9tcFm/+Wf0+NPZ3GW2AmZAp+ns/o+AZKV7F1g2cMNiKzITYRcCxQlzfSWG9qBUbquT+gsDzvDiQhmhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR08MB7020 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Extend the common binding to include a new variant of the silicon, which effectively replaces a pair of slider nodes with a trackpad node comprising the same or similar properties. As part of this change, the if/then/else schema have been updated to identify properties that are not supported by the new device. Signed-off-by: Jeff LaBundy Reviewed-by: Krzysztof Kozlowski --- .../bindings/input/azoteq,iqs7222.yaml | 232 ++++++++++++++++-- 1 file changed, 215 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml index 4c8690b62ce0..5b1769c19b17 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -4,14 +4,14 @@ $id: http://devicetree.org/schemas/input/azoteq,iqs7222.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Azoteq IQS7222A/B/C Capacitive Touch Controller +title: Azoteq IQS7222A/B/C/D Capacitive Touch Controller maintainers: - Jeff LaBundy description: | - The Azoteq IQS7222A, IQS7222B and IQS7222C are multichannel capacitive touch - controllers that feature additional sensing capabilities. + The Azoteq IQS7222A, IQS7222B, IQS7222C and IQS7222D are multichannel + capacitive touch controllers that feature additional sensing capabilities. Link to datasheets: https://www.azoteq.com/ @@ -21,6 +21,7 @@ properties: - azoteq,iqs7222a - azoteq,iqs7222b - azoteq,iqs7222c + - azoteq,iqs7222d reg: maxItems: 1 @@ -173,6 +174,152 @@ properties: maximum: 3000 description: Specifies the report rate (in ms) during ultra-low-power mode. + touchscreen-size-x: true + touchscreen-size-y: true + touchscreen-inverted-x: true + touchscreen-inverted-y: true + touchscreen-swapped-x-y: true + + trackpad: + type: object + description: Represents all channels associated with the trackpad. + + properties: + azoteq,channel-select: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 12 + items: + minimum: 0 + maximum: 13 + description: + Specifies the order of the channels that participate in the trackpad. + Specify 255 to omit a given channel for the purpose of mapping a non- + rectangular trackpad. + + azoteq,num-rows: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 12 + description: Specifies the number of rows that comprise the trackpad. + + azoteq,num-cols: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 12 + description: Specifies the number of columns that comprise the trackpad. + + azoteq,top-speed: + $ref: /schemas/types.yaml#/definitions/uint32 + multipleOf: 4 + minimum: 0 + maximum: 1020 + description: + Specifies the speed (in coordinates traveled per conversion) after + which coordinate filtering is no longer applied. + + azoteq,bottom-speed: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 255 + description: + Specifies the speed (in coordinates traveled per conversion) after + which coordinate filtering is linearly reduced. + + azoteq,use-prox: + type: boolean + description: + Directs the trackpad to respond to the proximity states of the + selected channels instead of their corresponding touch states. + Note the trackpad cannot report granular coordinates during a + state of proximity. + + patternProperties: + "^azoteq,lower-cal-(x|y)$": + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 255 + description: Specifies the trackpad's lower starting points. + + "^azoteq,upper-cal-(x|y)$": + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 255 + description: Specifies the trackpad's upper starting points. + + "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$": + type: object + $ref: input.yaml# + description: + Represents a press or gesture event reported by the trackpad. Specify + 'linux,code' under the press event to report absolute coordinates. + + properties: + linux,code: true + + azoteq,gesture-angle-tighten: + type: boolean + description: + Limits the tangent of the gesture angle to 0.5 (axial gestures + only). If specified in one direction, the effect is applied in + either direction. + + azoteq,gesture-max-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + description: + Specifies the length of time (in ms) within which a tap, swipe + or flick gesture must be completed in order to be acknowledged + by the device. The number specified for any one swipe or flick + gesture applies to all other swipe or flick gestures. + + azoteq,gesture-min-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + description: + Specifies the length of time (in ms) for which a tap gesture must + be held in order to be acknowledged by the device. + + azoteq,gesture-dist: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 65535 + description: + Specifies the distance (in coordinates) across which a swipe or + flick gesture must travel in order to be acknowledged by the + device. The number specified for any one swipe or flick gesture + applies to all remaining swipe or flick gestures. + + For tap gestures, this property specifies the distance from the + original point of contact across which the contact is permitted + to travel before the gesture is rejected by the device. + + azoteq,gpio-select: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 3 + items: + minimum: 0 + maximum: 2 + description: | + Specifies one or more GPIO mapped to the event as follows: + 0: GPIO0 + 1: GPIO3 + 2: GPIO4 + + Note that although multiple events can be mapped to a single + GPIO, they must all be of the same type (proximity, touch or + trackpad gesture). + + additionalProperties: false + + required: + - azoteq,channel-select + + additionalProperties: false + patternProperties: "^cycle-[0-9]$": type: object @@ -288,6 +435,10 @@ patternProperties: Activates the reference channel in response to proximity events instead of touch events. + azoteq,counts-filt-enable: + type: boolean + description: Applies counts filtering to the channel. + azoteq,ati-band: $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 1, 2, 3] @@ -432,12 +583,12 @@ patternProperties: description: | Specifies one or more GPIO mapped to the event as follows: 0: GPIO0 - 1: GPIO3 (IQS7222C only) - 2: GPIO4 (IQS7222C only) + 1: GPIO3 + 2: GPIO4 Note that although multiple events can be mapped to a single GPIO, they must all be of the same type (proximity, touch or - slider gesture). + slider/trackpad gesture). azoteq,thresh: $ref: /schemas/types.yaml#/definitions/uint32 @@ -610,8 +761,8 @@ patternProperties: description: | Specifies one or more GPIO mapped to the event as follows: 0: GPIO0 - 1: GPIO3 (IQS7222C only) - 2: GPIO4 (IQS7222C only) + 1: GPIO3 + 2: GPIO4 Note that although multiple events can be mapped to a single GPIO, they must all be of the same type (proximity, touch or @@ -629,8 +780,8 @@ patternProperties: description: | Represents a GPIO mapped to one or more events as follows: gpio-0: GPIO0 - gpio-1: GPIO3 (IQS7222C only) - gpio-2: GPIO4 (IQS7222C only) + gpio-1: GPIO3 + gpio-2: GPIO4 allOf: - $ref: ../pinctrl/pincfg-node.yaml# @@ -641,11 +792,53 @@ patternProperties: additionalProperties: false allOf: + - $ref: touchscreen/touchscreen.yaml# + - if: properties: compatible: contains: - const: azoteq,iqs7222b + enum: + - azoteq,iqs7222a + - azoteq,iqs7222b + - azoteq,iqs7222c + + then: + properties: + touchscreen-size-x: false + touchscreen-size-y: false + touchscreen-inverted-x: false + touchscreen-inverted-y: false + touchscreen-swapped-x-y: false + + trackpad: false + + patternProperties: + "^channel-([0-9]|1[0-9])$": + properties: + azoteq,counts-filt-enable: false + + - if: + properties: + compatible: + contains: + enum: + - azoteq,iqs7222b + - azoteq,iqs7222c + + then: + patternProperties: + "^channel-([0-9]|1[0-9])$": + properties: + azoteq,ulp-allow: false + + - if: + properties: + compatible: + contains: + enum: + - azoteq,iqs7222b + - azoteq,iqs7222d then: patternProperties: @@ -657,13 +850,22 @@ allOf: properties: azoteq,ref-select: false + "^slider-[0-1]$": false + + - if: + properties: + compatible: + contains: + const: azoteq,iqs7222b + + then: + patternProperties: + "^channel-([0-9]|1[0-9])$": patternProperties: "^event-(prox|touch)$": properties: azoteq,gpio-select: false - "^slider-[0-1]$": false - "^gpio-[0-2]$": false - if: @@ -704,10 +906,6 @@ allOf: else: patternProperties: - "^channel-([0-9]|1[0-9])$": - properties: - azoteq,ulp-allow: false - "^slider-[0-1]$": patternProperties: "^event-(press|tap|(swipe|flick)-(pos|neg))$": From patchwork Sun Jul 9 17:07:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 13305917 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 27FE8C0015E for ; Sun, 9 Jul 2023 17:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbjGIRH0 (ORCPT ); Sun, 9 Jul 2023 13:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjGIRHZ (ORCPT ); Sun, 9 Jul 2023 13:07:25 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061.outbound.protection.outlook.com [40.107.94.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B98D9E7; Sun, 9 Jul 2023 10:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxYVVxg7508558De2AYtpdqyFts+Yt2w3SLMoMwbleHzGJ48h5bKKyFHqVHGMveKu4g/InHBwS6Dr15Sj9cJbRNInHU8JrlIINPZFdkxMPICX2DJ3RGezLezL74hKuf0Yg+cb1Ai2MJSha0zW8NcMYe5tYEfCGbIbco9zN+q98e7ugBS+7uspIIjBR35NLoQdzX8ughksM98cgiJi6cJuwkGMuW6iRPpw9vChc+thRK35fzooX0nX2MFA4t5fCuMjGP1Tev6FsXtKPZELuyMVAn8I39KS+6OlpbqRa2h0M9He9zylKnJq6dfS131lBRSJRS5Gw9SRP+QhdoDnspyLw== 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=jjP0iHJtkb3l7XAg7I5b2gu7Ixfwv+YCG7Xi1a5xioA=; b=IVFOOB9e/tfw0WpWrqFuo92R58JmSSYqDKKocGOhuZvb39S1ZR12ZsI2c+gd+KxfIyNm70vVwICOZ7qysjqBPd1K1CWsu0FlA1xWp3ZMFj8KOTmmhXXCMQxBVQQBD8JqGtlcpC+UHjnhwP3td9ykva+eVsGtrm8C+sIPu4RB3mcJmx4fGuj/6hvEy6JApkGYHWXmR2JIDSUGc4wXQGoZw1XPSZPnLTu5j3a6X2b4im+eij2QLSgzGn2i9Zv49CWvQ3VMPfbqBe1PfdjD9vFiSegdV7Mdm9NwNcQWF5M7vS62oCVqrBcOFkFQ57KLKJRKtDUFU3C9K/ke2wEO/Gsm7w== 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=jjP0iHJtkb3l7XAg7I5b2gu7Ixfwv+YCG7Xi1a5xioA=; b=VgcvQhQvPcmjZJwHuGNS2KH3qQGja30F7pZzNxLT7rVE1Dcz8efLqzw9hbNmYJUkMwcfubkBrHvMD6C/lQPrXq6fUiv72Dn6zrjxNCU4ImJnX5JoWWVMu6r7/LwzM6OtLS1hva1pVqMlOJrgtXY1ToZM4LI5FN1s9Upe1F9OHM0= 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 PH0PR08MB7020.namprd08.prod.outlook.com (2603:10b6:510:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Sun, 9 Jul 2023 17:07:20 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae%5]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023 17:07:20 +0000 Date: Sun, 9 Jul 2023 12:07:18 -0500 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 v2 4/4] Input: iqs7222 - add support for Azoteq IQS7222D Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: DM5PR07CA0092.namprd07.prod.outlook.com (2603:10b6:4:ae::21) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|PH0PR08MB7020:EE_ X-MS-Office365-Filtering-Correlation-Id: c3b3a844-7497-4df7-d5a8-08db809ef4d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FicT+bWSgkYoACqEFR/1wpTC0NOlDDhF4n34v3pKGWNhOilACPGgSseQ1j9t0QgXHP8ONimAY9Rg1cqn4RR3hVFDQJfXzm4YMW0cUO1RZxL9N0RnCabHnua06YfiOa0SBcynrobEoL8BHMxhZEzYw72h11ngd3XNYtcfFZzpgrbymqfceEfYK5jvnQZt03+j/nDdM/1zbKntifAIA/+5imc58G9srTnG1ALklSM5YyHF2jW3n9q4wmX0k61lHuUJIL2iuPorsc3Ua5ETLuLsBVxQkL6Fi6E10BQSknMgBzx0HKJYf9rwZbuGK9ksAb3CENBn9QbVfxZ6jgu8kORF9trnYACMkqlISr7FTnH3pEIWXhO/k74VbzQkOy159EgUWr11Yw/FMv/S/WOBkMu6ygBcqX6XX7EukPaVoEHhnZ5KKY7a54maBRHTAkYUlefl4dwA+mouAhSnnZlLmPTjJpYCwix6cgkzQfBE6CrMyGBoaO1KMbLbveOlqVOb8gGfkpuOoQomtNHX2kmTytdhkhHeFpy3RPTh5paX9Qw5EM7xmjTk0ap4rBW2Vo/wTWfSaTXuz15xNifExVcymH/tK7asCX3btv8YH1ZCwrE2KL4= 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:(13230028)(7916004)(136003)(346002)(396003)(39830400003)(376002)(366004)(451199021)(86362001)(38100700002)(6486002)(33716001)(107886003)(26005)(6506007)(9686003)(186003)(6512007)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(30864003)(4326008)(41300700001)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DIQ0dudaK16fYaKJt44r+LdkHUiZcBDFIG5yLGrIvQVAPauAWFrpQhMM5TMMoa+DqoPlNt7OdGbech7Vm+cwKr1lBVNK0q+QxbXIzDo10y+CJHzDz+QsrvnkwYvuIp1QZS+Ev2unICD/E/O33nStrtWlaCaAvgl7swjUQTeR1t2iwJN8eFs4nT/QIhBitoZPbwa9sE/KBdnCuJsrGePcDUMAOMd/6Fvk5nDHiKgCMKUJpgSZIujYKru02vUrTvVL4awFCuq2QbTf0AC1hAwdsMYzHyIBXy5fren5qMlAvhHnofFCdGITQvQOOukGTsTWGDK+DOSrgAqcypw0UtVpFEOHS8LsVb2gg2NKOy7po4/pJZC/siePqojgYRUhFH3EJBAaPfPzoeziEa0gn6dasfYf2lQiz37xPsfEEgi9+gBgPq6R0fEBySMXOWtx6407w0M34V244fCwo4elUZAan2xOEbQ991k6JZJzatD2chxfEoH6VUqhKX+mUPsz1y+Vxk64FL+AN4eOF0zmtLGOgPVBoIOhaY4F3V8QYEnPCd7xhEQJGNqZIBhQPwAk+BN0TDN62syLSe/rYcCSSAFiPXnaABhKfk9swM7GX7TvUosIVeqs8NtEswb8MJ8lQHWyl4LU5fA9y0P6/hRUBg/FAK57GKktNpN3jYIeJ8h4InFBYvRuyxMwt4LP1cvm3fWaZ/3PyvjpG/uofwwle/EoGZFtKPpD77trYaSKCzvM4DDEmxHwyU6ZUR4b4rC1MGgi20cYIt2imf29hMvFqgsVyCYZ9BG1lHSWXo7xwRtN23CFD5Vlhp6WtEG4QB492gyKXuS83tPH6y6WQyF1f9l+C9Yb4/9r1jG6HqIBUQLkBb/3yPS4bKEEj0shw0hTYsFEI38iP5GVhnEqhutOz5eHW2Kd7GQ8HC8jzOVpmMT2A/Up2FpTNR+Qef4KvBEW3vuPWFzOmWXSFNk05BA9tD7oWjUQV8jdFjK35J5wdbmQeKznPjbtUHAWJYRDRy4EwtlXgOBU4iZ9sZDEnvuP+ut13RH3Yj7z8fy14FndqaTkxoq2LUiOeQ/p/PXuyGRf276K8gTUqJAer8uaMj+pgv1IqWwjcG8aFQ2gzdniSTSNGXinYbcgOudE11insonhZKQT6p7HdGwSptT4Ybl5JrZy3TmJx0eQAHwmpXJKMG062VFWhAAWqzZEX/uX9ViDH8B6k5IldXeLgFSaez63TXTP8PujrEuNK2wmdxHhVFj6YaerqrbtIvIcjojQxmB3MXoqAHwMgPgjW+uSfU5gWeMraIo426PZIP6yR6dBuyf71utqQinUjPna7HkxVp+5PO95vCyTFiWIf9mt96j6iq/Ey1b2Sik/7N/2ZKXYj/uRiQ34uwLZiaA1buzwcUICxDRnJdMzTkcxPSGtrXYT/h1KZx5jN+b3nlaGsIsyoQBApANyICbYmCckA+dS8JEg5KmZJIsbFw/7M44YdB+TUMlD9rvqusYnrrquS/daCu22eosOJRCXWIMENgGWfYqPZ4LkTWEHj5CwHRGoxc+JkGN1Zzss3CvHEmqym1yQRK2AqsV4Ol4jRX2U1eYN96BFVQTs X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3b3a844-7497-4df7-d5a8-08db809ef4d6 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2023 17:07:20.5493 (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: qpgb0Tgcuki7XntjoocVCxxulkQGq8/FG+qBMxxzuWct1bZRpL/u5KvOHvh5HIDQyHHKPwBclYPGq72CBPZIMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR08MB7020 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The vendor has introduced a new variant of silicon which is highly similar to the existing IQS7222A, but with its independent sliders essentially replaced with a single-contact trackpad. Update the common driver to support this new device's register map and report trackpad events. As with the IQS7222A, the new IQS7222D can report both raw coordinates as well as gestures. Signed-off-by: Jeff LaBundy --- drivers/input/misc/Kconfig | 4 +- drivers/input/misc/iqs7222.c | 468 ++++++++++++++++++++++++++++++++++- 2 files changed, 461 insertions(+), 11 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 81a54a59e13c..c47eecc6f83b 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -791,10 +791,10 @@ config INPUT_IQS626A module will be called iqs626a. config INPUT_IQS7222 - tristate "Azoteq IQS7222A/B/C capacitive touch controller" + tristate "Azoteq IQS7222A/B/C/D capacitive touch controller" depends on I2C help - Say Y to enable support for the Azoteq IQS7222A/B/C family + Say Y to enable support for the Azoteq IQS7222A/B/C/D family of capacitive touch controllers. To compile this driver as a module, choose M here: the diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index acb95048e823..a9c1dba1e8c1 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Azoteq IQS7222A/B/C Capacitive Touch Controller + * Azoteq IQS7222A/B/C/D Capacitive Touch Controller * * Copyright (C) 2022 Jeff LaBundy */ @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,7 @@ #define IQS7222_PROD_NUM_A 840 #define IQS7222_PROD_NUM_B 698 #define IQS7222_PROD_NUM_C 863 +#define IQS7222_PROD_NUM_D 1046 #define IQS7222_SYS_STATUS 0x10 #define IQS7222_SYS_STATUS_RESET BIT(3) @@ -54,6 +56,7 @@ #define IQS7222_EVENT_MASK_ATI BIT(12) #define IQS7222_EVENT_MASK_SLDR BIT(10) +#define IQS7222_EVENT_MASK_TPAD IQS7222_EVENT_MASK_SLDR #define IQS7222_EVENT_MASK_TOUCH BIT(1) #define IQS7222_EVENT_MASK_PROX BIT(0) @@ -71,6 +74,7 @@ #define IQS7222_MAX_COLS_CHAN 6 #define IQS7222_MAX_COLS_FILT 2 #define IQS7222_MAX_COLS_SLDR 11 +#define IQS7222_MAX_COLS_TPAD 24 #define IQS7222_MAX_COLS_GPIO 3 #define IQS7222_MAX_COLS_SYS 13 @@ -102,16 +106,18 @@ enum iqs7222_reg_grp_id { IQS7222_REG_GRP_BTN, IQS7222_REG_GRP_CHAN, IQS7222_REG_GRP_SLDR, + IQS7222_REG_GRP_TPAD, IQS7222_REG_GRP_GPIO, IQS7222_REG_GRP_SYS, IQS7222_NUM_REG_GRPS }; static const char * const iqs7222_reg_grp_names[IQS7222_NUM_REG_GRPS] = { - [IQS7222_REG_GRP_CYCLE] = "cycle", - [IQS7222_REG_GRP_CHAN] = "channel", - [IQS7222_REG_GRP_SLDR] = "slider", - [IQS7222_REG_GRP_GPIO] = "gpio", + [IQS7222_REG_GRP_CYCLE] = "cycle-%d", + [IQS7222_REG_GRP_CHAN] = "channel-%d", + [IQS7222_REG_GRP_SLDR] = "slider-%d", + [IQS7222_REG_GRP_TPAD] = "trackpad", + [IQS7222_REG_GRP_GPIO] = "gpio-%d", }; static const unsigned int iqs7222_max_cols[IQS7222_NUM_REG_GRPS] = { @@ -122,6 +128,7 @@ static const unsigned int iqs7222_max_cols[IQS7222_NUM_REG_GRPS] = { [IQS7222_REG_GRP_CHAN] = IQS7222_MAX_COLS_CHAN, [IQS7222_REG_GRP_FILT] = IQS7222_MAX_COLS_FILT, [IQS7222_REG_GRP_SLDR] = IQS7222_MAX_COLS_SLDR, + [IQS7222_REG_GRP_TPAD] = IQS7222_MAX_COLS_TPAD, [IQS7222_REG_GRP_GPIO] = IQS7222_MAX_COLS_GPIO, [IQS7222_REG_GRP_SYS] = IQS7222_MAX_COLS_SYS, }; @@ -130,8 +137,10 @@ static const unsigned int iqs7222_gpio_links[] = { 2, 5, 6, }; struct iqs7222_event_desc { const char *name; + u16 link; u16 mask; u16 val; + u16 strict; u16 enable; enum iqs7222_reg_key_id reg_key; }; @@ -188,6 +197,93 @@ static const struct iqs7222_event_desc iqs7222_sl_events[] = { }, }; +static const struct iqs7222_event_desc iqs7222_tp_events[] = { + { + .name = "event-press", + .link = BIT(7), + }, + { + .name = "event-tap", + .link = BIT(0), + .mask = BIT(0), + .val = BIT(0), + .enable = BIT(0), + .reg_key = IQS7222_REG_KEY_TAP, + }, + { + .name = "event-swipe-x-pos", + .link = BIT(2), + .mask = BIT(2) | BIT(1), + .val = BIT(2), + .strict = BIT(4), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-y-pos", + .link = BIT(3), + .mask = BIT(3) | BIT(1), + .val = BIT(3), + .strict = BIT(3), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-x-neg", + .link = BIT(4), + .mask = BIT(4) | BIT(1), + .val = BIT(4), + .strict = BIT(4), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-y-neg", + .link = BIT(5), + .mask = BIT(5) | BIT(1), + .val = BIT(5), + .strict = BIT(3), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-x-pos", + .link = BIT(2), + .mask = BIT(2) | BIT(1), + .val = BIT(2) | BIT(1), + .strict = BIT(4), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-y-pos", + .link = BIT(3), + .mask = BIT(3) | BIT(1), + .val = BIT(3) | BIT(1), + .strict = BIT(3), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-x-neg", + .link = BIT(4), + .mask = BIT(4) | BIT(1), + .val = BIT(4) | BIT(1), + .strict = BIT(4), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-y-neg", + .link = BIT(5), + .mask = BIT(5) | BIT(1), + .val = BIT(5) | BIT(1), + .strict = BIT(3), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, +}; + struct iqs7222_reg_grp_desc { u16 base; int num_row; @@ -524,6 +620,62 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = { }, }, }, + { + .prod_num = IQS7222_PROD_NUM_D, + .fw_major = 0, + .fw_minor = 37, + .touch_link = 1770, + .allow_offset = 9, + .event_offset = 10, + .comms_offset = 11, + .reg_grps = { + [IQS7222_REG_GRP_STAT] = { + .base = IQS7222_SYS_STATUS, + .num_row = 1, + .num_col = 7, + }, + [IQS7222_REG_GRP_CYCLE] = { + .base = 0x8000, + .num_row = 7, + .num_col = 2, + }, + [IQS7222_REG_GRP_GLBL] = { + .base = 0x8700, + .num_row = 1, + .num_col = 3, + }, + [IQS7222_REG_GRP_BTN] = { + .base = 0x9000, + .num_row = 14, + .num_col = 3, + }, + [IQS7222_REG_GRP_CHAN] = { + .base = 0xA000, + .num_row = 14, + .num_col = 4, + }, + [IQS7222_REG_GRP_FILT] = { + .base = 0xAE00, + .num_row = 1, + .num_col = 2, + }, + [IQS7222_REG_GRP_TPAD] = { + .base = 0xB000, + .num_row = 1, + .num_col = 24, + }, + [IQS7222_REG_GRP_GPIO] = { + .base = 0xC000, + .num_row = 3, + .num_col = 3, + }, + [IQS7222_REG_GRP_SYS] = { + .base = IQS7222_SYS_SETUP, + .num_row = 1, + .num_col = 12, + }, + }, + }, }; struct iqs7222_prop_desc { @@ -1008,6 +1160,123 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .val_pitch = 4, .label = "maximum gesture time", }, + { + .name = "azoteq,num-rows", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 0, + .reg_shift = 4, + .reg_width = 4, + .val_min = 1, + .val_max = 12, + .label = "number of rows", + }, + { + .name = "azoteq,num-cols", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 0, + .reg_shift = 0, + .reg_width = 4, + .val_min = 1, + .val_max = 12, + .label = "number of columns", + }, + { + .name = "azoteq,lower-cal-y", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 1, + .reg_shift = 8, + .reg_width = 8, + .label = "lower vertical calibration", + }, + { + .name = "azoteq,lower-cal-x", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 1, + .reg_shift = 0, + .reg_width = 8, + .label = "lower horizontal calibration", + }, + { + .name = "azoteq,upper-cal-y", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 2, + .reg_shift = 8, + .reg_width = 8, + .label = "upper vertical calibration", + }, + { + .name = "azoteq,upper-cal-x", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 2, + .reg_shift = 0, + .reg_width = 8, + .label = "upper horizontal calibration", + }, + { + .name = "azoteq,top-speed", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 3, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 4, + .label = "top speed", + }, + { + .name = "azoteq,bottom-speed", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 3, + .reg_shift = 0, + .reg_width = 8, + .label = "bottom speed", + }, + { + .name = "azoteq,gesture-min-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 20, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 16, + .label = "minimum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_AXIAL, + .reg_offset = 21, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 21, + .reg_shift = 0, + .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-dist", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 22, + .reg_shift = 0, + .reg_width = 16, + .label = "gesture distance", + }, + { + .name = "azoteq,gesture-dist", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_AXIAL, + .reg_offset = 23, + .reg_shift = 0, + .reg_width = 16, + .label = "gesture distance", + }, { .name = "drive-open-drain", .reg_grp = IQS7222_REG_GRP_GPIO, @@ -1091,16 +1360,19 @@ struct iqs7222_private { struct gpio_desc *irq_gpio; struct i2c_client *client; struct input_dev *keypad; + struct touchscreen_properties prop; unsigned int kp_type[IQS7222_MAX_CHAN][ARRAY_SIZE(iqs7222_kp_events)]; unsigned int kp_code[IQS7222_MAX_CHAN][ARRAY_SIZE(iqs7222_kp_events)]; unsigned int sl_code[IQS7222_MAX_SLDR][ARRAY_SIZE(iqs7222_sl_events)]; unsigned int sl_axis[IQS7222_MAX_SLDR]; + unsigned int tp_code[ARRAY_SIZE(iqs7222_tp_events)]; u16 cycle_setup[IQS7222_MAX_CHAN / 2][IQS7222_MAX_COLS_CYCLE]; u16 glbl_setup[IQS7222_MAX_COLS_GLBL]; u16 btn_setup[IQS7222_MAX_CHAN][IQS7222_MAX_COLS_BTN]; u16 chan_setup[IQS7222_MAX_CHAN][IQS7222_MAX_COLS_CHAN]; u16 filt_setup[IQS7222_MAX_COLS_FILT]; u16 sldr_setup[IQS7222_MAX_SLDR][IQS7222_MAX_COLS_SLDR]; + u16 tpad_setup[IQS7222_MAX_COLS_TPAD]; u16 gpio_setup[ARRAY_SIZE(iqs7222_gpio_links)][IQS7222_MAX_COLS_GPIO]; u16 sys_setup[IQS7222_MAX_COLS_SYS]; }; @@ -1127,6 +1399,9 @@ static u16 *iqs7222_setup(struct iqs7222_private *iqs7222, case IQS7222_REG_GRP_SLDR: return iqs7222->sldr_setup[row]; + case IQS7222_REG_GRP_TPAD: + return iqs7222->tpad_setup; + case IQS7222_REG_GRP_GPIO: return iqs7222->gpio_setup[row]; @@ -1936,6 +2211,14 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, ref_setup[4] = dev_desc->touch_link; if (fwnode_property_present(chan_node, "azoteq,use-prox")) ref_setup[4] -= 2; + } else if (dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row && + fwnode_property_present(chan_node, + "azoteq,counts-filt-enable")) { + /* + * In the case of IQS7222D, however, the reference mode field + * is partially repurposed as a counts filter enable control. + */ + chan_setup[0] |= IQS7222_CHAN_SETUP_0_REF_MODE_REF; } if (fwnode_property_present(chan_node, "azoteq,rx-enable")) { @@ -2278,6 +2561,136 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, IQS7222_REG_KEY_NO_WHEEL); } +static int iqs7222_parse_tpad(struct iqs7222_private *iqs7222, + struct fwnode_handle *tpad_node, int tpad_index) +{ + const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; + struct touchscreen_properties *prop = &iqs7222->prop; + struct i2c_client *client = iqs7222->client; + int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; + int count, error, i; + u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset]; + u16 *tpad_setup = iqs7222->tpad_setup; + unsigned int chan_sel[12]; + + error = iqs7222_parse_props(iqs7222, tpad_node, tpad_index, + IQS7222_REG_GRP_TPAD, + IQS7222_REG_KEY_NONE); + if (error) + return error; + + count = fwnode_property_count_u32(tpad_node, "azoteq,channel-select"); + if (count < 0) { + dev_err(&client->dev, "Failed to count %s channels: %d\n", + fwnode_get_name(tpad_node), count); + return count; + } else if (!count || count > ARRAY_SIZE(chan_sel)) { + dev_err(&client->dev, "Invalid number of %s channels\n", + fwnode_get_name(tpad_node)); + return -EINVAL; + } + + error = fwnode_property_read_u32_array(tpad_node, + "azoteq,channel-select", + chan_sel, count); + if (error) { + dev_err(&client->dev, "Failed to read %s channels: %d\n", + fwnode_get_name(tpad_node), error); + return error; + } + + tpad_setup[6] &= ~GENMASK(num_chan - 1, 0); + + for (i = 0; i < ARRAY_SIZE(chan_sel); i++) { + tpad_setup[8 + i] = 0; + if (i >= count || chan_sel[i] == U8_MAX) + continue; + + if (chan_sel[i] >= num_chan) { + dev_err(&client->dev, "Invalid %s channel: %u\n", + fwnode_get_name(tpad_node), chan_sel[i]); + return -EINVAL; + } + + /* + * The following fields indicate which channels participate in + * the trackpad, as well as each channel's relative placement. + */ + tpad_setup[6] |= BIT(chan_sel[i]); + tpad_setup[8 + i] = chan_sel[i] * 34 + 1072; + } + + tpad_setup[7] = dev_desc->touch_link; + if (fwnode_property_present(tpad_node, "azoteq,use-prox")) + tpad_setup[7] -= 2; + + for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++) + tpad_setup[20] &= ~(iqs7222_tp_events[i].strict | + iqs7222_tp_events[i].enable); + + for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++) { + const char *event_name = iqs7222_tp_events[i].name; + struct fwnode_handle *event_node; + + event_node = fwnode_get_named_child_node(tpad_node, event_name); + if (!event_node) + continue; + + if (fwnode_property_present(event_node, + "azoteq,gesture-angle-tighten")) + tpad_setup[20] |= iqs7222_tp_events[i].strict; + + tpad_setup[20] |= iqs7222_tp_events[i].enable; + + error = iqs7222_parse_event(iqs7222, event_node, tpad_index, + IQS7222_REG_GRP_TPAD, + iqs7222_tp_events[i].reg_key, + iqs7222_tp_events[i].link, 1566, + NULL, + &iqs7222->tp_code[i]); + fwnode_handle_put(event_node); + if (error) + return error; + + if (!dev_desc->event_offset) + continue; + + /* + * The press/release event is determined based on whether the + * coordinate fields report 0xFFFF and solely relies on touch + * or proximity interrupts to be unmasked. + */ + if (i) + *event_mask |= IQS7222_EVENT_MASK_TPAD; + else if (tpad_setup[7] == dev_desc->touch_link) + *event_mask |= IQS7222_EVENT_MASK_TOUCH; + else + *event_mask |= IQS7222_EVENT_MASK_PROX; + } + + if (!iqs7222->tp_code[0]) + return 0; + + input_set_abs_params(iqs7222->keypad, ABS_X, + 0, (tpad_setup[4] ? : 1) - 1, 0, 0); + + input_set_abs_params(iqs7222->keypad, ABS_Y, + 0, (tpad_setup[5] ? : 1) - 1, 0, 0); + + touchscreen_parse_properties(iqs7222->keypad, false, prop); + + if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) { + dev_err(&client->dev, "Invalid trackpad size: %u*%u\n", + prop->max_x, prop->max_y); + return -EINVAL; + } + + tpad_setup[4] = prop->max_x + 1; + tpad_setup[5] = prop->max_y + 1; + + return 0; +} + static int (*iqs7222_parse_extra[IQS7222_NUM_REG_GRPS]) (struct iqs7222_private *iqs7222, struct fwnode_handle *reg_grp_node, @@ -2285,6 +2698,7 @@ static int (*iqs7222_parse_extra[IQS7222_NUM_REG_GRPS]) [IQS7222_REG_GRP_CYCLE] = iqs7222_parse_cycle, [IQS7222_REG_GRP_CHAN] = iqs7222_parse_chan, [IQS7222_REG_GRP_SLDR] = iqs7222_parse_sldr, + [IQS7222_REG_GRP_TPAD] = iqs7222_parse_tpad, }; static int iqs7222_parse_reg_grp(struct iqs7222_private *iqs7222, @@ -2298,7 +2712,7 @@ static int iqs7222_parse_reg_grp(struct iqs7222_private *iqs7222, if (iqs7222_reg_grp_names[reg_grp]) { char reg_grp_name[16]; - snprintf(reg_grp_name, sizeof(reg_grp_name), "%s-%d", + snprintf(reg_grp_name, sizeof(reg_grp_name), iqs7222_reg_grp_names[reg_grp], reg_grp_index); reg_grp_node = device_get_named_child_node(&client->dev, @@ -2346,8 +2760,8 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222) continue; /* - * The IQS7222C exposes multiple GPIO and must be informed - * as to which GPIO this group represents. + * The IQS7222C and IQS7222D expose multiple GPIO and must be + * informed as to which GPIO this group represents. */ for (j = 0; j < ARRAY_SIZE(iqs7222_gpio_links); j++) gpio_setup[0] &= ~BIT(iqs7222_gpio_links[j]); @@ -2480,6 +2894,41 @@ static int iqs7222_report(struct iqs7222_private *iqs7222) iqs7222->sl_code[i][j], 0); } + for (i = 0; i < dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row; i++) { + u16 tpad_pos_x = le16_to_cpu(status[4]); + u16 tpad_pos_y = le16_to_cpu(status[5]); + u16 state = le16_to_cpu(status[6]); + + input_report_key(iqs7222->keypad, iqs7222->tp_code[0], + tpad_pos_x < U16_MAX); + + if (tpad_pos_x < U16_MAX) + touchscreen_report_pos(iqs7222->keypad, &iqs7222->prop, + tpad_pos_x, tpad_pos_y, false); + + if (!(le16_to_cpu(status[1]) & IQS7222_EVENT_MASK_TPAD)) + continue; + + /* + * Skip the press/release event, as it does not have separate + * status fields and is handled separately. + */ + for (j = 1; j < ARRAY_SIZE(iqs7222_tp_events); j++) { + u16 mask = iqs7222_tp_events[j].mask; + u16 val = iqs7222_tp_events[j].val; + + input_report_key(iqs7222->keypad, + iqs7222->tp_code[j], + (state & mask) == val); + } + + input_sync(iqs7222->keypad); + + for (j = 1; j < ARRAY_SIZE(iqs7222_tp_events); j++) + input_report_key(iqs7222->keypad, + iqs7222->tp_code[j], 0); + } + input_sync(iqs7222->keypad); return 0; @@ -2584,6 +3033,7 @@ static const struct of_device_id iqs7222_of_match[] = { { .compatible = "azoteq,iqs7222a" }, { .compatible = "azoteq,iqs7222b" }, { .compatible = "azoteq,iqs7222c" }, + { .compatible = "azoteq,iqs7222d" }, { } }; MODULE_DEVICE_TABLE(of, iqs7222_of_match); @@ -2598,5 +3048,5 @@ static struct i2c_driver iqs7222_i2c_driver = { module_i2c_driver(iqs7222_i2c_driver); MODULE_AUTHOR("Jeff LaBundy "); -MODULE_DESCRIPTION("Azoteq IQS7222A/B/C Capacitive Touch Controller"); +MODULE_DESCRIPTION("Azoteq IQS7222A/B/C/D Capacitive Touch Controller"); MODULE_LICENSE("GPL");