From patchwork Thu Sep 8 13:15:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970070 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 A2DDCC54EE9 for ; Thu, 8 Sep 2022 13:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232250AbiIHNRI (ORCPT ); Thu, 8 Sep 2022 09:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232274AbiIHNRC (ORCPT ); Thu, 8 Sep 2022 09:17:02 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB7F88E457; Thu, 8 Sep 2022 06:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=miRUG5O6FBhMLsXrujUtugK5J5noIQF4qM86S2svyqvGxVliUJDJZTgx2/aa3xqmTbWTacIRkpq5L+ZwOuBzAAV/MCbgGZQqHEfzSd5qf3cWAaUCU6HJ/RXXzbNguCeL/uFX1voBlNHc/CyiXDj0hjBIQKn3D3iNONdujpsFYt7fRBBnkhC7GVQ/q+1oWCKaOFOQ2XMSa+fL+YqhJXbnw56LsxxgA5EmQJWEqrD5jeiPDv5cP3+1rdztBrrXvchdF5TgBh5klELsqjrpNfjxSfMdWDTKOLQJf8hw3UvOFL+Ukr9W9Lisw3+UINKqRIh/hq1sq921GiOdruqKQ6U9BQ== 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=JU6w/DPRfqgcC4kWRlB1VDbXBJPUJ89t5LVFAuuOgiQ=; b=Eg3bbuggc6gqtimNJYJDtWYvBixLsKkDIdLGM89uEdn8GXL3cN4xAQFOYgL8ChkEgPqQJnGrqqYSWa1byv4u/uEeM7zbI/RYfg/HxqFfx7HAXfiCD0gb4roKyBTYCgGsLL9Hbse9g8cFK6Qtuk4NRcplj7UvqoVB4bY0bstZraM4Vj1bzA0MCpqlPOPQGI104b9q344JYZ+8Xh/Se4CnFN2nr7JowAqkaoBre6W7gk6M+GJzMNAvon0DBiUgFWMxztyTpxuzWEoOZ46NBGRicBj25/z251kHGhx+MI0DUwe0h4XpgfsgvGVJMfomcw6cZrCyHzuzWq/dkmdVNTsU/g== 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=JU6w/DPRfqgcC4kWRlB1VDbXBJPUJ89t5LVFAuuOgiQ=; b=zJJv2Oa+QpovR4nMzVC5G23ApkSUVCs5lsZLwDnOh0ilsTNt2AKNyCBeWvZ7O8JS6HdTjPdv0Ucnxw0U8Lb+Z2f3MP90KLL+DGD1KeeahL4e/3joFNQp10kFLzJwdbQMpGsf0EOnZ66CbSLYKd0TxuJVTPIIot+11sff4rowUeM= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:16:48 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:16:48 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 01/11] Input: iqs7222 - drop unused device node references Date: Thu, 8 Sep 2022 08:15:38 -0500 Message-Id: <20220908131548.48120-2-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b57f7379-1805-43fe-243e-08da919c6268 X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zJnzomfWsPQgwSmsbDXIlhS4pT906qWY1VHXcOH6OD/3rrRqxO91lJBpavTKQoZcev83hdt4fJHyOcKoNhoxYgiB6VxjsTgyNhVDPM93Mq61oHHp1YDpooe/+bRzzb17sS4voXQqSV9+IvULrUboKZH69g8OGq0IRh3KK3u6U8N6kOvhg6YOiqqZchleP2iv2jymJxXb4kVpt56ifWWiKUp7AhAqg54fdl9+9B6y0nnNjHhE/hAzH2QqYznhtZhOqOxHapka5caF7PAnHRVpEzcngKYGN9aljLwGqU3rXbSrNjdTa9EQ6GYG0/+kVNwiF4wXPYU3Rb6pEIjq6aNIMtowf2PqsQnVDwpglfdB7RyuTzrvs6DEfjTyQx3CSUdJ/AqvcbzOq4g2SoB2KxP+BrLp6Sc/Y7bdyDmo1ETw13TybRuWrBVd+QxgHlSPMazJw1fjt271v6GZB5jM3uTugt6mLtaGu+8IiuqGR7dIErSM6KN8LVVdf4nQI+Rpya5swKhLQaF/9OmT9Kq7LCQwLfOu+gj1d+ApDSFwfD1ch47d1RwtQhPfTWPDGUWofg2KcejY7C/7cnEwZMYeZW6GQ+oBfuvYIsGUsSDuofWKQstpAf3QA9LqIza6w5TOC44SV52PNbPboaDGhpNHDp+eZIQOVJkxJtWrMAmqN7mlkWlUrvFsMoE2/AiN8+hX6fxGo9+cVRkXh0JuECTC6O47Kz9RlL8X82uVYW5KBNjpiTesnm3jGxGZrvAQc3ndUPTE 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(30864003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Tq5Aim6Ei+Lmf9zTE4xDyNTDc6dEZgOMafaak6kEeusWo7jmg5+8O2D76kOGWNMP15Csu4IBfcsZGN9Ju6jOJz8z6ZoANxCqd1fco6QeWRR+vKW0ZSskAJMKV8/PUUnMCijMrv48T7uihbWZeX7ogbE3FpgMpQxwOD7qgcUxWFqqH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iAedw9QM7tEJtBMD6ASjLCimdPMEZPqqdJIkpqx7HIvWEcDA7JQyowPJJT0b4kZCIz9KfmtHuFz2WB00+qFXnQmSwXPJq8cAsQsvRbR4GPciSACoWmlcxYSnfW361qIw+WSNQC+CH9DeCLKcj+gVM55hNh0rCu6kYYkcUhmZRjZCWgUIqdTzgioijXN1gnc8AXsb5Bw6ly/uQY7uqY8OcGjWdVdEmSwHkk3YlZB0U/hr41vDAO3WCl7VYhsx5XMs+N7Q3K502F6qFGI+mkVg2A0hz6sSW0j7siF0+0gYH+jgqFrkfjhQYLb59YwmyWTdEhKMWZPQy6JjqNE+cfj4 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: b57f7379-1805-43fe-243e-08da919c6268 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:16:47.9358 (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: j/YtV4Mc/hZ/pzyijo1UmZl+1OfV4doY5zbe/29Qmes1VYDGVroLQBjZcMFcxTG5mwSZzgy533fLuGmlT2tU6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Each call to device/fwnode_get_named_child_node() must be matched with a call to fwnode_handle_put() once the corresponding node is no longer in use. This ensures a reference count remains balanced in the case of dynamic device tree support. Currently, the driver never calls fwnode_handle_put(). This patch adds the missing calls. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 134 ++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 43 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index b2e8097a2e6d..04c1050d845c 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1703,7 +1703,7 @@ static int iqs7222_parse_cycle(struct iqs7222_private *iqs7222, int cycle_index) IQS7222_REG_GRP_CYCLE, IQS7222_REG_KEY_NONE); if (error) - return error; + goto put_cycle_node; if (!cycle_node) return 0; @@ -1714,17 +1714,19 @@ static int iqs7222_parse_cycle(struct iqs7222_private *iqs7222, int cycle_index) * CTx pins (CTx0-8). */ if (!fwnode_property_present(cycle_node, "azoteq,tx-enable")) - return 0; + goto put_cycle_node; count = fwnode_property_count_u32(cycle_node, "azoteq,tx-enable"); if (count < 0) { dev_err(&client->dev, "Failed to count %s CTx pins: %d\n", fwnode_get_name(cycle_node), count); - return count; + error = count; + goto put_cycle_node; } else if (count > ARRAY_SIZE(pins)) { dev_err(&client->dev, "Invalid number of %s CTx pins\n", fwnode_get_name(cycle_node)); - return -EINVAL; + error = -EINVAL; + goto put_cycle_node; } error = fwnode_property_read_u32_array(cycle_node, "azoteq,tx-enable", @@ -1732,7 +1734,7 @@ static int iqs7222_parse_cycle(struct iqs7222_private *iqs7222, int cycle_index) if (error) { dev_err(&client->dev, "Failed to read %s CTx pins: %d\n", fwnode_get_name(cycle_node), error); - return error; + goto put_cycle_node; } cycle_setup[1] &= ~GENMASK(7 + ARRAY_SIZE(pins) - 1, 7); @@ -1741,13 +1743,17 @@ static int iqs7222_parse_cycle(struct iqs7222_private *iqs7222, int cycle_index) if (pins[i] > 8) { dev_err(&client->dev, "Invalid %s CTx pin: %u\n", fwnode_get_name(cycle_node), pins[i]); - return -EINVAL; + error = -EINVAL; + goto put_cycle_node; } cycle_setup[1] |= BIT(pins[i] + 7); } - return 0; +put_cycle_node: + fwnode_handle_put(cycle_node); + + return error; } static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) @@ -1766,7 +1772,7 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) IQS7222_REG_GRP_CHAN, IQS7222_REG_KEY_NONE); if (error) - return error; + goto put_chan_node; if (!chan_node) return 0; @@ -1793,14 +1799,15 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Failed to read %s reference channel: %d\n", fwnode_get_name(chan_node), error); - return error; + goto put_chan_node; } if (val >= ext_chan) { dev_err(&client->dev, "Invalid %s reference channel: %u\n", fwnode_get_name(chan_node), val); - return -EINVAL; + error = -EINVAL; + goto put_chan_node; } ref_setup = iqs7222->chan_setup[val]; @@ -1818,7 +1825,8 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Invalid %s reference weight: %u\n", fwnode_get_name(chan_node), val); - return -EINVAL; + error = -EINVAL; + goto put_chan_node; } chan_setup[5] = val; @@ -1851,12 +1859,14 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Failed to count %s CRx pins: %d\n", fwnode_get_name(chan_node), count); - return count; + error = count; + goto put_chan_node; } else if (count > ARRAY_SIZE(pins)) { dev_err(&client->dev, "Invalid number of %s CRx pins\n", fwnode_get_name(chan_node)); - return -EINVAL; + error = -EINVAL; + goto put_chan_node; } error = fwnode_property_read_u32_array(chan_node, @@ -1866,7 +1876,7 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Failed to read %s CRx pins: %d\n", fwnode_get_name(chan_node), error); - return error; + goto put_chan_node; } chan_setup[0] &= ~GENMASK(4 + ARRAY_SIZE(pins) - 1, 4); @@ -1878,7 +1888,8 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Invalid %s CRx pin: %u\n", fwnode_get_name(chan_node), pins[i]); - return -EINVAL; + error = -EINVAL; + goto put_chan_node; } chan_setup[0] |= BIT(pins[i] + 4 - min_crx); @@ -1897,14 +1908,18 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) error = iqs7222_parse_props(iqs7222, &event_node, chan_index, IQS7222_REG_GRP_BTN, iqs7222_kp_events[i].reg_key); - if (error) - return error; + if (error) { + fwnode_handle_put(event_node); + goto put_chan_node; + } error = iqs7222_gpio_select(iqs7222, event_node, BIT(chan_index), dev_desc->touch_link - (i ? 0 : 2)); - if (error) - return error; + if (error) { + fwnode_handle_put(event_node); + goto put_chan_node; + } if (!fwnode_property_read_u32(event_node, "azoteq,timeout-press-ms", @@ -1922,7 +1937,9 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Invalid %s press timeout: %u\n", fwnode_get_name(chan_node), val); - return -EINVAL; + error = -EINVAL; + fwnode_handle_put(event_node); + goto put_chan_node; } *setup &= ~(U8_MAX << i * 8); @@ -1934,7 +1951,8 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) if (error) { dev_err(&client->dev, "Failed to read %s code: %d\n", fwnode_get_name(chan_node), error); - return error; + fwnode_handle_put(event_node); + goto put_chan_node; } iqs7222->kp_code[chan_index][i] = val; @@ -1948,19 +1966,24 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) dev_err(&client->dev, "Failed to read %s input type: %d\n", fwnode_get_name(chan_node), error); - return error; + fwnode_handle_put(event_node); + goto put_chan_node; } if (val != EV_KEY && val != EV_SW) { dev_err(&client->dev, "Invalid %s input type: %u\n", fwnode_get_name(chan_node), val); - return -EINVAL; + error = -EINVAL; + fwnode_handle_put(event_node); + goto put_chan_node; } iqs7222->kp_type[chan_index][i] = val; } + fwnode_handle_put(event_node); + /* * Reference channels can opt out of event reporting by using * KEY_RESERVED in place of a true key or switch code. @@ -1983,9 +2006,14 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) * The following call handles a special pair of properties that apply * to a channel node, but reside within the button (event) group. */ - return iqs7222_parse_props(iqs7222, &chan_node, chan_index, - IQS7222_REG_GRP_BTN, - IQS7222_REG_KEY_DEBOUNCE); + error = iqs7222_parse_props(iqs7222, &chan_node, chan_index, + IQS7222_REG_GRP_BTN, + IQS7222_REG_KEY_DEBOUNCE); + +put_chan_node: + fwnode_handle_put(chan_node); + + return error; } static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) @@ -2004,7 +2032,7 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) IQS7222_REG_GRP_SLDR, IQS7222_REG_KEY_NONE); if (error) - return error; + goto put_sldr_node; if (!sldr_node) return 0; @@ -2018,11 +2046,13 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (count < 0) { dev_err(&client->dev, "Failed to count %s channels: %d\n", fwnode_get_name(sldr_node), count); - return count; + error = count; + goto put_sldr_node; } else if (count < 3 || count > ARRAY_SIZE(chan_sel)) { dev_err(&client->dev, "Invalid number of %s channels\n", fwnode_get_name(sldr_node)); - return -EINVAL; + error = -EINVAL; + goto put_sldr_node; } error = fwnode_property_read_u32_array(sldr_node, @@ -2031,7 +2061,7 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (error) { dev_err(&client->dev, "Failed to read %s channels: %d\n", fwnode_get_name(sldr_node), error); - return error; + goto put_sldr_node; } /* @@ -2052,7 +2082,8 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (chan_sel[i] >= ext_chan) { dev_err(&client->dev, "Invalid %s channel: %u\n", fwnode_get_name(sldr_node), chan_sel[i]); - return -EINVAL; + error = -EINVAL; + goto put_sldr_node; } /* @@ -2071,7 +2102,8 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (!val || val > dev_desc->sldr_res) { dev_err(&client->dev, "Invalid %s size: %u\n", fwnode_get_name(sldr_node), val); - return -EINVAL; + error = -EINVAL; + goto put_sldr_node; } if (reg_offset) { @@ -2087,7 +2119,8 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (val > (reg_offset ? U16_MAX : U8_MAX * 4)) { dev_err(&client->dev, "Invalid %s top speed: %u\n", fwnode_get_name(sldr_node), val); - return -EINVAL; + error = -EINVAL; + goto put_sldr_node; } if (reg_offset) { @@ -2142,8 +2175,10 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) reg_offset ? IQS7222_REG_KEY_RESERVED : iqs7222_sl_events[i].reg_key); - if (error) - return error; + if (error) { + fwnode_handle_put(event_node); + goto put_sldr_node; + } /* * The press/release event does not expose a direct GPIO link, @@ -2155,8 +2190,10 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) : sldr_setup[3 + reg_offset], i ? 1568 + sldr_index * 30 : sldr_setup[4 + reg_offset]); - if (error) - return error; + if (error) { + fwnode_handle_put(event_node); + goto put_sldr_node; + } if (!reg_offset) sldr_setup[9] |= iqs7222_sl_events[i].enable; @@ -2166,12 +2203,15 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (error) { dev_err(&client->dev, "Failed to read %s code: %d\n", fwnode_get_name(sldr_node), error); - return error; + fwnode_handle_put(event_node); + goto put_sldr_node; } iqs7222->sl_code[sldr_index][i] = val; input_set_capability(iqs7222->keypad, EV_KEY, val); + fwnode_handle_put(event_node); + if (!dev_desc->event_offset) continue; @@ -2192,11 +2232,16 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) * The following call handles a special pair of properties that shift * to make room for a wheel enable control in the case of IQS7222C. */ - return iqs7222_parse_props(iqs7222, &sldr_node, sldr_index, - IQS7222_REG_GRP_SLDR, - dev_desc->wheel_enable ? - IQS7222_REG_KEY_WHEEL : - IQS7222_REG_KEY_NO_WHEEL); + error = iqs7222_parse_props(iqs7222, &sldr_node, sldr_index, + IQS7222_REG_GRP_SLDR, + dev_desc->wheel_enable ? + IQS7222_REG_KEY_WHEEL : + IQS7222_REG_KEY_NO_WHEEL); + +put_sldr_node: + fwnode_handle_put(sldr_node); + + return error; } static int iqs7222_parse_all(struct iqs7222_private *iqs7222) @@ -2232,6 +2277,9 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222) error = iqs7222_parse_props(iqs7222, &gpio_node, i, IQS7222_REG_GRP_GPIO, IQS7222_REG_KEY_NONE); + if (gpio_node) + fwnode_handle_put(gpio_node); + if (error) return error; From patchwork Thu Sep 8 13:15:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970072 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 374E1C38145 for ; Thu, 8 Sep 2022 13:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232273AbiIHNRJ (ORCPT ); Thu, 8 Sep 2022 09:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbiIHNRE (ORCPT ); Thu, 8 Sep 2022 09:17:04 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CDB13C8EB; Thu, 8 Sep 2022 06:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZaXXEOI+CkjjWOnW8i5HoBF4yKUQeCOgbUW8eaxOSfJ8JW4O7AYB2tFzgUIHm2TLJXqm2soVqRhGSAYMCM4t0Obe9WzB5pxzOnvUGKCuyD1kN0DCnWOv+UQzmI6pZNCFa+dU9BtnDorRIo0iF0wgRXlJObj1Ya6dXHmS4gicK12fy3G6XgDFNPz97uuVPTsTPqLj36K0pdEO9FiziTD6CWBfOaUAKiqAo1pQiwhH8UT/+YF38d0d/oJf8DZeO91plLpceULltLsow0tkU40m9D89m4mhTJiHlazWCvJXd2g6+SprQXmTAuYTlGcFnQvrqvlLmRxqMHOQPYBdM1WB2Q== 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=1ed2l4rWwfiI9iaL0A34gfgXFbxkQWXn4apAChq/cHk=; b=U6OrGKHKDypBIWBbc1KxPvY/eDjwv8rrjn7zSSeVfmt6quBgf2YMgoYiD9v3ceShQhXzc19a1vjs5JuGtH2BmoKN6s2y4KdDKCrbMH5+7/tYkYdGm5z85JuSDW4Eup9Xg8tUg/qFpnfKj8nrqVE4XQ4i+uvsk+ptqHL8ZfCN9aqQ1Pm4rgZcdM6W4/BENVic0XbMKjiZhnyqgkR5CmKEKdmVj3VAtEGxR1oYDtSBlrUR5LgeI9f4rQcwgRg7qyQUvijaPOE1ZPvnKwoZF1Y4e7za+SjHLmVJy3sRRdiGrW153Mv8395vDSK41OxOdjTXJXO33dKBd3SIPwH+QVWPuw== 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=1ed2l4rWwfiI9iaL0A34gfgXFbxkQWXn4apAChq/cHk=; b=sO4qUEMEYm4rjVCy/VXs4XA9QFt+jD81DIUHfu4jXjBM2BD929VlNWob7a9mANdxVsHApA+D/Vtne3NBnmtrqJvgpfAOn/gK7KyYsvxrAenNvDo7h0sKImW+3BNYedEYQTy6WVZyXwsDJ4ySYfX7mP/ZYfCJF4Jf38qQhJD1d7Q= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:00 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:00 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 02/11] Input: iqs7222 - report malformed properties Date: Thu, 8 Sep 2022 08:15:39 -0500 Message-Id: <20220908131548.48120-3-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 096861da-0515-40c6-a4f1-08da919c69e9 X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PsBTz8hnvAoc0YN5fc714y5Irl8jjL5qeTybbDZPcCYBLNdgDY5rKbCE4aTXxrelrJMTgzhgM6ZRfDtEyVUlYyV4tO+CGyl/ckOlGu9b727RxPWRC/ubeMqrFpzXrVrBmiLCDwa9UJ6GatkPjx1JdWhznItkZ8ILb335UgRz7W6kv7Xx15xnK3mepDQLMHqy9jZjUmng6d3BJx482TksBp0VRQYD9dQs6Br97cL07xhIL7rjXPPw3GXoz5EtrwYU7m3JPHQYLrQashJmTXOP+pBRJS9h0x2INbQhWmrWsCTdqn84PIg4HAmb1WENH+rRfvHJ6UNNCursKfWj1d2nhPIWt3VZ5l5WRVwhH9K+/pk5EnTh0TyiDzx15Kixas67wA8+sJB3rGclD4x1PdHmW8OFHhOu5zwBOZdIu0dLZUlfyVh15dv2di6CuskB0xcLgfFMMzhtyRDJpLV3uczwzVIwz45lsPz5URly5A684as+k9o4MFep0NTpA0NAlnKRJaZDxA2TyjWKuKap4/02U3cjwYa3hkQQ3BiQMsezCZ9JmV+F//2jkHnZdNI00JTaF3+J00u7beHtBwz7q1RVI6y7NY+BKfWXSITMHOuP7rAJWWpmfji22L6cKIiFBX914BfZP2cJKx3SYmI1bJ6fQsdrtDA8Oo0dUY23IukSWqp9TSBh54Aoi3OICpWBM1TH36SPUqpRUg6hTLN4KFX7MLFKKo3t6chHiBxvRkOlpb9aO6I33ShNZbGUmybG2BMy/CqzD3/GigJL+xZR73IS0w== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP: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PuQczw4HEnAZxL1Ja6/onhjnQXzDuk2PfCEj2bdojrmb9VAsT5Bw5zl6viY83CoW7VJK9em/d+97vhGVK7hvUZizDa9gcu9IHqsP+P+VdOW0p5tsroydSBG52mjbeyBnoKYI1PX56Yu0x4u4fFwcCFE2Xk6BQqWWwIYtboL3P43ZqRrI6k6qc2IsgavAgP+efxnRXnHaAR/0SBTJyJWMdmweqg1wMDu4uDAPDYk+cK3GLmU7AP0wlPzBTQi0pAmSJdSOUtsR86GliInLMIBt6104AqzEgVX+Wgap82zScVK9tJuy6sCFV/iYWFtRYU82YR+ZWwwMGEtNnc7YOO7zOfmguOtrDTkHDGGRTAIV/UdFXXulVvzAEBwsqwTa+c6isi6lmGYpPvlw75KbiAqje/UVi0wiNlNQY8tcvbVUSs/U9qvkuedJR6Cc1wkMBraEzZdV5vptS4iKMzBriiSYPnxSfmGsLOEid7jEbvrTQhomO8akZ9E1L/0Y8NW34EL7qF73dJWB46IUUqrbCEBywE7WnphT8Ezll7TIwQqdISFJ+EP4d2kb35dwILArxPhf1Zmey/17koI X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 096861da-0515-40c6-a4f1-08da919c69e9 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:00.5285 (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: 0RSKBn5Pp8Tf7LXD7WThCj0vOMQJYS+dOc/AmqREjYQDedH/xxyrOSIj6Sr+gRbXi6kK0VyEQKak9x88ItGu2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Nonzero return values of several calls to fwnode_property_read_u32() are silenty ignored, leaving no way to know that the properties were not applied in the event of an error. To solve this problem, follow the design pattern used throughout the rest of the driver by first checking if the property is present, and then evaluating the return value of fwnode_property_read_u32(). Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 65 ++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 04c1050d845c..fdade24caa8a 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1819,8 +1819,17 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) chan_setup[0] |= IQS7222_CHAN_SETUP_0_REF_MODE_FOLLOW; chan_setup[4] = val * 42 + 1048; - if (!fwnode_property_read_u32(chan_node, "azoteq,ref-weight", - &val)) { + if (fwnode_property_present(chan_node, "azoteq,ref-weight")) { + error = fwnode_property_read_u32(chan_node, + "azoteq,ref-weight", + &val); + if (error) { + dev_err(&client->dev, + "Failed to read %s reference weight: %d\n", + fwnode_get_name(chan_node), error); + goto put_chan_node; + } + if (val > U16_MAX) { dev_err(&client->dev, "Invalid %s reference weight: %u\n", @@ -1921,9 +1930,8 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) goto put_chan_node; } - if (!fwnode_property_read_u32(event_node, - "azoteq,timeout-press-ms", - &val)) { + if (fwnode_property_present(event_node, + "azoteq,timeout-press-ms")) { /* * The IQS7222B employs a global pair of press timeout * registers as opposed to channel-specific registers. @@ -1933,6 +1941,17 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) &iqs7222->btn_setup[chan_index][2] : &sys_setup[9]; + error = fwnode_property_read_u32(event_node, + "azoteq,timeout-press-ms", + &val); + if (error) { + dev_err(&client->dev, + "Failed to read %s press timeout: %d\n", + fwnode_get_name(chan_node), error); + fwnode_handle_put(event_node); + goto put_chan_node; + } + if (val > U8_MAX * 500) { dev_err(&client->dev, "Invalid %s press timeout: %u\n", @@ -2098,7 +2117,15 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (fwnode_property_present(sldr_node, "azoteq,use-prox")) sldr_setup[4 + reg_offset] -= 2; - if (!fwnode_property_read_u32(sldr_node, "azoteq,slider-size", &val)) { + if (fwnode_property_present(sldr_node, "azoteq,slider-size")) { + error = fwnode_property_read_u32(sldr_node, + "azoteq,slider-size", &val); + if (error) { + dev_err(&client->dev, "Failed to read %s size: %d\n", + fwnode_get_name(sldr_node), error); + goto put_sldr_node; + } + if (!val || val > dev_desc->sldr_res) { dev_err(&client->dev, "Invalid %s size: %u\n", fwnode_get_name(sldr_node), val); @@ -2115,7 +2142,16 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) } } - if (!fwnode_property_read_u32(sldr_node, "azoteq,top-speed", &val)) { + if (fwnode_property_present(sldr_node, "azoteq,top-speed")) { + error = fwnode_property_read_u32(sldr_node, + "azoteq,top-speed", &val); + if (error) { + dev_err(&client->dev, + "Failed to read %s top speed: %d\n", + fwnode_get_name(sldr_node), error); + goto put_sldr_node; + } + if (val > (reg_offset ? U16_MAX : U8_MAX * 4)) { dev_err(&client->dev, "Invalid %s top speed: %u\n", fwnode_get_name(sldr_node), val); @@ -2131,10 +2167,19 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) } } - if (!fwnode_property_read_u32(sldr_node, "linux,axis", &val)) { - u16 sldr_max = sldr_setup[3] - 1; + if (fwnode_property_present(sldr_node, "linux,axis")) { + u16 sldr_max; + + error = fwnode_property_read_u32(sldr_node, "linux,axis", &val); + if (error) { + dev_err(&client->dev, "Failed to read %s axis: %d\n", + fwnode_get_name(sldr_node), error); + goto put_sldr_node; + } - if (!reg_offset) { + if (reg_offset) { + sldr_max = sldr_setup[3] - 1; + } else { sldr_max = sldr_setup[2]; sldr_max &= IQS7222_SLDR_SETUP_2_RES_MASK; From patchwork Thu Sep 8 13:15:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970071 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 03DE1C6FA8B for ; Thu, 8 Sep 2022 13:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232300AbiIHNRK (ORCPT ); Thu, 8 Sep 2022 09:17:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232305AbiIHNRG (ORCPT ); Thu, 8 Sep 2022 09:17:06 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9711652FD4; Thu, 8 Sep 2022 06:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IHwl+4E/o5WY2MckqpnmpfMbDPv3drkmNdlclIWcpj4czaQoegnZpm7DtYHJaV+bWunirJ742riTQ5MZExso7/1TY7bmWrTOtcNYyFeNRi0k+koE6H/RSK92yU6ohBLYkZPEnT/T23SBycqx44u2+/SiU++e+N/tFqJx+FS8j4BHnDm2Zy6AovLyRs7t1uhzt8gr8ge2Idea5P6J4OpMdv6h6lU0Qtx+bzxQBruCj7tgV2mFfMJucmccbne9VxQgHIyY6VlNye8dBfbT/K1IoXhGapEmySkIwbf1/7qWUEC34muZUSv7j58lUIu1/uRuGDrgHCmL86ktnBGxFjuUjw== 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=IQsUBvVvcVVrngGyh3Ie+QUgf6DrZBZZDVfOfexOXxU=; b=AvAxPoyqz7Fde+hYNDyEdVB55gxMIH5w4hX0vi4ywr2oMZVzrfGqd/+f2nn7GxxqfuCYtT6cK78+bkmCV2qNMCpT1m+mEiFVMd2a/s5bOKl2g5hjkwOC2QwVhzpq4uudw7P8aTI7fQmWLH1f4jAvf0Prl1t+jiTWdkyjQ0AU8VIYIUbbNfYG3ErU4c16MJ2LyPZj7BBD8erLyo2d1b4IzrJwjm3SfaulxfMgnvbT5Fmhp2axUBK6rOi0x67/iN1on24KORJ5c0JqWSOeJ4biKE9a72gveQ0Tx3c4B/e+VKuYU9oAar121cWI3ooqE1JE6s5nqvfGARkjE9QfeI543g== 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=IQsUBvVvcVVrngGyh3Ie+QUgf6DrZBZZDVfOfexOXxU=; b=VPgK4Xtuj7HjubzYHserPh+AToVQaW1BMfco2l0NXBaryM6Z3488kvuuKJlv/DhEEIqkIAwzsp1ueRLdTO1R0kAYffGY7wp+WLB4qUTa5XvzNLHdZY3RxI2P7VYHcT7AWoBOy7Na/LWTR829zbQshII2X2ZqIRxuc+R6HVg6puc= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:04 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:04 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 03/11] dt-bindings: input: iqs7222: Correct minimum slider size Date: Thu, 8 Sep 2022 08:15:40 -0500 Message-Id: <20220908131548.48120-4-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 71912bf7-3360-4735-bb6c-08da919c6c12 X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kMzpXzEe5hbk0WClpOCS0584cMUWBo6jeAj6NukqyChCP57r+msHWlMM3qP/Dy8Ney50U1doYJS1Dl2e69gcmdUBwQTuEc2ZuRIYAQG8PvK0LFgOxP2pfadygPJY4oTOwSzKYL+aMULEGDFn85zQ/ARAbcVXnNALj5rAAmaKcchXkxIdOzGcE5lXUqcvsxQs8M5SOWfzjAdBIeIcvBM1apqcYGUmQyAVuHbo7sqnFTLDTkOI/vpUhEtdYM+NsBwg4OKe1eFs/oq1a/4qsHC2KCGwwpEBu8wuA05ttAPo5Qt6LKiFZ/rQOSkfjaj6mU45bL7jf3OM1hFIHs8RuYct9tYHrD1rBRzR2uJWiki3R/h+LfgiFpmFD1vCBbRk4j49t1QC0k8vBex/A65OuVOiLCbFSe/lREfbdRo7fMq+iGRNkQNEcTzVoyvxYdcHRgf5EhZ3HRmJppZBdWAPPh5gdRRBN+YiX1fYCsdjKfgC3V1cHFqpzMz1dT8ReN1+r1wlw4VF/2rUEKoRTilNbc6pzLZuP2oiiMqLLjrGezxVRlfzvIcgzrkeTgvvvfQQKgxdz2jW/CdV7uyg13/nTnTw9A2hRWAt6ActkB8+xktGHTb3pHAm4TU6HI3AM+pV+HWaU/+Ya6oeGprzjsUsa7ZCuQgl8zgUapvtgT0AkOvyvQBR4BUkdL4zwKQSfAn+4rPD+nlatYkeu9aP4L7XMJt7ZHB6Hy4qB5TXJe/SEXkIdCuyGTflQd88eJlz/KVvriHC2Tl2kDLx8/ctnbUlfqZoVw== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cpelpPHr8HWFnlKTEyKK/0+Z/cWIP40qRnetoTgaxGgh4NV+MFnjya/EDIq4lZ7ldBPRJmwG7kE2nYAUXUajEdUm79K7Y08ZWXmuXQG88PhqwJX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DwaadGQ2yFWH4d97Z3NA1RKiDuYLO5wBqEVe/LLfPZWDrSRl6Is2nNAu2YFDXBXPw4/vOPaDywSEbJYUHct1QzCvMFFQpIHpZFXM7/URXC/OOjKIzcqghR64umw80kKCfaj/56ctJPBiWKBJe60+SduQlIeYi/7zGRw9muoDbrYolCORf9G/2c8v8KEbVWl84JAARlLunkbNv8lGqVJeIiites8jGjKUVAWzDbdmwgXSa7eOnO5FFmuyWiqV6FJqAXOJJRNw76lH7FKKNMt4l0nv2s1hap8g3zdQhpc9Esryl+/mzf8cp5IJuAPaxg+FSlz+Rj+qbu+FVgQEEFApbrI9H1pLbixdYCdone845k11YHBCO9UmQbGc9UsyurIl46NUuHjnHdX5cWcHT94aKZ X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71912bf7-3360-4735-bb6c-08da919c6c12 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:04.2157 (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: yZKaAV95YNxC0VeQz+LacJSrdffxXOC6ORwFEs6ZRgYygEPO7kxfT4tDAvMKoIP+pHulXf7O8oVgJ+5BJFsGYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The minimum slider size enforced by the driver is 1 or 16 for the IQS7222C or IQS7222A, respectively. Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy Acked-by: Rob Herring --- Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml index 02e605fac408..785fb9e83354 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -501,7 +501,7 @@ patternProperties: azoteq,slider-size: $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 + minimum: 1 maximum: 65535 description: Specifies the slider's one-dimensional resolution, equal to the @@ -693,6 +693,7 @@ allOf: properties: azoteq,slider-size: multipleOf: 16 + minimum: 16 maximum: 4080 azoteq,top-speed: From patchwork Thu Sep 8 13:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970073 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 874D1C6FA82 for ; Thu, 8 Sep 2022 13:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232301AbiIHNRM (ORCPT ); Thu, 8 Sep 2022 09:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbiIHNRK (ORCPT ); Thu, 8 Sep 2022 09:17:10 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054012126E; Thu, 8 Sep 2022 06:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IBpJo57GYKKTkmIC+PCFNNw6jZo/qtd0U8kdd1JwUJg2LpIOLxzd6UqbRqMmNLqJGX9vu9GF8i7Pzr2JymkXla/56OTJA0QKVYtz3eF/svu15UkNlDif/4PUzjX/2gkm6t61NO+VqP/ifjOXeZk4+aj0ncUFgNlb09E4Soqx/AhmFXpbBqrpZkqTLrWrkiZMfYyQjjWW96hXAIJouKm+HU7lFpJ+1ThDrYr6FvWUUcipAUzNdhM5pHc5byN9JWtoQpYUzwULMA2TGIe5+DA/IMdQgElh6ULfJKxsV3d+glerlcwrN5+AnDhHJykGON7+SXy0f7LRELQsGdzE1enqJw== 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=o06lXd8oiSUaqnjscTK1Wqdjq8etxgYs1dUKWdlwYZc=; b=Pb2Ev4DZ04NlA+ZraqlMCSsa1EzILq4dKxICEeCrmo7xy2QEoGrupTGqe98+7gfH1lRwt7FaN73w1j6Tky7El9VbssYfYE8Qk+8a0V/i93VnEfTPW6ONuMUTJyTwhuHUmHiFuTBUMfg0GX0SPGlQC8zcypUAXYKyWfVhJrYv+ea/VOlzqeZ8t8bInGIG+1jyEe00fx0oY3kgoWrzOYDdifrOanBGrWKSidIwUbZ7brXRAUCNQGR3A6Iqxb4IxzDNd1LmAU/L1GPCBA4FjsbfKdTSWW+6KtzjQMayKgheD0VLoWXrk4QaRGmVoBxX5d/ndpFpFgbA7I+riHJETTe+zQ== 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=o06lXd8oiSUaqnjscTK1Wqdjq8etxgYs1dUKWdlwYZc=; b=lDDQeosEYUb94Ly8znVj06w/T1MMj5jRI5nbmJ/trC4HxEh78phwmgSvf5zEI4lYxzSiQrntvr1SB8cKuExkd2fMf9P8SrWpzuwrEbi5fE7qlwQXC8YD5QSg8ipomLKyvqIW9Rg1MgxRPGJ8/wFpDcTps5226llHudpnSoomXRA= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:07 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:07 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 04/11] Input: iqs7222 - protect against undefined slider size Date: Thu, 8 Sep 2022 08:15:41 -0500 Message-Id: <20220908131548.48120-5-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2c8ff89-6e9f-464a-71b0-08da919c6e1a X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DZzF31c9zmNtTM43Ih8wSvab3nTIVqzIqRD3YElm8q7VYg0mh42mzZgKVpxYXruSmK8xdegza4l6J7F9/lC9w/VvClQzi0FYF0qevXeurYJHDHQ4tXkonJoaLcURGiuO1VmTCtdcyWdfLAU0cq4Dp5YnmRw00VIxkUCIbPR1hYalpZ/sSerJsn3iByOllxw8eoWR8sGjPWGsHNXB/zMGtrlvLK0IPGF/4PNs4K7b49JI0O1ao65Pnqz9Bp3yFrmBa1lPd+9O814gCxr/Usp7Ai0/aKvbcTWaNEn5XsL5ghYb3dyD3Ud9hGknWc+/Myje3+ldXnWax3n37UBGW3HD174yV/Q20cLgwWe6+TP2+TKFM0ZKKHGPx8MXM6pSc7ldGUzJvEgm+xQcS24MBbIfHkPR6awpblUAW3jQ7DXGgQNQgsnRm40Qw25D59Mrm5f8JHcDs0lybZlvyUGlyyLEQnG7oT0aqI/B07gcwMFvARlARCsXSGbVmzsOltmNP+dhVptBwAd2gr/cqxvBuHLHq9DQIAD5CInB5hG+QCCb3moGlkhwU7f5l0ZLe0HhAjJZjeaD516J7nlC9kD/Fd901oiH7kH0jHORr7hg1ZvsIAJpqK6VL4tNiR29EKJd0aGVUFrtCeBPEz7EPc7+4wQBkKBEowogC8tgeFO7LedS0xd7HI7DhsqGN8ASzNH7NgrlGmnzNmDSwSyYLc6nOJL2x2cbqnVVoorJoBvorNgxvcRluICUPtEj4OdIdEXqmvx2jH0bqo5KcXZVCAOc+1GXNA== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JyO0PlUmHJXwWTSt3q+loIYXT8za++103VV0rW0aCCW/69xtNQdaKnh0GOvnpBT8S6sIuBZNDLp5FzZ+ozb8617MJ3h6fPmU27sOF43GqPmQP6LMel0r8YQZ71MycbaBcMu9YB6kDH/wxM+o5na0oFEPTMSufizzMqdM9J8HWCAYDR45KN0Qx63mas2suAhDDO0L0V3tEVg0hHbD1E39Gt9WrYOpOOQS1VSC44+Oo8nC5CRpvspyMLgrgm6BnSkeAUytwkldklLgVfRVj/Rms3LvMY0nHYo3dQCZ1jH/vqiOOcPZTs+u/6pgrVhKszw2KmD05Z15pEuW7sNnj6gNXuBi2Rg87MnDR4iiS/+9OZRrMmmcSS81VUUR6QTSVisdWu3eYPYGZJ+hFe9t1c4/lxrb141QmuyciRz8PS74nolgoaulZdG4y2tBfErCAGXxEfhmaZtb3A5GqU40Aa7Aqx6dlL8Vplik4jlHru7yYqxMGAp4Fzue7ylwawC9+SdZ7Ao+69LENy37Mtot4c9VszbOT8deQNhomGZ28upeVX/xc/lxyo6dr8Hf6uZuPsvEe26W+urlmW7zapEiszlsV9NwAtRSV6+/83Cit5K4740hOXVPE8iGKU3bgasjlCXvATCHQCp9/wa0r1zh7aqQI+TN0bf19q4IkWK0sc4Ue7zhQzay3HFXq6k92Y7CcHCfy51k5ZrtD0QqVBS9UGDs7/RHY15bqDb68iqeCzMLCCmcdcswmv4mF0pundUxAr02J6aa4pUMtr7dHjKskmzsDm5lSrt7s2T6uACIsHZn81q5fnErl9l4/CMKi+OMpmWNHIlcUFa2ek5R8Gg7viP4ErAk1Aaw6NmUJSt4monsBu5yzy14LuqFteJ+6wkjX3x8V4uVvf72ObQYrALWj4o4cMnVaVUXgfVHZ7kpfKiYtsXuutr+hcw8BwexWi2GYS9hHWCREUxGOG9hCnbxcz2FQ5Euwn+l5M28ZTLfKH+DOwRTl0IXBd+8FhTo37L2PzN7eaZzfNEvl4uIPyX5OUD7OiqfSMqRtW9iHRmqcLvv2Tmd36LjrqJkb/g0chbaRPZGhSt8koqkyCIPHr5mh1CK8f+t83mv4loWdJS6iUvSV3+ITlcnknOSnsoD57/Nmd1dmdohyRDZIWA8tpxRThH+7fnmxGW5vrQHizulfZi0ic8mM7uQK7anctJML6IEJZOYKpUR3MUeeWNpe0VjlhN6lwLabFn4U46TLgms2nfu0JEp2iSyrQpmYX2UJMGEg01vaSXGuP28h7CJI5dt41zvROa8D6LTlJNTG3G6bdjODZNOm4l3xroEgLBhJzFMBslJs5ftuZL8hmDYYsHKmtML30GvJrDtjVhVZR6LD1sBzPdFC5M2l5vE3hWWQCYqZdiYNETUnMcN5UwQK36MFJdugwjuxJ9SgPsgE+gHorib6D3WdD97p8HEXUxr84xzQwG3ATi3u4A6BCMXEZEWxrWNqA1ujLiyLJcCJphgmjupHAsyLGrUI6Cyrl0Xjxtc/q28QsBQkluWH+NzoxGXRvUpSBi4D2T5ZgdlSwA47G6Nfwx6m+C2f0C6ILS/oB6mRwUL X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2c8ff89-6e9f-464a-71b0-08da919c6e1a X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:07.5748 (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: 6dYp69cFBSEwnxpXOELW1hJXuncDUeVt0YeuVJO60zsezxCp0VOsj2YWKiAvhA/dAzfSVlWBmJZBhvamm+4oXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Select variants of silicon do not define a default slider size, in which case the size must be specified in the device tree. If it is not, the axis's maximum value is reported as 65535 due to unsigned integer overflow. To solve this problem, move the existing zero-check outside of the conditional block that checks whether the property is present. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index fdade24caa8a..ba12c49e972c 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -2126,7 +2126,7 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) goto put_sldr_node; } - if (!val || val > dev_desc->sldr_res) { + if (val > dev_desc->sldr_res) { dev_err(&client->dev, "Invalid %s size: %u\n", fwnode_get_name(sldr_node), val); error = -EINVAL; @@ -2142,6 +2142,14 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) } } + if (!(reg_offset ? sldr_setup[3] + : sldr_setup[2] & IQS7222_SLDR_SETUP_2_RES_MASK)) { + dev_err(&client->dev, "Undefined %s size\n", + fwnode_get_name(sldr_node)); + error = -EINVAL; + goto put_sldr_node; + } + if (fwnode_property_present(sldr_node, "azoteq,top-speed")) { error = fwnode_property_read_u32(sldr_node, "azoteq,top-speed", &val); From patchwork Thu Sep 8 13:15:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970074 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 B1C6EC6FA82 for ; Thu, 8 Sep 2022 13:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232312AbiIHNRP (ORCPT ); Thu, 8 Sep 2022 09:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbiIHNRO (ORCPT ); Thu, 8 Sep 2022 09:17:14 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2051.outbound.protection.outlook.com [40.107.223.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85C7D2F644; Thu, 8 Sep 2022 06:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ha6Zz7/ueZmtL0k5D7GJmYkKuIw51AVXfF9dAiZtGfR2YYs6yPpsUAquHbK/+srtNIgW4Sp1ZFwEdA6xuqv3Ka2VglwaUgHojk+cpxdyJ9wbHxT06TLcki2tDUb5vwvPRUO1SY/dQBh3BuyDl4VW4zZDJRCSA6BkUTPQJirkjGrbPjgxKdbwQ1UPHEq26g+x0eGIhydu30lVbvXdYS/Oiqr0Nwq6RB/Tj7ZIOLUmWcT/nvJd557momn42LJP9p1AaVZAhZJCrgvi+2aGTGvBBpOHLdMh+2AZ/wdKKNKFqcIxSer2FV5yZ7dcknpaijH2PgOmsQJsU9sJFSJgj2EcfQ== 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=TIMvIZD7FKC2tdBRYHWyF7bydlAFIVDiV3vJjLXfl/s=; b=XWk8BGm3DN5b2dc/Zd8quaYjwR5L2wjd0H7JswMSZ19HZD/s0SkSJFqX99+BA2+qKhl9Zfkipw53dkkEUQV7o3Go50SmOWA4b2Y694yEGvTsdP/q5eyB6GB6hVQHEa0OTzD+I1tegcfYkQZTB0aKkpJ6+PXlce9btFeixuabJv4I0kgf9bnZvGmAAO6iUEPoiPhp4aF+uiOZSBvQ70fibyaRzN7u0An5CJaMGSpXA38wc0QSGC9/Z8mx7hWyWdMvxLWnVPVD2amkpzFapAvK7Hjney/r6ilKqrSg5bn67Q2qWj9HmNm+x6bq2LBMutk+qAMYTnqGP2eHnz3MonTSQg== 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=TIMvIZD7FKC2tdBRYHWyF7bydlAFIVDiV3vJjLXfl/s=; b=Zv7lMwNujcOWyL6gVpag74WDG12BzuciVXBmbpZSwsTuMG+r2329dXdwIK7vtL++8t4otfFvfcG9ZRqZB066NCZDJ5ZT+Ilerkr7oPPTYpxJtNgwgtPhe/Pkc1zHkEYmednBYfkDqbNmqUXRaLmt4nNLKo0nNh4GHoi0+wPKH0U= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:11 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:11 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 05/11] Input: iqs7222 - trim force communication command Date: Thu, 8 Sep 2022 08:15:42 -0500 Message-Id: <20220908131548.48120-6-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 958a3efa-e55b-4243-c35e-08da919c703e X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /5QzJk/s1p0HVPmHMoU8TDs1LbNkByor2r4z6poOHm3og0vV9kVZZVD5TTnbgyipHGp10rfE5LkehN43MnKLDc36qakCNm0L98JZ6yegr8KC91+DRQ2DL3mN3Pxl2o8PYrd76Ev6s3C8VdAb5UV5ij1r7FvGTXTc0BNIJPe/mjKZJ42dAvnBwlcV7izkprm32FvQRvcA0DYOVulySKRN1nJ96xTUlTiQUbmgDB7MePEFnCYzRhdu5LaGf32S+td6yl0rZ2EgHr9CsyAbL2sxvnYR2A52Ms6FgQKe98kG5V4n5LwAdkJ+K3lQaF6vRhVvcO9wxAAVI9necarnSlQyn42QnhbL4ZbMh2IGUZ0HST6hpY9I36HG8YgT90d9ZVZdg9unEiqfwJCR8KG23sJqguXTIMju2geeYQfKegfxcw0rM8FKkr7y9p3baqt282S89iB0pm2UkCjLzKhs6pJ/9X+BHKEk+9q/HbD1BMVHuRL5pfEGWo+/OTXriB790KlnL69Icr2hv0gkxY6AL6kEHkU6K9qEIvI8BE8z4zkM5x3EJxj+DTM7qrlfW6sD2pENk3itvz5T8vrxpHm1Gi5zYXprW08aIuIuySplPuf3pEPALdnPnCmPIXpr+R7muDzjHIOWFAvGfo+q2tXIk4LKNlFQ2JDW6sO3Tb0fTeHLvGCV6y2z15Xxm8iw28yKz//NfsSCyK01WIZx4pC7jIjUxV5vTaKUByVThkfwXJaqgdFssvcLPqi1kMbMDJ00xEiCrvT/tK9lGh5i0aJ0CnK8jw== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(4744005)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 22f9ni7pI7NYkgQqy/UrTFyvwwWZj0X/FwAeQk3bHMLT7vhYHKHWQrcuw/ZYE0RsiGPFNN+rnz19AOM7VsMqotD8pLCxXCI6wCKHN+B/OasEMv/IdICDYmu3SiDpfHvUmRzVBp2yHKhZiTOTv8CsrYY1E4PNg1l0s6hychJ1oRV1O15gEobZSKyRzsX79Gdh5zpHRmWcjIpVx/ycRbMShGEommdm2YDV4IC7T+ht94qgpb51/JJY8r9VWwT/wczQKUylRYVjXpfjB/ip1KPpCG1EkWay3PT423eD4Dg9A5HXL/Z8L+P0SWl14XE69T+I9TEeefoiX0Gxi/OCyi0+FJj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1PPiuVSywvOeBkpoq5Icj24u0UC4XUiRvLzkY+wjXb2a1gydwhNnNrrNjPfzqIUPh8V56VHshD/Kbjix/mMf0phQFbfUjUrcCMYv2b++eRpAaFH4sZMhx8aYF7nlDggNEh9421vVRQcNOOQMzbxR8DNHc X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 958a3efa-e55b-4243-c35e-08da919c703e X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:11.2152 (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: BmcM25GlqN2hYTKVg5go6jl4JOZYMgmy5e4WunxhTdluRytUdrEvzMfRGoubqfDmxuYWwC8cHr8zVSgrh1VzRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org According to the datasheets, writing only 0xFF is sufficient to elicit a communication window. Remove the superfluous 0x00 from the force communication command. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index ba12c49e972c..365e59f78f1a 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1077,7 +1077,7 @@ static int iqs7222_hard_reset(struct iqs7222_private *iqs7222) static int iqs7222_force_comms(struct iqs7222_private *iqs7222) { - u8 msg_buf[] = { 0xFF, 0x00, }; + u8 msg_buf[] = { 0xFF, }; int ret; /* From patchwork Thu Sep 8 13:15:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970083 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 0BFDDC6FA82 for ; Thu, 8 Sep 2022 13:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232338AbiIHNRU (ORCPT ); Thu, 8 Sep 2022 09:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232334AbiIHNRS (ORCPT ); Thu, 8 Sep 2022 09:17:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC8A543F3; Thu, 8 Sep 2022 06:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jszct8JXW9hRz6r3XfvIVOOgNzLi5/VqszIGIluD8ax0eLwt6PFh8eA0VkGPZT/YcXlzqDmNAI7PjoPmy3f2fyOqv55LEFxFWBucX1p9NwRE8m5XY/HKSO8zpmPKpjrWGcfXg4YIberIH5lMEBL6Z/KrNSCmsGSpozR9KKEVKZJiiJTXACweirtT5BC7PixM+GxO3dKC/mrVpV2Rn/DeVBAtjAgHWdPpnYgxURkqglemTZO6v3bmYEOYDstJ+f0CP9Uurd3vEpjkVhPR9viIBBPLI5CnyBnlRn3ciq2tJWtGGMwuUFtZpmKtnDA9xyl0opNVaYgikenzQWmwd0bGYQ== 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=Ng9dyBT2VZrfGrq/+cUQ4J1kQUoaP0TBt4gmjx1F6BM=; b=YzXygjHnt+v04dMHQnAX86l6bikuXsYmV/Is9WPqXm5dPnggCjPeADJ0xQAUGHUU/iy0j+Vxsiu8mUkw/3x4EaszsNkXd79+J1GNBn5G/VZDxLwUSCbK/gEF3EfWumFi1Gj/8dPj419sC1eCNsA4ydX/C3ZU2wNbeXA55Pc22LfIskA8qV3rUmSnJ6dYUmHKYW2+YdETddhE8r/GJakFBsz+65A0NQQWIaAxJMbtFFUrvospIijXoyRVaA12ZvDiyh1H4SqedqonuG9joRjlhqbG+FgvGG/4GII09A9Y8o9Qy/bqBN8E/5uQ0lXbA8e3XQu6hiJdatVKIqLUQfXeyg== 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=Ng9dyBT2VZrfGrq/+cUQ4J1kQUoaP0TBt4gmjx1F6BM=; b=rJFdsYronBZZjKHRJDsejO5zRZdHb9NbnHKhmYSXTDiqNResSubRVjEx/c794Hpn+7RbpZhx6RKjZW3K9ltXdAqIAOka4VVWm4ecoGuGrCF62iuQI66TsC7qApQ7e10pmJvdBvssh5EvS93jLbcCE2B7zGzXFj3bILzh9q3x60k= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:15 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:15 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 06/11] Input: iqs7222 - avoid sending empty SYN_REPORT events Date: Thu, 8 Sep 2022 08:15:43 -0500 Message-Id: <20220908131548.48120-7-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7825e40-ddc5-4979-1f72-08da919c72f2 X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fbC3DOY7WtAzQRgL7HryyZUeAyCbyrZgLRwt6nu9ZPyTnqWw4C3qGAN9KZM6WpvnVe8ghYKo+rMToJjDrS1AgGq+ShpwP7YkrYFMLuKfldy93RE9+lUL0rhMe0K3/iU+s3XK4OhQRaiMj/j0WfbOo+qKTmkuiTcNhvpzIHlAAhhjbumDN+mxJYsVwgF1k+wAYlV9JOdrokN+No7NnFzxCl5zVZl/oQWlIgkGtT3/P3tlXvRjKbOw6f60IIRAClTnnZUmx+lum5qpa6o7xkWrNeYXUfU23QhnaRDrNCnkRzsoVPLbt0DUT0FTJF6/1ThKYmccUWud1RNyximWKSBOvr5Q406CB5YU7k+fb29ypawRnqj+lUveFESYAtK1TEmDkrYjroD1EkSlkhUMeV+Y6j94Qk5s2o1tAVVU4PzEjYQXv7KL5jROgiqrbOTmJp/hwpOfMG3TcZoIOfWL9eSliIXP/U9yAGlcnCxoYXei/fyXYHYQt80CLHIDIVoeFD5Y2iP1ShE8NDkQpzw591kGhT3ceB6NcELdQ8q6orK5nFLdxT055DQos7yCN+7LKQVrlisD5D3jw/0RHNtamYl4t6kU73bXlWacAMp9eWkwQjEV4oI5vixuuqCJQeDFItQCXG8YSSUiiqjcdnj2plVlPWt4xjxKRAvwqUmqN59r6MAg8SQ1Uhnu29dyEJaexeBQuL3yahiCXtaFEjJD544X5eLmSjzagC7HeadgCqn9XPc/wN6p/Pfx9F8IBjuVEEjonI85DbcYScbMG3bbM+t4Eg== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(4744005)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JoAumco5+MofK/WYu3hBxSvLIbc0WhASddZK9FnqQNrpiwiSUR89t454B5RgjfDPf4ofKse9TamwkE4nFa2KGIQpfb9CCX5IsLEtb5n/lOxJdutTU+HmfJE2xBBnWBLizdrQWg/DuAi1CwhRmZuiv+6XxPUICskujCBbK3Jgm/PHrINHQsKeL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/yzzz5o54dwbRPnSGMSGoqtNv/TZQLvVYuk81S7HSaNLc4B7KbUjuxjC/RUYwmXdp4kXenrkjPi2LvKZpJGrq93UpXsLVM8bnqOk1/PuC/BVc0AWfrLrxzvqz3Jes+MRy46AXz3qnTMzM/uJb3kx5LdmHCCXMgUojcE6QTKVDqdvLIHc4sFKx6he5tfRublxOMXUO8D3a3MQQ8OjevvGT9jnbF9W73KLZwUN9bEDuy+tFarX2jlSFbr8PjRZ1FYhwtYneX2eD2Hj72JTZmZIqzJH+FfNk8CB3OrFCD1doa3lkxO1lgSrQYz7FHthyLBAWNN9mMW4+clbls8lgXJ94 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7825e40-ddc5-4979-1f72-08da919c72f2 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:15.7461 (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: Hiz3JcGmtrqIE2+B3KhDqDTHX63SyzHvfwx1o6Z4aEHdYC8CJ7S/cGtHaQqV8uVNfI+EiTRpZtt+1C4bIZn1ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add a check to prevent sending undefined events, which ultimately map to SYN_REPORT. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 365e59f78f1a..00c73a920ab2 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -2427,6 +2427,9 @@ static int iqs7222_report(struct iqs7222_private *iqs7222) int k = 2 + j * (num_chan > 16 ? 2 : 1); u16 state = le16_to_cpu(status[k + i / 16]); + if (!iqs7222->kp_type[i][j]) + continue; + input_event(iqs7222->keypad, iqs7222->kp_type[i][j], iqs7222->kp_code[i][j], From patchwork Thu Sep 8 13:15:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970084 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 6FDB0C54EE9 for ; Thu, 8 Sep 2022 13:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232330AbiIHNR0 (ORCPT ); Thu, 8 Sep 2022 09:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbiIHNRX (ORCPT ); Thu, 8 Sep 2022 09:17:23 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2083.outbound.protection.outlook.com [40.107.244.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 928338307E; Thu, 8 Sep 2022 06:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/hWUX8sdNz+Z8o1CQ60P6hhJaz5Ji8iujE5yL1+W2d411UTEzRkfZ3yfpo2gTYHovndNkpOd57ayOgVJ/TMwCmeIhPbsxmKsjmDiQfoNVg/qZlULmostcCZpvy6iubB/F5pO1b2dqJRt4fBLcny4Jx0xea0BCrWnXXuDSnLSgVP28+L1ONF78qy1iUPYpsBr1uDI5PSPccGZ1cTZ1tUFdElyhly96RRmAWvpFoHtkOJpTsH6Jf4JA1AGI/b2LS03TTxv8n0P1qiueMhRcSJ45KAIHwJ3iwNTbY+GtYDHZbR2HbRYTsqFE0GTDdgPwmMqH8lyW3tDoaxO/h4aNyF3Q== 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=Y7ZmgEroWRBoqzBKBPBXo0rXHrQOa5zwapyrt7KKPyU=; b=W38t2/JninNHpygv85pQAJ6V35Ln8cUJCdig4QYf3a4Nltb/+0MpKJghluAEuPQXXUOq8ZwT5SQOCuLA/WNCkgiooKfkwf3Iagqy5hXFGBj5cmuKkh1yuVevxDgro4WLUZd3sdd4K7j1cKnEC875LDncRrMNeFEMvZ70nY+l4SVvKRzMsWhlKnRmKTjHEdk1bbOAgwN6xQ7EnE2kP8UAeB7XaS3kwQnUezi7/e1fQhtURGdqA7CnOmSjUgbxo4kd0kJPb/2WiJkIiNjPPS0wb8fNc7kqNt2e3WAYxW7A1y5GV7i8wmahjo4YXyQFvEhrmGFoK1Sh88fL0Vr2iYxPHw== 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=Y7ZmgEroWRBoqzBKBPBXo0rXHrQOa5zwapyrt7KKPyU=; b=l2J0wJDH9hpJg/FVZSx0+DVSKVVdkm7Jj2cyBXINFnhTGib7tCTLinTGnCL3IDQvB8+SADr4jp2BMC87VLxZJBeo+4dWAEabEjmf0l6wVF0UvdO189QQ2O9b6hjF4UxhsqCuI1zDudxhjyYUUGiLBJfQaBU5vx3cDFkGCAK95oY= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:19 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:19 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 07/11] Input: iqs7222 - set all ULP entry masks by default Date: Thu, 8 Sep 2022 08:15:44 -0500 Message-Id: <20220908131548.48120-8-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53be3bd8-330c-4bf5-e60a-08da919c752b X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YiCUKcVOzkIGBVyxB1Nqp7NpCQcxhxMkrfUe1DFIfuFOa3wO+U0lkqlua+d102rIXLUeFpe4kIsgwaDEwVcznWSI1oxV4FGQdkFQSh9PBo9rMKmEXTiD8ts7TxzHoxVA87NF5o1jsKVRTTigkQCE4QxY8qkfO0PeC5N+2hFZigwcMC2RPJHnvKvcd95t0W8tz8gqe6T8lyUUXEy4oPk1jh7mJvZyz8R3qi/LSWHTO7CsjfSssS3K82aiSKLXhURXQ+8WUywbVRP0Q1oTkDueWdpY1m3G3H21dzojVMIVsdrmPBPCLCdrLPmdEfC3akUcZyuhcUrzGfwW5NutaIqYgA48J8CCOMNiN/OplZOtUIlT1CEA0Vx/bELn+fu8oTbNFcns3gGXd7K3TJge6mZAPvVs9sPc0Wh5UwoZP9PUz+YR90gvOoJAP7HgsRKf8nA0y8irD/futlf8qL0sRDoKmsTIqdg5P4AM//tipwIIYGTNJdHy7DB1RZQQQn1XfqGqs6g3WdhIcgy0q/qLuOrR+OdaKksRAgLXbWKsB623pLV+qnGYBMZAmXTTeihGiKmDjOYxTzaKGjkht1Fl2ON+JJqGnzoeI/EmZZSqFRRSsvCXikI+hRsNn1DSDSh95iDZEUlytZfi4eHmp8cZqeATCrt+KzgpdfVBJgmZrjNJ/WZUUwvjB8FKVe/XvDKtbzjlxD/5zpue+J+Nkj11HBSDTxMWqpJ2cv3WYQYb5UgAWB4vKhLF1YKpcsF1IKBUv/3ifRQxKIsiNAzwNC01fmXZWA== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X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oZETSHT+ARrNvLX5w52O0qJjc666HvVEgezKNjJbutVFjrujXQsyzO+phCrf2nWeLvEmhClMT8mXDso6huspUwcLRcJztGgZkauiYkQqeNnGJss1qFy5kDXGNMYhBD7uuU1bJuvzb3f1pktEk36NiKkqqW7GaKp4k/WRX33B1qcTo1WgPW9P5iAcLD1p/7zvEmVAqDo/QZDnh2FWu4UaVYMc/H5BCdPQTsH5dx2240wKK4jneMPEICqR+D7ORbBeaooAp1eCaTiohKedyg92Qp3ZG5UBEKkHhVPY7OI7bbRS8rIZsK0FbjlwzmTwMbhl+yP7FCOMBxxN+OXw27jDKkQVjWKhqpNB7wdkU12NgBS/XlvmAS95GhkZ2Mirkr7zDSquDKZoW6xmKFyYOnh85Eks8uVbmDq6PX7rnzm0Aa9HDNU2KFgHuYdw4xbMDjVBPb56qSiFd7MA6jU0a3gT+P7ugfytRSPIXXzLzhJrSO99axX/s5w+MbPS+3BTzkeAenc1MPRH732+SgyGcfnLOC2xx6YxuyrUh9Ux/N6QwA2D5BTfpySsJ+97+3ujNu X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53be3bd8-330c-4bf5-e60a-08da919c752b X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:19.4489 (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: ZDJTGcsmdR40JooZsteWB09fiKgdXpXCGkSQC0reFTbE/27ytJCq+30k2KPobYVMxnsF7/5sG8wm//6nW+G9IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some devices expose an ultra-low-power (ULP) mode entry mask for each channel. If the mask is set, the device cannot enter ULP so long as the corresponding channel remains in an active state. The vendor has advised setting the mask for any disabled channel. To accommodate this suggestion, initially set all masks and then clear them only if specified in the device tree. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 00c73a920ab2..d1a4ab3c95d3 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1777,11 +1777,9 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) if (!chan_node) return 0; - if (dev_desc->allow_offset) { - sys_setup[dev_desc->allow_offset] |= BIT(chan_index); - if (fwnode_property_present(chan_node, "azoteq,ulp-allow")) - sys_setup[dev_desc->allow_offset] &= ~BIT(chan_index); - } + if (dev_desc->allow_offset && + fwnode_property_present(chan_node, "azoteq,ulp-allow")) + sys_setup[dev_desc->allow_offset] &= ~BIT(chan_index); chan_setup[0] |= IQS7222_CHAN_SETUP_0_CHAN_EN; @@ -2304,6 +2302,9 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222) u16 *sys_setup = iqs7222->sys_setup; int error, i; + if (dev_desc->allow_offset) + sys_setup[dev_desc->allow_offset] = U16_MAX; + if (dev_desc->event_offset) sys_setup[dev_desc->event_offset] = IQS7222_EVENT_MASK_ATI; From patchwork Thu Sep 8 13:15:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970085 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 0795CC38145 for ; Thu, 8 Sep 2022 13:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232334AbiIHNRc (ORCPT ); Thu, 8 Sep 2022 09:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbiIHNR3 (ORCPT ); Thu, 8 Sep 2022 09:17:29 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFF0925C78; Thu, 8 Sep 2022 06:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ezDxn+Eu9a/rM3noNiGYLqF0zKdW5eUqCBj8eEE05ESx4kwHxuIwWnT/ONywzFnnOF1YUkc5ldAKrBWOgLA3acSi/fV/Q4P8uZW5HRr70yHfydoeWlEk+Vv4YIfaCU5H4w401Ij/Cxhd2zLnoivH4l2Kt9a21hdbhGjiKQ/1ZC+aliboMQWBgz7nLrBm+oVQgP8MhyfmOA/dSHtFQ++Pn2bmVL0sSbe+AFIKq2+PqOsBC92oGguiDpXEnWblMBHbK2w1dnCzzztnr5aZYdsEeeIarP1mS9k7t/usCQ0lf6cal6CfuFHMOF3UOjZ8Pawv2PQDzimTeKbL2xq8Su+oIg== 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=BxAAtzCpjG3X5nddJP3Wq/95Lps3I+3df6LM5SxPlVg=; b=V2qPrtYM24Djtf0jI1alOnQs33atWZJEDLXhnwu8ScfNjuESwp9Z72XBqys1Vo65Dw3cnyXzXksN52BaMl5FWxTJVuihygJIamJ9o0Jg23r6NWacMjqPV0H2RQo96Hbi5e0K9XIquxfwBGJ6DlEEufrGdzChs4WkMmATMtD1fEW5e3xwT+I7G/mBdC9tlf7Q56hCnfah10rDlN7J+b5cwGc2SgJV50LvyNBP+HMIBVvVquBnKsErkNXRTnWkRjgoDrt98Lvi0Rns2LTpNRrFQX1yWPK9iFW/jmWCr8BCUWw39KEWh82adWRUhqtuUicQUJraFATz6D5Hnyy6yBheEg== 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=BxAAtzCpjG3X5nddJP3Wq/95Lps3I+3df6LM5SxPlVg=; b=avYf0w5IWoUJYjV6bbIyAgL3RbyApoNm5j8O5GnE+QBs9FfkXZrZB7M8IE1b6kDUA4wy/SWoq4hFUwDjSnlPb1WayYNLQj2OTeapDTEmVLMXvguORTOREWbjxVHd76QqmNDgvBBuUajMSh+hOWi1nYtodDSJceJzddZyvQzj/kE= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:24 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:24 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 08/11] Input: iqs7222 - allow 'linux,code' to be optional Date: Thu, 8 Sep 2022 08:15:45 -0500 Message-Id: <20220908131548.48120-9-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c967e1f7-e274-44c0-cb40-08da919c77e8 X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: boUx/oUEu6GJjx1wITs0nhELaxOdwndOqSYRHJAb+5F2nOxWqkw9tYSYHI2PmMa5ssvtmsI4RAxivlV0yb4sgpMnPAx70jrjWYWOyvYsrD3z61YTQDFcGUgz3xajVnHfWGIhILBj03bkd3e08kWdFwaDHTyGgkSsqCCmxa5+ZYSXc1lbZ2xl9S0t3Z3QkzT6Eij9WVzCj9jymHOPGshFFyo3rB9R75PKIcEmt8RMeOA8EukBqZfOQBaxhlU42l9BICvaIzjQ30vv2cAcbvvDDuNDXeBv/8PE8RVElWM4bODc7O90P06E0FL0CBwPfFqbw5tG8WpkB36l1sQzfFaegOx6zXWQKIwosV8EBwzZ8wTjNye6Gqm3cKxL8CU2GyaM4yG+QmLbGjhhAGw6mrzoH+bi+Urj2Kttk7qzAN/ymRad5OPeWoZubE+21+be9rNpa4Ty/rx7SMJ7gH+BeMAkS96D7pjyVgbVu0Apqw3gxNXxFbmdDWNaz/Nun+f4LWxWT9asQsa5ORGCTLv76pQUH+32RFH0B98VjE0Oiztc2NIBQUIt8dH3Vqwj9tP4/i4nfYe+NUv1MkZqa8CYuOL9dnoLDc86+sDcrzQM72SvWFtSjo/uLwYj1U48TBgRtrVLipaAmrhuqqUM1KmBYiQk8c3Bg1c5tFvpPl5OEmNJblvDesImc9XOLotWF5iujFv7Un1rz+5LmarhikS4ezYDDxzdZgNESUnUuOoeu6ANLcBzocdpjrkUqSAFzmWdFW0Z 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FKYtD+oAS4oYIkjHjGFAL7+93ep/LIyBa4OPXCKv8lpDRl9vGa9LpvXEphqC7ZtXdPyciL5xCugNO8q0looWgTx2H8M1XO5JIkNz1lLMI0dY3DEeR6rfF4qEx5/rghUtn/7kJttd8bcFpJ1gsu4V1iX1YbWAQqadlJOxcTZ896wYG0eXRbfJJIYzAnq493Z8FAw0EYIyDmI6Bv/EJOUBkQCTLAdHLHwEIIPmzqZlXpTOjJFvg/yyaW/iRjLZYEhb+dl4I46IL0NBlK+p8zuw6iHZoIrWxS2cSaff5bayg+MOE3vHbGPqWw4PPsmMcdnfczvcWJYIksH5BUhLdpXz0e8TzzRJu7lJKrDc27rx9at7ORByXH175hNRz4zqUGmsrz1VENmhlmRax1/UGFykXGJqElc+Ih1a0g82ns5GMwbfprmcjHc8QCtTD695Oy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E68bV6PII49wixhQWOc7aegwJkADLEXFXx1YEZUSWTTRihijtxMft5KCe9z8+gMIxKPZYcCi/qkPRrZtj X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: c967e1f7-e274-44c0-cb40-08da919c77e8 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:24.0110 (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: V+99e/Zd7MEsMIRM8wSwWfH+wQ/oeVM6QcKq2dJEQyOrjTNvVa6R6Y/wwOq3gwQtt8DRribDGqgJVKjH9kH0Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Event nodes might be defined solely for the purpose of mapping a GPIO, without needing to report the event to the input core. Add support for this use-case by making 'linux,code' optional. This change relieves the burden for reference channels having to specify KEY_RESERVED for their corresponding key code. The check that skips events specified with KEY_RESERVED can be dropped, as input_register_device() already blocks this event. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index d1a4ab3c95d3..ac810b8ab69f 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1963,6 +1963,11 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) *setup |= (val / 500 << i * 8); } + if (!fwnode_property_present(event_node, "linux,code")) { + fwnode_handle_put(event_node); + continue; + } + error = fwnode_property_read_u32(event_node, "linux,code", &val); if (error) { @@ -1999,20 +2004,12 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index) iqs7222->kp_type[chan_index][i] = val; } - fwnode_handle_put(event_node); - - /* - * Reference channels can opt out of event reporting by using - * KEY_RESERVED in place of a true key or switch code. - */ - if (iqs7222->kp_type[chan_index][i] == EV_KEY && - iqs7222->kp_code[chan_index][i] == KEY_RESERVED) - continue; - input_set_capability(iqs7222->keypad, iqs7222->kp_type[chan_index][i], iqs7222->kp_code[chan_index][i]); + fwnode_handle_put(event_node); + if (!dev_desc->event_offset) continue; @@ -2249,6 +2246,11 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) if (!reg_offset) sldr_setup[9] |= iqs7222_sl_events[i].enable; + if (!fwnode_property_present(event_node, "linux,code")) { + fwnode_handle_put(event_node); + continue; + } + error = fwnode_property_read_u32(event_node, "linux,code", &val); if (error) { From patchwork Thu Sep 8 13:15:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970086 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 5AE62C54EE9 for ; Thu, 8 Sep 2022 13:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232336AbiIHNRe (ORCPT ); Thu, 8 Sep 2022 09:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232366AbiIHNRb (ORCPT ); Thu, 8 Sep 2022 09:17:31 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DE8DABB3; Thu, 8 Sep 2022 06:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X4llZ9lZtOau0vjAGSXV/VFyrNK3kxQbDFMOyc7svFzgBB+GT/07f4xg9l1tsZgUpMS9vjs1jv4Z5nd9c1UVyKcUMkDXN9okNlPNfGCaK+/6P2ktCdrXUKj4v90X2WpoaMxd8+6kuHKwojjPubGXkLyyC2/RkJhoiGzYyPnWzMNojzp9XVx2JgHU9/J5c9egZ3qbh0iFlmlie/xXi2dhBnhIjbZlrsTxJZKLwvdh04r3zaWen83CBSgIpEMwuoFcH88EtitSgNxHdos6W9mEhEcJIv/eO0t5nnZ25RIQ7E3qbicYmTIugiLnRlGZIYkLi9VSYXurAwggmyh7RA32Cg== 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=0RW6JvCzeK/n0ofZa7xvCTMTOJjIlXZLlZpPD0hgU+k=; b=UFAuXhkoR92E93CvY5mtqffrhQvZK4jtJM9/7QlMWp6RJQgWgKWn8P43V4QqVfCHLpWCgdoU1azMLM05dkvBHUjZxGuCjQJuGB1XfnMLpOvJYRjSobqmtIgAHBKpC4TI7sa0IBG9oE9t6koHqs4goAyV3ZsPQN+UTaro1M2+dX/+4CL3NblR0WNGTUKA1uwIre60Tet5McdqgJdB5s86MnllyxW+8Nu7T9EdBKhcfsas5BD8lY1KsMZtrknLNPqown3Qvc8Sd4m90k7qJ61iLIybu4cZObPAVGLHCVjrgzSidTi3wZDKdL9NZHsIt/ZV0kWz6qNHyhde19u/ps+uMw== 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=0RW6JvCzeK/n0ofZa7xvCTMTOJjIlXZLlZpPD0hgU+k=; b=UAH0XEakc/xwL7szmzGgPTFV/WUC9Y1AuOTm853gk6r1hN4BTZu+Oht6tAIYrV6XerGiG/hBETES/oALPeqgSct/ikcKaQjoBlKrvKJSmpuwlfbE7JBtqJgJZO/fWUiu/Pc8RblOWrr+dyPx5xnOJu42l9ZkuHwqi9ls/QT5rUY= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:27 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:27 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 09/11] dt-bindings: input: iqs7222: Allow 'linux,code' to be optional Date: Thu, 8 Sep 2022 08:15:46 -0500 Message-Id: <20220908131548.48120-10-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fd42d7a-1f76-4a5c-1d17-08da919c7a0d X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zdpQPSYLNgUfBwot18GsRNjgIcoqSrqsGDsBD2GW7yZ6z1le3DD89AV68geTetd+MNRgETQgIWUki8E1UuwtWtiqGP5YUL8Vh4aYxifFUP9/ZqIzOUr9zDm3l4RMVPKvhNj94O4OJYODNOC3hW9/LjEzqf1tSWwh3+rTkze/NIlakblRQBIQxXFOv9C6WflmFlve61o8Vo3efmF3geCRuu3EInlXyy6HWfIxe6JlbmtPwqznlBdi2E8YdbhyMH/s4Lu8eQMEuMm0n8LobRTLHL1tAbgOoUCOEemB/4YtjNt/WnvqksTWNCFQfBA4GZU/nevV+37rpoen0iSOy3oT9pi70F4qQ5Fx6FPhhls2uMS+n7v+t9itIL+dLp7DMfb7eyJiFXQd+jujinP0D7CTwJtGQR7MIHgk3ENsrgO4KTLKWzXuedvLR4aRTJC7HKZwfv0LhtVtY70K/H9rn/T7934P17/Rl8DzP+1WcUtrYnfIe2q2F4d7HMbXzl53pC28E62ljMocp/CTN8IRwIrG25e2lylzxYuW4BP16O+xiGfECfbbIEhNclq/pPg/Jgmqw/q9sd2waVh3B6az0xoG1LlEs0tvJ+GDMwrhqIrxgVdfeF4YL3lQgNYuCuKRnM31VU0ygR5r/c8bRHzlzu6Lgy8CC59fKgsATaFT/XNNEmNMpqZOxGK9YT2wYh3U6p2MILgDpFBPSLmV37r6B/3BMdj46p4R5Re9C6EmJfvFZKgefgiGW/j6ZgZDzbGv3OLLP5xG+0xdJdWJgMxvkhKTWg== 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E9gOhXLp2qWcD0tB2wwOUzU6M7YO2J5iTcJXggBSgJIPcYI8/l73vOMMUbhaOvkDprpBgwA7pb1z6e4mON8WuFN7HMX4/Hq8r1bhle8jhxIUzWvcMqWtb+JDPEcZcBy92U0m2STNFaK3xp3aG2MTrNzNfGEy3tjLFYymdOkVW40pc5A6picu+1eKVgbd6cBTBXrk6G0DjFPI0tWUsPrxQsiO1ITF/owPIkagRfoLKfNc+jfWJRXaLTmos2t/uYR/nv1FSIqtzBpxV/nPb8dKjGm23/hWK0GbrtsXQS7cSSfJ+drURSGyxNcHkK4w7U3JfGZigVOmaLLtVN+vtuZK/uKB3s3HxCj4BczA7di84GR/zaerSoqKBA4SOtL0QZ3TfiJDy8nK/TX8bnFFerJYc63/eTDOVtl0Afi6UNGdLcKPDSTw1HQJkuwEX9KRAkc2sPlUvcKG+OthHEvoN4nOnjqorpgdWkvFXFlsCOh+8Bo/IPYFkaYXG/JW11IrWX6YetScASzge4z0gqzKM6Gz6hV8noz6euA0ffb5DywnULzcIKDt5NR6Zi/6y/KyGzsFcsKA+BED2/HXiYga/9nkVKp/Nxrwwg5mrC5t1pjcbY7Wp/ReXssiyzsZv/AUeYcIXFYovSu2mZMlRcNg39NxKPPDsFTvu1M+0mszZ4+XU2dSju+tq/eB6S924JCuopgng8NQxcvFbv/h/mpWUYJdGP1gL4C4XWTPcytlyQ4hE1sjz1PGUAcoT4qQtC8sXK2Zy6sMdo2TTlehTGPtlowcPsV5Dd0zGf7yx64k7nCZEs/wFrSZgrVeaLeYeKXwgWSAeGMp1FwkeokFbOMxWi0zNC6uTjO4XT7zsLdgefzvYGC1VHJIUq7WOA0iIEqlPA+OO/gEgdMfLJVefS9DsCz9dl3j6V8OhsWASr89W7pOCR/0qSl9oId6PcLkSD87NlUyo8E9FcEx8+6QGv2kdq0qEow3LXjBxF7JYWzYEXBAAJAIxn4GKrt2akhb3Ud/L/etaukklSVMbEqEEDh1NTu73cpUU7o66q6/1bpd3t6UsGEoJOoC2PLNeG0zRnlkFOeuK0maL6d+vnjVkPZFbx4yWMmb9r/foux1XC0HLLSs22+TqzitpH4HWwH3uf5ofEdbfh838HHVeeagtuMSYKeqAgF9ThKooz8w1gfLMl5a7v4MpXAEdaoi9QOIeoWXYDxBy2Xa4ECeLuPQ/Fu0fgWEeacZglVaCG/UqKPUtbVo7Om3NJZEYAxQbqgJY14hXycCh3xBQT9dd6Nm+Iw/E6YoMeBNy85ZfFY9GQplgCMRpZBtexxqlYaaDQGU79mVY12UsHWyeIxI/C3828rsBGsuYCqj0/djieoPYEGUOroowEyB9A18LmzypqNy6Wv6xh/zhrEyiLRB0r6aJLbCc7SxooFYzK0PFYPNlSkbGzFSFD38O2PXpML11uPaqmtMzglKjzP/9fM8VM7YxUDk/O6KlCbpMKLsRZIrkU68yeNKCRejgxPSycZJBeIswVKGpM+KdbEtafB9zg908aSU9rYvUBONiPRRrGuoAUFFalm/EmCCjtUSYjRF8ReclDLpM2YB X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fd42d7a-1f76-4a5c-1d17-08da919c7a0d X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:27.6670 (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: pvl0Bd0HBMatYCZ5QkBrvDPOeb1gtkT5ugnBGlZeON2apC3whVm97TflarEXym/PephcEkdsfH8ovSQXSzecyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The 'linux,code' property has been made optional in the driver; update the binding to reflect this change. Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml index 785fb9e83354..913fd2da9862 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -473,9 +473,6 @@ patternProperties: Specifies whether the event is to be interpreted as a key (1) or a switch (5). - required: - - linux,code - additionalProperties: false dependencies: @@ -620,9 +617,6 @@ patternProperties: GPIO, they must all be of the same type (proximity, touch or slider gesture). - required: - - linux,code - additionalProperties: false required: From patchwork Thu Sep 8 13:15:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970087 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 3A015C38145 for ; Thu, 8 Sep 2022 13:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232364AbiIHNRi (ORCPT ); Thu, 8 Sep 2022 09:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbiIHNRf (ORCPT ); Thu, 8 Sep 2022 09:17:35 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2059.outbound.protection.outlook.com [40.107.223.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C42DABB3; Thu, 8 Sep 2022 06:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FogquqaWO0uIUhaPl5h8umKAAYufteTZc+ZlbS+7dWpRCLaxEgGUD/pk9yqOTBkV/xy3Lik2CWokws/Ua/h1xxoSdMz4/fGn+37ooueauxP6fi3CgOrln4fjv2EbS22EnCLSmak5pFYmg3LZjv6kkoQqZD3dFr8OgX1pztY3dDDPL9apIYmfIsfr6QlFl2PiCE0fUXaCbpVwxbFEIWJB9pPKfO+vvEpJwdhFO7f6kYHx/o1Yu58W74Y9OTk2wzGov9rDfna2yCHkbzpLncFIXoE3zTk1vf4i/MWaMgZDwtfN0sawujrIug++6PiLwK9yn2PhjsXvRjBp9R8f+e3C1w== 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=2BJkYsU5454wTm9/PWLuOG+ow05np1N8BtnMe+jf/wk=; b=Tiak0hsa9nmr/JWjVzgLse1IcX7fXLp10klT+mAsuphnnX7U+LYXE3FpugjG4LHOhQryo5vQBls4UT2Nwp/1kadMy3GDXecgIFlV7tA0sn6/M24nK6dV6f1gFUuSd4K1RaLe+fhb4dA0ZT+7KhviNKcI3YdJRltsPs371HtRoQVBpjR5A2xt5+va1xCoq8a444K0+6SU6rEEfyCjSO+DRKACi+UdxFBXPIHdaYhPhYXJkJJ34Y7oWsbQtxTp3pJDJh10rVhynTZYkEVGen00tp9slqgNvQdThzeyKgzplM8jrFu83kMsiH8+EFU/knYRStc8EFRxT1GtV9fD9BMkWw== 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=2BJkYsU5454wTm9/PWLuOG+ow05np1N8BtnMe+jf/wk=; b=HViO1L23mP5FnydQcqc36CZOkF3cihHgD9An9YKOVQ930InkibFeoXOPXbCcEV0Os04J3zWsFUzaSE6f/AMeMbMbc1Gt+WPDPOZyQ64zr6n4YjQ0H8SB4iLc5k75wSpN9N5sRz8YtRk/Dp3LJ6tU7YSTg4pKMLnQO8iImKmokZQ= 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 SN6PR08MB4976.namprd08.prod.outlook.com (2603:10b6:805:6e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Thu, 8 Sep 2022 13:17:31 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:31 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 10/11] dt-bindings: input: iqs7222: Add support for IQS7222A v1.13+ Date: Thu, 8 Sep 2022 08:15:47 -0500 Message-Id: <20220908131548.48120-11-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28836d90-a832-402d-a62f-08da919c7c6a X-MS-TrafficTypeDiagnostic: SN6PR08MB4976:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j7Sb7eIvmcEhY9abTnLHbt3S2AkgzokY+uvE7Y2GZjlBydJXnImetzL8eUB+ycjPLl3kjrQhzCjkL6+1Jf/9Sv2kefi4037EDfF9+F88JPySnlye5NqR2Y95+kag4//U2bLNr8Q8Pz4cMqB2W1yXYnm2h6ojTX+agd0QTguRrOrZBgx4QCmdBbGXZa97SkZXfciy1EOv2h4PdszZfW9CL54yxb75ojBEVmDvNRJWjRMY4P+BbLucEOOA9jwCcG0qM6zJQjvNt9qjvamucbcW0uFZ88qVXy/2E2PY8TVIDTo7BBtPUurkdyyDvYsMm6HY5P0EVoXQ8jR1Fshcc1FNalrcd1GmcSr3/JUsUjrGlgNAqW634R79ZDD8AHnq6SZ601/EIj3pPr+x6Px4KZtY4r18ZSprmRA0dwL2xPQD3+aOnUHG+ZZHJUUDy/ejHWZs0QdrF9cuhEU8H0lsFBx4KoFwPucutooyawpI9z0+b3XcdjzJJQDcLTsnTr8YkmYsAZ6/yamJXbuc3iBd2SC5eBiTlo1/iWplROPI2cg71qApYyfNU/vt0Eycyqp9zKU1zOHmxa2YkTshYZDVhL6Gftvmg438TNSaj6orVIYgVFb/9XVZxt9KdPeLnjBwEg9D9Ldv0U7NkcU0uxjXTKkPdzHgj926f4cBN/tULnTY/5ZIvyxKBJ6fv48rP+87TJNd7GQFgXysSfPa7LMzy3436+M5vT+BuTgIaMpz4k3DvLsjDFTX3w70GFJ4oSRmW3FS 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:(13230016)(396003)(366004)(39830400003)(346002)(136003)(376002)(8676002)(66556008)(5660300002)(66946007)(86362001)(66476007)(4326008)(107886003)(52116002)(2616005)(38350700002)(1076003)(38100700002)(186003)(8936002)(2906002)(36756003)(316002)(26005)(478600001)(6512007)(6666004)(6506007)(41300700001)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0xQ5b3MH9rCHsIj+eDIaUH83CazPd4K5sxnq8pgOK6pprBdEQaUuVXX24taLd3vY5ph/I4tCHOLdbxpSPttESzBQ47UTWqv0PdsPw9XAhAPMz3N9+p3qFx5abclETYCULXZTTHXpqhSoFoPI7aB+im5skNmPoTmf9vmQyZStAMMYJpeo6yqn6z1y2MmcoNB+EOqz1H7v7mjSEM4ToirVxSGsG6lRrwxvPgSocZ4SbYJQhrpGc4Y6w7Bq3e+5Bd5nsw81RDaWvsgTOYCuH8ye/MfL0TxP2b+4/gakq82E3b81oPaUkyLVXORn2Z/tCErcS4J1mWZ5NYsUSxznG428E5/8iz+On8m+c/VQNnPUG7ZRwcmAzL7bN9p2wvAedcpboYa36JKrypS/BbnN5nIN2qtYFdP0GwJKfjEVfvMw2q9b5NoS23edE1SnxAqFjh6O+0468TmSwgNuHt/h2UozMEWtteyNSqzDHvx/yxNV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AHLaq7AcZpkhwDpD8YF0Kmt5kiX14w+umX X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28836d90-a832-402d-a62f-08da919c7c6a X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:31.6354 (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: ubEUXz59duw7W6gvSop7hYX844wUXBex1alPP7tMpImpnFqwgGnI2yvPisgJR2XLk2ZLdXyzlu4dQtA7X0GwTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4976 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org IQS7222A revisions 1.13 and later widen the gesture multiplier from x4 ms to x16 ms; update the binding accordingly. As part of this change, refresh the corresponding properties in the example as well. Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- .../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 913fd2da9862..9ddba7f2e7aa 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -572,9 +572,9 @@ patternProperties: linux,code: true azoteq,gesture-max-ms: - multipleOf: 4 + multipleOf: 16 minimum: 0 - maximum: 1020 + 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 @@ -582,9 +582,9 @@ patternProperties: gesture applies to all remaining swipe or flick gestures. azoteq,gesture-min-ms: - multipleOf: 4 + multipleOf: 16 minimum: 0 - maximum: 124 + maximum: 496 description: Specifies the length of time (in ms) for which a tap gesture must be held in order to be acknowledged by the device. @@ -930,14 +930,14 @@ examples: event-tap { linux,code = ; - azoteq,gesture-max-ms = <600>; - azoteq,gesture-min-ms = <24>; + azoteq,gesture-max-ms = <400>; + azoteq,gesture-min-ms = <32>; }; event-flick-pos { linux,code = ; - azoteq,gesture-max-ms = <600>; - azoteq,gesture-dist = <816>; + azoteq,gesture-max-ms = <800>; + azoteq,gesture-dist = <800>; }; event-flick-neg { From patchwork Thu Sep 8 13:15:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12970088 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 31A26C38145 for ; Thu, 8 Sep 2022 13:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbiIHNRo (ORCPT ); Thu, 8 Sep 2022 09:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbiIHNRl (ORCPT ); Thu, 8 Sep 2022 09:17:41 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2089.outbound.protection.outlook.com [40.107.244.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30A47BC0E; Thu, 8 Sep 2022 06:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I3nTIzqE9bmNc6uX+CWCnF0fM3y8VXcrmZ/pwe65IZ2LGjj/A/dtssdVO1SA2kQok7wr/idgCreB9P8RJo9GX0dx07TK0yrO7eRL/mve77gyKftrE+vQASL4in35nqQv1Baq4egdFn+KC+BNhjnPdo6SfguaQAGyX/HFn4L9dPWZBr4L3zQw95XOK4ZUam2ThaPiT0zg6SdpGubeJl08X9fxPOQipgKRbQn0H13SXSINqxP8M4w2p49TEhX0UMU1GlXgH5GDDKjKT89mhzv3pzmirGZYXYrsy0LlL2yHx8dKElnAJk/NykYIIQGZ/mx+T+b1m2/OTlTSJjbV9vybxQ== 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=8Z6dBunGTo+w4FT6iDDcKgF2TPJQGSkpXGRYizsjMu4=; b=bc91jnIhgmqVCqiLRHidOjt0GiaGMraeZlj5ywQp9woSaGqcJtC/vfLc2A5gGiJRLf44N1Vu34EY2UAn4191bgX9fW49Mla9egAB3PnWVDMuoNaNdZQVVTF/SJEEioL8flFgMctfJ5J5NfzxZbbES/iN4iDV1GXMw9LlRu3MFrVBIYAO3JhhbYowTSgqu323w1/CbpZdZytSfVhFeqWg7qdbCaRCaVmNw1L08xxkrz4XFN4DGef3Yz0vxtqvXGi8RII2VgumcvulKove71lF+YDG/kE5hGQYKVdyLNVrjXjh281rzHDNJN6U8I9y7D0LHCZoyYwcQJme1ZkmLFn+9w== 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=8Z6dBunGTo+w4FT6iDDcKgF2TPJQGSkpXGRYizsjMu4=; b=zDnY3R5krKuuzZALy/Ckw4MXnx8YQ8byWmV6sKYNtK2EQPwSizTIswnVdc9g+9099BL/kUT0pziynccuyKZIdQ/m6ZEhPij6BM0yl9nY5ZocrVsa9zBXyATkQQ3V/J1zCKfQtx09YvpKSmLcqOMoM691HsBpcKCiHPwFcEPCfA4= 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 SJ0PR08MB6671.namprd08.prod.outlook.com (2603:10b6:a03:2d0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Thu, 8 Sep 2022 13:17:37 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::90a1:7f76:cf5:f9ca%7]) with mapi id 15.20.5588.016; Thu, 8 Sep 2022 13:17:37 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 11/11] Input: iqs7222 - add support for IQS7222A v1.13+ Date: Thu, 8 Sep 2022 08:15:48 -0500 Message-Id: <20220908131548.48120-12-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908131548.48120-1-jeff@labundy.com> References: <20220908131548.48120-1-jeff@labundy.com> X-ClientProxiedBy: DS7PR03CA0078.namprd03.prod.outlook.com (2603:10b6:5:3bb::23) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8be78b89-9171-4e8f-cae3-08da919c800e X-MS-TrafficTypeDiagnostic: SJ0PR08MB6671:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FDvWru/O/EFcpRw7a5SGfq5iC1LEdRRMRKd+3Iwe/zL34LzTSvE+Fg6o/JpXT41cvNc6NX2pllp7QCJzYvjTJ5hZIt0GO1xqVBU1YL0smH4xXzfBnSrGdCHj2WeGMXM+Nz2ndcR3k4PwCz9rKPq9jjBqb9Nh/DTTmitIpeSOcDeOcrlOoMDIvRGHBRMNBqjFrSaRvQ2XYfO+fPxHqGwlWoqUXl7Nj39Che2HlEe4LpFUryH0yzBsnf4lrJ5P0qyvl1/SRvXduMSAYL2Fdm02ZqWFRUge2gsKup5d4Ynn9jchoiUphs5B4OJBnjwo6iI/oS6Xth+kSHgb+71QyLrAIrtj75APFSZc7L9yWds2Qhiqw5kI2f4GY3B/dvWhfa/E+EjyBP8L8entSHWaOPCatlYhnmZtY0tUM32LsawumvTLhZxclG4/RIksQyPUoHmy8smjXCudatdN3TJJ5bYBw3UGfzaR2hIIKVRguZZc5MrKpXTGJ62m007GyH+oHBEfFcF5T7wR77ktp/8gD0mb5B6LGRgxMDh1TiyTaBoRLixu1JaP7emRFs3DvUw26LkemUo7DP1yJ9SzsKrLUTuCu/sq2ignzlF+xCEQLZ3OnLd7MPVEPEMt+X/dBJBRUC8uQB6qdCv4O1fNjsbUVM0lLyHhtJxkV3gzZUnm0iBHoM6aPGf16XbY0VpF/9K7zh7/w5NWTBqTgzgbJ+ZZMrf80vw0BUzW0TrIDt+hElmFYaxj9AXLMeOo7Y3TcUJwqaMm 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:(13230016)(136003)(39830400003)(376002)(366004)(396003)(346002)(86362001)(66946007)(4326008)(66476007)(66556008)(8676002)(36756003)(38350700002)(38100700002)(83380400001)(2616005)(186003)(1076003)(26005)(6512007)(52116002)(41300700001)(6506007)(6486002)(107886003)(6666004)(478600001)(316002)(5660300002)(8936002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YYhSdbpuITNMNInbPKR4QK1mkIk7RvnclHTTFg0K4TVszgBalEvbXxLqqZhW3ehEZ407M97PSVdOT7epM4xpVOOEEu+X+vKynsUqR+Cy4BFxV6HNj5JxIzsAesQwWfcuaP2FfX08QQwOAuShbm5r1MkP92Gv2Bw0mr+ZLmYA2dbYEnJvTrXwnrQw0MR2sloNVBclo/zOTxaazd1APDHzS67U3bYyWeLyJJ3HGjpz70WSufHS1hGMYQGR0Dp+4e9de1iHHjWKXWZp52USR+6SvhhoFYTStCaUjehKYrucBeNwsBYfunfKoeL+N2TmzMk8JNYLyjdaskb7IjypKOTY5xluiKcqBbE6pZcZAiCzTM4rgwELhSj+E/+U3fi47rKBhw16cFP/0IU2rXSF9lsOUkqQjzJobW8Id4DOVTt4gUzqIFvDeR+iE0E+WYzSvsHjfzgQRgVwOAl8Wr48EaIqlL9dOLa+7Y/gfPRPY28UpEzmyqQHJkYugc2wePpn9L8JKGwiaqOoVdmPdDj15eHjKQdyL7nz4hktqXnN66DO9SUeTLfymyi7togysT+rpcbxu59aKc8QVL5TMI85CZDARlmjZ4av6ayGgpYMFKk/0ne7gZKKHa0T4lzNf5DqZhj+ytPNWs60Omvtf5/LskrrA9/8o9Msroy/hClKA/E2euI7kjtkQhsikwngXl6UhsN+KNrJ0/72P+RqbA4vzNUZ0SeZtCnFSpgONZyfeu1T3+zOTpm0DUqpuI8/zkeG8pUU8JxHjkCNiG9RwlrJYI452LOThkLwEMrictJxMaj+eFzXW65fYcYzE5iopt2zJ+1g4uPSenITdHTh3FKVWfuVI2qRtVlbHnjTz3lLmvPV4iWAOPYeWKiipILQk+QaXP5IG6GqY+yhPldrRhHvnZUvRIlHmYTQFqkfhl7Mu9V+tV0CKSuzCw0faFYaLiuhhl3hci5Y/IwqomFyVOBW1LUaxvvWYGe1lPyIdxPCzUo6ouqMqa3UuF8jZQMX5TyjIQ63PjddOiSDZz3BjZB4yPnKFSx6Bje7djLY5eKWBMtcicZg8DqwEVAH+NCj8SQoSc+r6MqG5sTSGOEH+BIyH/NPCWNgdZ9G7Q2bOnayrb+x+AVsa8DAKkyzzX3RWZ8DhO9JzDg8QnG5ps7riTE97jxSyPWHLkj4F15HoMrLtxZsiYOkfg8Cy11jiZTegQwrBqcBvTFj+62OWMAmaLOi7yHz8H7FPnS1hfnL1Zi/6x/tZDIltnIk/Dn+LUxKNTevLn9ZwdTVu7+0AgPcUfcrCGObVv5ewrnGL30DiAhU+nGvdNBknHswMbXHyzIvsDDw3M7LZV/J0A4tDO6CUREQ4z/dg4zbKlWZaC0RL3wvT9sxrZCXhBr7j+VbHbI2kxNS/RPuS7m91ntpFieAqiyxo1PrpJChiO7RgQDaYM2eW58SAm77FQbuAGxHks8Dk3X/d5N9PU28f20bNmus7kMb1kVgI+KBDEtd0hjPY9Zd1AkgaCvv4TsrgujO0yNKZmqCNuv8U9pXqkOj+GHZYC814krLBzTxo/6hti2KiFJvXBXAWRK3TsLB2BYf1AU4YPxIqzC8 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8be78b89-9171-4e8f-cae3-08da919c800e X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 13:17:37.7131 (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: xg1nMDQlio6D8vZI8ApavX2BVKHyUjoPmeP9ncNKY/WixhfgNv464XXBQ/MAr5kN6GLxA33ZBmZ62AZXq48J9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR08MB6671 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org IQS7222A revisions 1.13 and later widen the gesture multiplier from x4 ms to x16 ms. Add a means to scale the gesture timings specified in the device tree based on the revision of the device. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 122 +++++++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index ac810b8ab69f..15f0bfa899dd 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -86,7 +86,9 @@ enum iqs7222_reg_key_id { IQS7222_REG_KEY_TOUCH, IQS7222_REG_KEY_DEBOUNCE, IQS7222_REG_KEY_TAP, + IQS7222_REG_KEY_TAP_LEGACY, IQS7222_REG_KEY_AXIAL, + IQS7222_REG_KEY_AXIAL_LEGACY, IQS7222_REG_KEY_WHEEL, IQS7222_REG_KEY_NO_WHEEL, IQS7222_REG_KEY_RESERVED @@ -202,10 +204,68 @@ struct iqs7222_dev_desc { int allow_offset; int event_offset; int comms_offset; + bool legacy_gesture; struct iqs7222_reg_grp_desc reg_grps[IQS7222_NUM_REG_GRPS]; }; static const struct iqs7222_dev_desc iqs7222_devs[] = { + { + .prod_num = IQS7222_PROD_NUM_A, + .fw_major = 1, + .fw_minor = 13, + .sldr_res = U8_MAX * 16, + .touch_link = 1768, + .allow_offset = 9, + .event_offset = 10, + .comms_offset = 12, + .reg_grps = { + [IQS7222_REG_GRP_STAT] = { + .base = IQS7222_SYS_STATUS, + .num_row = 1, + .num_col = 8, + }, + [IQS7222_REG_GRP_CYCLE] = { + .base = 0x8000, + .num_row = 7, + .num_col = 3, + }, + [IQS7222_REG_GRP_GLBL] = { + .base = 0x8700, + .num_row = 1, + .num_col = 3, + }, + [IQS7222_REG_GRP_BTN] = { + .base = 0x9000, + .num_row = 12, + .num_col = 3, + }, + [IQS7222_REG_GRP_CHAN] = { + .base = 0xA000, + .num_row = 12, + .num_col = 6, + }, + [IQS7222_REG_GRP_FILT] = { + .base = 0xAC00, + .num_row = 1, + .num_col = 2, + }, + [IQS7222_REG_GRP_SLDR] = { + .base = 0xB000, + .num_row = 2, + .num_col = 11, + }, + [IQS7222_REG_GRP_GPIO] = { + .base = 0xC000, + .num_row = 1, + .num_col = 3, + }, + [IQS7222_REG_GRP_SYS] = { + .base = IQS7222_SYS_SETUP, + .num_row = 1, + .num_col = 13, + }, + }, + }, { .prod_num = IQS7222_PROD_NUM_A, .fw_major = 1, @@ -215,6 +275,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = { .allow_offset = 9, .event_offset = 10, .comms_offset = 12, + .legacy_gesture = true, .reg_grps = { [IQS7222_REG_GRP_STAT] = { .base = IQS7222_SYS_STATUS, @@ -874,6 +935,16 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .reg_offset = 9, .reg_shift = 8, .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_SLDR, + .reg_key = IQS7222_REG_KEY_TAP_LEGACY, + .reg_offset = 9, + .reg_shift = 8, + .reg_width = 8, .val_pitch = 4, .label = "maximum gesture time", }, @@ -884,6 +955,16 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .reg_offset = 9, .reg_shift = 3, .reg_width = 5, + .val_pitch = 16, + .label = "minimum gesture time", + }, + { + .name = "azoteq,gesture-min-ms", + .reg_grp = IQS7222_REG_GRP_SLDR, + .reg_key = IQS7222_REG_KEY_TAP_LEGACY, + .reg_offset = 9, + .reg_shift = 3, + .reg_width = 5, .val_pitch = 4, .label = "minimum gesture time", }, @@ -897,6 +978,16 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .val_pitch = 16, .label = "gesture distance", }, + { + .name = "azoteq,gesture-dist", + .reg_grp = IQS7222_REG_GRP_SLDR, + .reg_key = IQS7222_REG_KEY_AXIAL_LEGACY, + .reg_offset = 10, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 16, + .label = "gesture distance", + }, { .name = "azoteq,gesture-max-ms", .reg_grp = IQS7222_REG_GRP_SLDR, @@ -904,6 +995,16 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .reg_offset = 10, .reg_shift = 0, .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_SLDR, + .reg_key = IQS7222_REG_KEY_AXIAL_LEGACY, + .reg_offset = 10, + .reg_shift = 0, + .reg_width = 8, .val_pitch = 4, .label = "maximum gesture time", }, @@ -2213,16 +2314,29 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index) for (i = 0; i < ARRAY_SIZE(iqs7222_sl_events); i++) { const char *event_name = iqs7222_sl_events[i].name; struct fwnode_handle *event_node; + enum iqs7222_reg_key_id reg_key; event_node = fwnode_get_named_child_node(sldr_node, event_name); if (!event_node) continue; + /* + * Depending on the device, gestures are either offered using + * one of two timing resolutions, or are not supported at all. + */ + if (reg_offset) + reg_key = IQS7222_REG_KEY_RESERVED; + else if (dev_desc->legacy_gesture && + iqs7222_sl_events[i].reg_key == IQS7222_REG_KEY_TAP) + reg_key = IQS7222_REG_KEY_TAP_LEGACY; + else if (dev_desc->legacy_gesture && + iqs7222_sl_events[i].reg_key == IQS7222_REG_KEY_AXIAL) + reg_key = IQS7222_REG_KEY_AXIAL_LEGACY; + else + reg_key = iqs7222_sl_events[i].reg_key; + error = iqs7222_parse_props(iqs7222, &event_node, sldr_index, - IQS7222_REG_GRP_SLDR, - reg_offset ? - IQS7222_REG_KEY_RESERVED : - iqs7222_sl_events[i].reg_key); + IQS7222_REG_GRP_SLDR, reg_key); if (error) { fwnode_handle_put(event_node); goto put_sldr_node;