From patchwork Sat Mar 13 19:12:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 399700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3C83C433E0 for ; Sat, 13 Mar 2021 19:14:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7740264D99 for ; Sat, 13 Mar 2021 19:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbhCMTNX (ORCPT ); Sat, 13 Mar 2021 14:13:23 -0500 Received: from mail-mw2nam10hn2207.outbound.protection.outlook.com ([52.100.157.207]:25712 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234010AbhCMTNS (ORCPT ); Sat, 13 Mar 2021 14:13:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4cF8sR0B27I30hucdzirjbgzk4se98j//aeHAYO28pEHwE2ca3rENXNVWO8A3fAEky6vCwgiS7/3r8pad1J/Sa4BC/eGATw0DRwE23kI9PW5BdSyC/G0EOJx6ew0WfD4Fp+SQltZ/hVkMq5+WVWmPii43RYh2czhU9wbsZ60OEBdeSykt8COHnlNFU0du9a8jMo6urtcOkxwhdHYKruk+K8Q7CXS9A2LxW30uu+BAY53L0QgsttqYN93vDd6L6TkLBSMxu74+pVPNClN2VrS2yrOCLU8igB4UZBpe+Uy3jm2lHn7KTqAm+dJK/l5LYRYLwjDbFcbvJhrNDtccwA9g== 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-SenderADCheck; bh=QgTVGHCwrxUA2MwXrEDHIa4uo9zxIR6YuOKLFYAvSWw=; b=cQ6kQem4Wd58kR6TG+NkCyrzoxGiYrvb09v7GrRPO8upiIj2YPdM8bNaMJK2VYfsHpKiOM8b6HE4XBj6jnfA0umyNcGSQDGth31Fe4M+yApA6VaKkwXpHJtKkU6vYe85SrPaR/MY4PmO3vKVkY0f1ShFj9XzbyR8UP5h9oZ9nzvYfQ9RNMAl27DtfTYA3x6l2IXbMPwcFtOMiwlMR8540FRoLkgpS5lbbIreOq77wl5Gr7mnktxvx4Z+TYT9s1kLU8gnN4gkh+7eNvKXiJUhzK1MKKn5PXtNDvejqw8p+fuzIzD5YWRUR3eSdoY9dIvW1nK2/17hTfLI/O9Xw2UrqQ== 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=QgTVGHCwrxUA2MwXrEDHIa4uo9zxIR6YuOKLFYAvSWw=; b=G5MGuvGSPtE+KOC6Qqg0xdM5fBTHZPiryBfdpGEDWAzeo1tVw4lA7dE/GAC5shYlFVGvf0xabRQLFAgjopaABTlNEy0Yh103bnknfUtJMP1qGs602b+VUKwh9RFnfl30tRHII87J+PJ75B0EugIzVZlxwiKBY5LehaQyl8TfGEE= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB5694.namprd08.prod.outlook.com (2603:10b6:805:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Sat, 13 Mar 2021 19:13:17 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3912.030; Sat, 13 Mar 2021 19:13:17 +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 v2 2/9] Input: iqs5xx - optimize axis definition and validation Date: Sat, 13 Mar 2021 13:12:29 -0600 Message-Id: <20210313191236.4366-3-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210313191236.4366-1-jeff@labundy.com> References: <20210313191236.4366-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.90.243) by SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Sat, 13 Mar 2021 19:13:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ee152a5-5308-4844-d70f-08d8e6540e88 X-MS-TrafficTypeDiagnostic: SN6PR08MB5694: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bxuOyq2ney2yX+STJcqRcIN9fFpBxYvliC6tNe47yvw/ZK3vNgyjxqpcMlAeiVZ/EXlllCjZCxY8+a2pjRbliACNhUd7yxqbln86R3dqNRnT0h9QODa6DILTyF+a9L+tGfB/CIa17/HlB0BrI6bSWh/EvJDOGPqMz07/3K8OKAfMtifm9V3OiLHp+gUlZHKStHEXidrJ/+msfEjKDj/wm20AdBA1/Bi3M8OSmEcPk7nB8Sn08lPU5ShUeHfLQVzsywHGLoh8MVYFpkKRu2tWSr+xfUTn0/BFo3vuXIEc0b5BaHoXZQITkIPDsblUEVv/78SsGjsf8DMSxSKOCdnzNBMwlfu5BUOkLgvwWgjAssirlYnBzWF4CCQBmPrDstqvXqxzIH1bgzj0snOJActBbLpH1Fty8crR6TCM1GXnspKUkqHWi6hNAYlSHPgf7OncaOyZaRq0ewsSfHmdk8rk0KvcM20ijlc+9Fkroh4X8l76kZDKDFrelHGFWV8bM1asceuWyLonzjehZVZRDhRB3YejYl/gn8/QwOr8DzahRakQWwFe0NYX8iuM4Hjqn2Jwlp+E2ISZhgSAEhGWA9cU10IjTNUDVHF+hk/V3efafNEeLc1OXOibhpstt/QIq1IKwoK8f0cB+LDVwACIch97+d9Lu9y5o7GfuGmrfztWwpdV8EhjjR2u7UA4jwmv05cfsCOvKvmHwDvXchE1TjekyXWhVq41nGB4UZrDWTObNyik8tzL7OoWVa7i4csIVcUddluDi3hVP6x0u1MEy9871qSU2CE4zodud24/SEyTaGLvQdlGgxftIrACUWa0VMA9ziFQhwDdgXAt+mK9yUIZAP9Q37+SrnrMxr7ZBnpWzmmWE/rF0Rpf9cQGNf/mX3dDi/9o1dGuULtGOD38HX/qiJR8V1aBz8xK86RR5VL356MZMqs0LBtSoMhVVpgqYVdC6rD9sh7QL3obIClkx5rcEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(39830400003)(396003)(136003)(376002)(346002)(366004)(6486002)(52116002)(2906002)(66946007)(6512007)(2616005)(36756003)(186003)(69590400012)(6666004)(16526019)(26005)(1076003)(66476007)(478600001)(83380400001)(316002)(66556008)(956004)(4326008)(8936002)(6506007)(86362001)(5660300002)(107886003)(8676002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: IkjcwXT864ziz/+CIhYe5ROfkj4b74C2qeCCqt35ucbHbnjxXWMkRHIOsg/qaA50rHKz2B7Nrgw5fhudalWOdRIYyiAe0Or3ubBioFr8xrOV4oJNH11eo4OQtn5MvgHXIWnIKRWZNcn/CrbCmYO5TA+ChYT5Fuvec/qiG29VnirTD7Xfua4gqmdnA3WOYmW5gnobsFwyk2Axe8+YwLV5lXUq+T7+1qPNyLPXV9Jq6e7XYhXgnB4AUOQk74YVGKR4dYzkR+L9ELGEspk0fpfVKaOwJUZ+xX4r9CnxfbOKZ9Z7rQnn8AIUzfxtYnU8n1u7t34JE0Izu02SfKQ55ICWw6du9S/wWPFWFTL11KhVZwyYj3TVYe2TTKijj5V6lt2p3AJ4iSLwjwcRpP7wygDrS5zSP0UXJFRfRI72XCh2xOn9dhJKJa3+zgq5lY9rjiBFIPcKrkbcOZhxIPpoXVcxpleinqPgISLV5v5VyFk3ZCDQOfvnSwE6m55Vk3XIxJ2MSvRNsB97sV0NOC6SojyzJ8WOfXLN2hJ9Y82hm9901AZHaqpKkAWvmGwhxwr2IiN1al68d4w0ezaQY+R4RYYXzCUe1NSLra/XnFawz/+Nw6OAubtk9Vhn4TxlYDzoxK4jvOr1Cy6TfsQp1MSQPepJX1aF5dcb4dQwdtXjwlmw8kcpw7pOzWT7ZtcoJdGAv7a/+7pZf5elRn2cQiF2XxJm2Dy+1Q5RdCDpMyO8tQ7m5z5vZ4EQvWqzg3lp8xEFo4HpdV84++S6lB4UUZ8/JjrZTL4sUQdd/aw9wmdf1jn4kd8bggz9EXkeBkq1yAIv4ZZIwbfxhUUf6xn8VqKvbgQd5AZ6yht6mYbu+S+HrVKzT6lR0hXrSQfoZ8/7ayILKp0RS8WKsv+eXlF4AAsDgKa8LR/PpW1NsLIzMR5cDPVwyhlZHMxchIkoFDkJ40CeF56qc6jTqvCQaMASUzvvc9gCYgWJgYWrIPzZ9dNmcJiGksxISafBrRPesxhpyUm6VwRcs33vTU6PHqu36wXIE3Ll5DXejkPLAmyQDNK50EUyQIDXCq15D3Aysm9/T37taaDmfbuC9OfgFZzNqQVpqZA+hLaARRZhjU0VwJt4j/SNStrBiyekrLkVLsSMLIU+pvf6Or0pfH/CVo4V9mfXRJD8kZeZnkAEakSrGDt37eB389IcdoTL6hesOBufYeH4B1MiLuT80LMyF4EhkXvqn5y5YYHYgqgk344d00qzpPcZl7LTYkQbGC0Ht9WTk2sJw/R8k+NGWbBuv5xEhqcInGHpAP/vzNmBr5OyBAfnV1ztzbNKGjM1x8gdsXDWbnuY7dw6 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ee152a5-5308-4844-d70f-08d8e6540e88 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2021 19:13:16.9714 (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: m9bk/vVe+omaxtJootNQEl152htbDvn6dLDv16VJterTOe1CNCNZz7dU8NPmohZdfnLFyiq+oY1IQAiIv/+HiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5694 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Set the maximum ABS_MT_PRESSURE value and use the existing U16_MAX definition instead of a magic number to validate ABS_MT_POSITION_X and ABS_MT_POSITION_Y. Also use input_set_abs_params() rather than input_abs_set_max() to avoid having to call input_set_capability() separately. Signed-off-by: Jeff LaBundy --- Changes in v2: - None drivers/input/touchscreen/iqs5xx.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 403e251a5e7d..2a4e048f1400 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -32,7 +32,6 @@ #define IQS5XX_NUM_RETRIES 10 #define IQS5XX_NUM_CONTACTS 5 #define IQS5XX_WR_BYTES_MAX 2 -#define IQS5XX_XY_RES_MAX 0xFFFE #define IQS5XX_PROD_NUM_IQS550 40 #define IQS5XX_PROD_NUM_IQS572 58 @@ -504,10 +503,6 @@ static int iqs5xx_axis_init(struct i2c_client *client) input->open = iqs5xx_open; input->close = iqs5xx_close; - input_set_capability(input, EV_ABS, ABS_MT_POSITION_X); - input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y); - input_set_capability(input, EV_ABS, ABS_MT_PRESSURE); - input_set_drvdata(input, iqs5xx); iqs5xx->input = input; } @@ -520,26 +515,29 @@ static int iqs5xx_axis_init(struct i2c_client *client) if (error) return error; - input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_X, max_x); - input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_Y, max_y); + input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_X, 0, max_x, 0, 0); + input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_Y, 0, max_y, 0, 0); + input_set_abs_params(iqs5xx->input, ABS_MT_PRESSURE, 0, U16_MAX, 0, 0); touchscreen_parse_properties(iqs5xx->input, true, prop); - if (prop->max_x > IQS5XX_XY_RES_MAX) { - dev_err(&client->dev, "Invalid maximum x-coordinate: %u > %u\n", - prop->max_x, IQS5XX_XY_RES_MAX); + /* + * The device reserves 0xFFFF for coordinates that correspond to slots + * which are not in a state of touch. + */ + if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) { + dev_err(&client->dev, "Invalid touchscreen size: %u*%u\n", + prop->max_x, prop->max_y); return -EINVAL; - } else if (prop->max_x != max_x) { + } + + if (prop->max_x != max_x) { error = iqs5xx_write_word(client, IQS5XX_X_RES, prop->max_x); if (error) return error; } - if (prop->max_y > IQS5XX_XY_RES_MAX) { - dev_err(&client->dev, "Invalid maximum y-coordinate: %u > %u\n", - prop->max_y, IQS5XX_XY_RES_MAX); - return -EINVAL; - } else if (prop->max_y != max_y) { + if (prop->max_y != max_y) { error = iqs5xx_write_word(client, IQS5XX_Y_RES, prop->max_y); if (error) return error; From patchwork Sat Mar 13 19:12:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 399698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F4E1C433DB for ; Sat, 13 Mar 2021 19:14:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7919F64ED4 for ; Sat, 13 Mar 2021 19:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234071AbhCMTOH (ORCPT ); Sat, 13 Mar 2021 14:14:07 -0500 Received: from mail-bn7nam10hn2206.outbound.protection.outlook.com ([52.100.155.206]:53024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234336AbhCMTNa (ORCPT ); Sat, 13 Mar 2021 14:13:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i4HYUshvEDMW8SkJsDfHBTZWjegwsEDwiQM90iB1fxeqp1HkFBgy4abo50fqJkPNDbMF9p2kPjcTNvs6MbtPDvO7NvEv+sB1Y0Iw3YP9mIK8rtR5kW9txqFzu5C26A1W3ulvVscoPY1M79BTTaOwIxZqoj4B1lMDZyfHzZW1YEz4bgu14ZWQ9ibDR8XR0Gr5mbjt3i7odTQXg8DioN/3Mdef+1hZ1Ind3G1hOa8wP37Std+YFe/Mny0c7nFvhS3nkh364RL6zizJPcGKfOedQj0QAA72sAi9rRvjwAUmTCrbkWtWfRv1YeoP4hJZX4uNM1zIIfuWwTI3hsndsewhRA== 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-SenderADCheck; bh=7P+XrUv/M/HwUkxxb/ZCp0IQ1C1nEh/oekmjQhVAz2g=; b=hQAbLbEi0KpZAl8DuFyELudz0Et3cGaPUoK3dZPt+2O9hrqi+wzGkVfDT/GNRlJHQUhKWpD1JcPb4VTfU0U5CwpdG0Nk4P75+I7mICfLdVidIRy+QmJ8isJ7tiU1PlzviJ3L2KraHoagatUDqoT460RcTMA/yrax529Xpbm4mvrt80r3mVz1chIdlTUtIudOF7kBMBWCKuJ8PCmi1E+5yjbCdOvJnRTj1TXMpV/EzIvWuYPa0gKy5+x9MFaVFXwaSwvu92SqGhV4f8UdNmqoM/VBCmVrbCgjMzPBX6TdxhvP61bfP1XQ/OpcktPSp2AuLtbOiYsyu5GxgdfOIfSb5g== 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=7P+XrUv/M/HwUkxxb/ZCp0IQ1C1nEh/oekmjQhVAz2g=; b=aWn2m0lijFKbcSJFqFBfxFdf85cvq7PiA2gCc0lmiToZjhuUp2C/+DWXn4gfAXr5zygVH1zQK/l8BqB4HDq0GqMS5N2eOO++YnBnepBSdpqD9ZUq+toZiCOjzFs3jGDaGZByJgn4B3f4juuP6ylbHW3+m7OpvZgbX0YE74gs9xU= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB5694.namprd08.prod.outlook.com (2603:10b6:805:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Sat, 13 Mar 2021 19:13:29 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3912.030; Sat, 13 Mar 2021 19:13:29 +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 v2 5/9] Input: iqs5xx - close bootloader using hardware reset Date: Sat, 13 Mar 2021 13:12:32 -0600 Message-Id: <20210313191236.4366-6-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210313191236.4366-1-jeff@labundy.com> References: <20210313191236.4366-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.90.243) by SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Sat, 13 Mar 2021 19:13:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c778abf4-0ad1-44d4-a336-08d8e6541603 X-MS-TrafficTypeDiagnostic: SN6PR08MB5694: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hb+zdYghlPUiWYmX7XS4rwbesQwcms8cuweCbLRefeN2h2/Z+mU7Bg+f/cJqG0KOmNnBPEAoFr/hECc44jCoUzVu3kUpmDqMyI+VUdfhHiyVcSAuPWAYzNCSYAbVExKwEDgQFgI3b5pWQU/ujYnTDchY6IMkk1zPLXI2/aQOYhREtNU6fzgg03MB7jlW78gLyfLwMi93xdxcMsCV8q+y8TriHBpVAdjcxnNgs7Sx3AEWQLvQZpPeJ4gNp9VuODWX+FMMN7LuQKEs33t6+ilN3Sy9Z++r61y5qOJaRAKtDmBZpA3rAd2BOtAS9QhqdUmeSsgaWteA0RNJuWNseijgpLh6RpYBuF829+ESL72aaOobwovxXaap2M02BniSdDiCDeJyNh4XXLtXdieEP0eFOWwgJ2YrNXonfSCqUfdNa3SGVjwr5aPeYkrZRZQ0LFINWquXiysfmtqWSNiUZFyep6kYUDfTOMei+cU2eLaIEA7d8FVPGrx7aav1ip6uf7PRhMBQz9Mqha8Ol7vmtcWcZFeXvBG/raSMMVlj4oqY3i3iwNpNQEP4eCLJSHC+mVNNX6QIRygKCDp69jqTnoG4pTEaSdG5240HxiDmh5C+fmayrdeVAx+EfcwfAefEj4yFcUp2PwqteTJC5hAAn4e1NxLAmWgc6v/Dit+5FMG2uJoq7FTaWMO2uP5/IU6UrCnA5tQW0mA9/L+28sayx/3OwGRhq+GryZFPKhHM1YKEsxLbeIHFDSkuaR1+cSplZas3rYedk4KcVlAJVUoMUbnGGinPhOnF1GvsQ3cShK8/v+KAgMUN30fj1UQ69j7Gzwx1uCmy4jigpSIezgckK5+KTnjs+CukTZJB7JwjX05fTmTJVo3pba6/FZIAfmBFk3OsLKumepM5l7yBz4M0sAu6wElO/jFsmf2ysxfApeE0VNu30rSpU8fK7cAMfYb1FcYFhe3YDHUVrg/lusyD+m2p9g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(39830400003)(396003)(136003)(376002)(346002)(366004)(6486002)(52116002)(2906002)(66946007)(6512007)(2616005)(36756003)(186003)(69590400012)(6666004)(16526019)(26005)(1076003)(66476007)(478600001)(83380400001)(316002)(66556008)(956004)(4326008)(8936002)(6506007)(86362001)(5660300002)(107886003)(8676002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: RyHsX1GLx3SFRsSTbXPFrxuy0WjBzURxmOp10pRd/sUvLkfxjFQeKgNqnSo5PtTAtElWwSTKEp3MGUmRirrObzf9Ei2YuwTocTSKN4tKIR9p+aJ8xfDaIkUngxpHYdQtiRgcrig/vL3qsAZkb+DcbbGBIWM1YNc9MhYOu3d9tRJAfDdnjO2OEfT12x0HfiLDrhdqH1eSgfGzlQbaE7LznJp77sqr7VOprlwBDFLDFFoIqJJhwt1lrmZHLKqUmjSj+zD7pCkYbaNlEUmuKg8ug5wmDHXEO3nWxYMglEe72eG65+XYW9dIdk4Wrual64hXUADldANyd6N+tVEDeS8y0TH8cw6w+Eo9iqGHYuBxnwTBoSxouOzzTGZ7FAdgxFOfCylcGry4v+Zr5N+9SYji6iCT1kfKklgvNy+gTHBJeX2ceQNldto5Zxfg+8TMPcaKUuAPlDyePgVa60hMRnyjGahNQlSyNjYVgvzOQHxACTpoIz/Vcg/up7sauURGeZTSzDCCh7i4T7Eyl7eI7VutZ8domf1pDrFkNzLko3MxYUA0OcITwOn8yXUdfEVmDucmIds4LF+lJWpcf8kswdWuZqL7WxrxV6EBx1/rOhMfmo3XKW3vDErsPMKiQCEMtw+vM7MKw+727BziZeZC5iwpMpRVORJrDbt6S7a5OAFzElCIRQcmt462X/LHKLS03b172itsFKMxsr0SN3tuvYsEcBXdXWtVCelC8KiPDe6ELsRJsJkDSVn29Goufcnoox4VG72SFaZv088+W89iNa+abGG76gyk1XwY08XDT4Ap0ZdcVQLpLUNx4POTVkfEvzwKJiTbAAA/wRqlvMhP+LK/X2VHp5eBCivHg5cofjqLPtOkvx2e5qRRC2p7Ffw7bIBkBj8jv4Epl/TVlZ7JT4TEvFiMW98VQMDigg1DEW1I6qpwybulpiTc8UiR723GcsPGqUshW3YxuxmdK5Cgh6rmFXxeVWlvY/Kl6XLKzSAUQrI1i4gzDk8EDKtmcE9hpvN5EGTM8lRE8TP0DW2Myiru8GIRoAXPrhPS5l/3Yqy7tqqq8gM6Ox2Txup642o01C85aT6fG86jWsK6jpFj4DnofyQ6Xq6YdHV57hLDtnpnYnBcg2/Zc5wXN+29ZDAiS1wHZ+mSKFNpe16ToyGKCUZykMYrVdUIIg8HMJ9tgn809xChKWy4A1GEb6B6G3MvA35w71nDlyVMF/P/H+MQW+6zUt0nbfhWBzaOnqvGcN5uccjWie7wkKNuDuuTf0mDK9rDjFlJa8iRg+nQxyBjLgePbAwnhO2S0q6hc7QsAYgqZOYVbGykys4+m3Xj5S57fK7j X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: c778abf4-0ad1-44d4-a336-08d8e6541603 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2021 19:13:29.5192 (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: hNpDkPD//Mm17J48BU17bx4tq14Q9AIELr0AqcqAh4RURR+6rjb/oqT8UcvF6Dpa9naWq8C8JP9/JrvloSJzfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5694 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The bootloader can be closed using the 'execute' command (0x02) or hardware reset. Rather than using the former option for successful firmware update procedures and reserving the latter for recovering the device upon failure, simply use hardware reset for all cases. The post-bootloader initialization delay increases marginally when triggered by a hardware reset, so increase the wait time to ensure the device does not subsequently fail to respond. As part of this change, refactor the return path to avoid an extra assignment and to make the logic a bit smaller. Signed-off-by: Jeff LaBundy --- Changes in v2: - None drivers/input/touchscreen/iqs5xx.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 0920516124c7..a990c176abf7 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -832,7 +832,7 @@ static int iqs5xx_fw_file_parse(struct i2c_client *client, static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) { struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); - int error, error_bl = 0; + int error, error_init = 0; u8 *pmap; if (iqs5xx->dev_id_info.bl_status == IQS5XX_BL_STATUS_NONE) @@ -875,21 +875,14 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) error = iqs5xx_bl_verify(client, IQS5XX_CSTM, pmap + IQS5XX_CHKSM_LEN + IQS5XX_APP_LEN, IQS5XX_CSTM_LEN); - if (error) - goto err_reset; - - error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_EXEC, 0); err_reset: - if (error) { - iqs5xx_reset(client); - usleep_range(10000, 10100); - } + iqs5xx_reset(client); + usleep_range(15000, 15100); - error_bl = error; - error = iqs5xx_dev_init(client); - if (!error && !iqs5xx->dev_id_info.bl_status) - error = -EINVAL; + error_init = iqs5xx_dev_init(client); + if (!iqs5xx->dev_id_info.bl_status) + error_init = error_init ? : -EINVAL; enable_irq(client->irq); @@ -898,10 +891,7 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) err_kfree: kfree(pmap); - if (error_bl) - return error_bl; - - return error; + return error ? : error_init; } static ssize_t fw_file_store(struct device *dev, From patchwork Sat Mar 13 19:12:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 399697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9EEEC4332E for ; Sat, 13 Mar 2021 19:14:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF38A64ED6 for ; Sat, 13 Mar 2021 19:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234348AbhCMTOI (ORCPT ); Sat, 13 Mar 2021 14:14:08 -0500 Received: from mail-bn7nam10hn2225.outbound.protection.outlook.com ([52.100.155.225]:20447 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234350AbhCMTNp (ORCPT ); Sat, 13 Mar 2021 14:13:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FhiUq4QiW/kgzChk6Oul4nvtUfn8o+adOcioMz4JB9e0pP/UDEJVX0rzckH7mCk7H5n11TZTJDi4pARYu1wiONrxmKtgl2eS32AYcZXKYQVl5wuWgOlWPCdW0e/8VLMNwvqfK26wPG5BbWXPDVcaGuJDHiejWfJjOYe+/RKIYwXkSq3Xi3cpZ1p4evtIhb6dqe1ZW3QFFLYo4tCAfB6YFDb8jOdWyedtttFAJI3jkIWoKWAxh/hSXc/KOMESlYA6xzD2IN1asar8QmmW/KiafbOG+SqV+Kq9kvA7T60RmJA9SJViFM/AgD3NjXL3U3fkoEEPqV5qWqU9TkGBCrM7Jg== 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-SenderADCheck; bh=gocg3/x/DJ74NRsA1yn/cgqw0WvcTILg6a14pOJk3aA=; b=Nse8qi55uK79V9v3iXlmb18n3w9Vl1iB0aGdPh0tTzRdILPlAMTQdAyWWUIJOvnVX+eBhtnAyRVTPW20Aqly/7WSfj//XGE4U+iFkVzNdeGspBPQVdDNhlrV1Aw9yA/80EyQiF4kvDDTD4bhrXLu7zZ+wg4pU8Z2gSQVNW4fpiBU/Fuw0/OT9Cbz+gZMMiSPOJoVMyE0zdaM+5X64R0Vd/phq0BsW4h8mD8KtQ1NhKD0F97Bx1EuRj7BvlzPkhqTqJZ0VAXZA1cbKkF9PWCi4PTIjptKmNjgb94BNL8hOI673hw5NLtbuszvTDAqwRONvh8Xm58Hi6h9kQosDmXe3g== 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=gocg3/x/DJ74NRsA1yn/cgqw0WvcTILg6a14pOJk3aA=; b=rC7CiJdrmyuPb3cd+6ifZDwLht1DafxwsfHoRdYsUlFW0bvjn8dCsFD5YuUl7JWQ+O+IMlC5JywQDtiq9KMSl8DbX4KelEZbsiRB5OLGXOW6uKVcGfBkTR7VcIgtVooRbQb+HGBFjw3hJ4us1PY4mxHY/9MVq6ObuasJnJsVACI= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB5694.namprd08.prod.outlook.com (2603:10b6:805:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Sat, 13 Mar 2021 19:13:43 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3912.030; Sat, 13 Mar 2021 19:13:43 +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 v2 8/9] Input: iqs5xx - make reset GPIO optional Date: Sat, 13 Mar 2021 13:12:35 -0600 Message-Id: <20210313191236.4366-9-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210313191236.4366-1-jeff@labundy.com> References: <20210313191236.4366-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.90.243) by SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Sat, 13 Mar 2021 19:13:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15d208bc-9cee-486f-47fe-08d8e6541e7b X-MS-TrafficTypeDiagnostic: SN6PR08MB5694: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gNxtcz9/l18kyeP9D5VYAtj0dnsYqtNolnzKEASETKlws0+SYV69keiMYJzsvtwp6Eax3HcTVRu38WaPLfpDcKnTelZmFrAO89LuWYDJDBGOlxoFpc/m7ZMszlZoI20IZk3CrJiiC1Nly86wc2cas8k/XXi498gbZwp7SOVp/4sIGbn4fvnUHjLe67xIg2Z7HCxwuCucwxZ5z9ZBcQDGizR1aE2wdv3khOcTdSONhrZ07Yj/VuC75t8arEiY4KsUFqXFtNMBug40pXb9MXM7VlDAo5a4VmOPk18MDHb7CpPZ9rgig/g5dyRMi3uCe4FheZhmw2UHJrTUzno3uBqGjpY//TjJKTPBA4lxyYOQUpbR+CDwkPQNx6jE+oZSPB+auuDZ66h33/8rqG8T4Z2O1Pw3C6Gdbcr+89Vn2ka7vUggfZmSfjwYC2brd3uthajPB0ldzAreCJriJvhUTVxqtcvvc4NIL9UOvguVyXN/sMWEHN/xO8R+lExeyjozq3U0w0SHI42bSm3z3VkPXHJ3tZ35ErqCei6htTXlNEPk60MKMn4mYC6uLTp7JXoJ4yqJWt88UW7+C8wuBzSLdgpWb7pCcRerlry5rCV/S2PM/EyRRIaFdFvbtfqOJDWigvYO1K3SdgQHuhT6gmZ8S2l99+GNTHX04ccokP0Kq/hJtLQPq3G3XJjQ5H2QOfGM1s6SOYbEKy/FJxM+0EChtlCEAdivUTuF1osXF7itWxg1jyknMXh99xp/tAsnzTIrGyW1rlfe4oMqf36rgqncYOyqp9H1ulhhzdAhh0b6TZl4sQhXUwu+QDy4WIuZGqSF96PqxZrFXYakEkFbc8o9T0vae/6DaQZaE5mivH8/M/333eyKvnaZUnyrduZCLl1N20xIVq2hiqTmISv8FtHGnfydKvBrdgoEDb4lPSCQRtkEbTbarIk2qITKoAF+1/oTD2bPjMhi5bmfErp3QT0aBoj4Ng== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(39830400003)(396003)(136003)(376002)(346002)(366004)(6486002)(52116002)(2906002)(66946007)(6512007)(2616005)(36756003)(186003)(69590400012)(6666004)(16526019)(26005)(1076003)(66476007)(478600001)(83380400001)(316002)(66556008)(956004)(4326008)(8936002)(6506007)(86362001)(5660300002)(107886003)(8676002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: 8PQY1iR7VHGj5g3bH4q83V3j0Fxq1+h/1GM27qeANuy2GsKU/iDXSmxo/cYWendh9dSievO75v3BrEue82Nwq1stfayV4bS6LJZs0iKNKQmJ8bXPoGLPKXpZSACJ4i/Ty/2eLc8eV48MBZpj9nAjqk2FCl5+YUMCSFGRAu1sqqvDLciQp2Gd72qlK9shG4Y2kCHacCLkgsTuqnLNgks89DBERosjp/AjviQJGlIlUyh4xEJlXHXCKR4bcEoWEA834xWym6xnRpa1zcksZJoGQeDLweCr28RKgnYtHEQ+wr2sQf6t11/qPw/1U1xQjF5zdV/2hYWKthNRzEu6k4Mmc/vgTcIpLKOscXgT7xuZXZCIIeF4lYlLewi4ZV0W5q7for+u/wSpxvqh7rN73eEGlqHzXwalhJOp7VzA857xqXmAMmgwk1t1AWjKAhOJuUqig1A1dAhbvqmUjhCs8lwoocgbDGYDZTX16Z620UNSbtur9N+nexfBVmmKC936q+iuvYX+aT3sEp/moVSd6ZKwCIWpZh0R1kM9zqPtV03Dw9fNMLlRL+3TQjCFjvt1r/WGlbKjk4BSprBMqXJguIXjyTEoDaW1cluOVZ3BEF40T+UmTIHnq8I0FU8DoQWJw8/3cGl0/XCW1NRANFRBBMcCLap0ZHun2CSZowvrHFV1uKxxMfNZj1bUYFX9+2TUo6VCL9BclErGkzzspqxopu8XkxE8e+D5imQ9VWqdk895KKEatqHhE9e/qMhPMuVqV0jwvOpd3HhQP0QpU+R8/94+At+kvFg9u5nEs6jHGmVOrXoNw8sTm0K6W4dAKEdlwF20qRaMCAbHA2vzrOfMgfaaRkhqJ+UJbIoFxeyB59Zg/pr2GuVYsLyH/Jp50y7yg7NUP5jHkDBeddkRBenE6roBt9yAvRuZCoOSsYkvz6ejQqhhKGNFI+KeiKkWFPvuqr9kW8f4zDBO+8SNxD0Hp/iYnjlGhQUiGIS5vwc7KqhHe2VuWiBTyQFRMNEH00f3yuhgVT5iZ5UWCe5/WCcovpLyZ1p1FTUeZ+d5kHb/TQLIEd1fzMVzO46llS6rRqdpMSiNGJtGL6VELNth6T0zBRYdGaNmrj0sABeAXcGfqHggSqTMLg3nq/LvIPnILVpkGCypRUu9/iPavT1QP6bnUHKRF8l4snixWxohCShp0x8KdW3afPU0GnPtU0Cq4QQJlJCwPDZRnOnZHsuMnEthOtPnjDZqmFeMD3FDwP1Hl4AMIfZeqNRyYiHAI7JByUOdjUUs8AQM18UUMN9mjU7HsX6mS5ABEreCvMq3okZUiwsDBZ19MH/admb7k89Ctu/73HrU X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15d208bc-9cee-486f-47fe-08d8e6541e7b X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2021 19:13:43.7291 (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: n2Pt/SUhohzN657hJb53oXDZFPOXuPho44ThNBjnKoUYckZGq1UWWx83w6JmnO0gZ/RC+560fKg9RghUMY2meg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5694 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The device's hardware reset pin is only required if the platform must be able to update the device's firmware. As such, demote the reset GPIO to optional in support of devices that ship with pre-programmed firmware and don't route the reset pin back to the SoC. In that case, the 'fw_file' attribute is hidden because there is no way to open the bootloader. The logic is extended to the case in which the device does not advertise bootloader support in the first place. Last but not least, remove the hardware reset performed at probe because there is no reason to reset the device manually. A power on reset function already ensures a clean reset at start-up. Signed-off-by: Jeff LaBundy --- Changes in v2: - None drivers/input/touchscreen/iqs5xx.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 180d2618d8c6..6e53b455bfb9 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -807,9 +807,6 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) int error, error_init = 0; u8 *pmap; - if (iqs5xx->dev_id_info.bl_status == IQS5XX_BL_STATUS_NONE) - return -EPERM; - pmap = kzalloc(IQS5XX_PMAP_LEN, GFP_KERNEL); if (!pmap) return -ENOMEM; @@ -929,12 +926,21 @@ static ssize_t fw_info_show(struct device *dev, static DEVICE_ATTR_WO(fw_file); static DEVICE_ATTR_RO(fw_info); -static struct attribute *iqs5xx_attrs[] = { +static struct attribute *iqs5xx_attrs_bl[] = { &dev_attr_fw_file.attr, &dev_attr_fw_info.attr, NULL, }; +static struct attribute *iqs5xx_attrs[] = { + &dev_attr_fw_info.attr, + NULL, +}; + +static const struct attribute_group iqs5xx_attr_group_bl = { + .attrs = iqs5xx_attrs_bl, +}; + static const struct attribute_group iqs5xx_attr_group = { .attrs = iqs5xx_attrs, }; @@ -954,6 +960,7 @@ static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); static int iqs5xx_probe(struct i2c_client *client, const struct i2c_device_id *id) { + const struct attribute_group *attr_group = &iqs5xx_attr_group; struct iqs5xx_private *iqs5xx; int error; @@ -964,8 +971,8 @@ static int iqs5xx_probe(struct i2c_client *client, i2c_set_clientdata(client, iqs5xx); iqs5xx->client = client; - iqs5xx->reset_gpio = devm_gpiod_get(&client->dev, - "reset", GPIOD_OUT_LOW); + iqs5xx->reset_gpio = devm_gpiod_get_optional(&client->dev, + "reset", GPIOD_OUT_LOW); if (IS_ERR(iqs5xx->reset_gpio)) { error = PTR_ERR(iqs5xx->reset_gpio); dev_err(&client->dev, "Failed to request GPIO: %d\n", error); @@ -974,9 +981,6 @@ static int iqs5xx_probe(struct i2c_client *client, mutex_init(&iqs5xx->lock); - iqs5xx_reset(client); - usleep_range(10000, 10100); - error = iqs5xx_dev_init(client); if (error) return error; @@ -989,7 +993,11 @@ static int iqs5xx_probe(struct i2c_client *client, return error; } - error = devm_device_add_group(&client->dev, &iqs5xx_attr_group); + if (iqs5xx->reset_gpio && + iqs5xx->dev_id_info.bl_status != IQS5XX_BL_STATUS_NONE) + attr_group = &iqs5xx_attr_group_bl; + + error = devm_device_add_group(&client->dev, attr_group); if (error) { dev_err(&client->dev, "Failed to add attributes: %d\n", error); return error; From patchwork Sat Mar 13 19:12:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 399696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63869C4321A for ; Sat, 13 Mar 2021 19:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36CF564D99 for ; Sat, 13 Mar 2021 19:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234350AbhCMTOI (ORCPT ); Sat, 13 Mar 2021 14:14:08 -0500 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:9568 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234368AbhCMTNx (ORCPT ); Sat, 13 Mar 2021 14:13:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQOhyWdvfFqr4HiGGrzidTVx0mEfES0cmR80R7Bdo/5SJytu73rz1qZise78z8i3sYrojq8bFYwOKbijx0YL02YaFBBcen0/icmu4JmcsjMUSmwP2LY2lpTJrhYDjDpOunD+l8XqZ3Qassz9hqV4GSrdk1yNpS90ccXggj05VORNPlI+iMuG4InVWTtjx3IQi5Bg3yFLSVFvszrx+LOMIzLgEtYr2DwQWbESFzK9FYR+eobSPkjODfPd4VbViEiT+iSH4vWxhBv6PYqmUQ4Yce+qDGY4RnKOJgjmjETD69Sc4Tv5fGOusie2UGsRpiHN8LKYCGWLALiXrr8d9Ff99A== 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-SenderADCheck; bh=sacOGMlj7zShq8LgdLxIOG00IIGVp1JdjPFKRDq3X2o=; b=BXyrKTKS0pluh4h+OYAQ1Iakp5n0k2dlvOjrsIDQmVI/iOSM7g9fs3sVFw/ChliOuzKzV5ghMKMlJkNcM5VWTFrgzxA3/9YpEBNNNZMdPnDwK4hmTQiAVfNwBjqPFgHdnr4M810J3Z4UqpXtuxFMTNG6RPC9WAaUzr3j5/YdG2EtvWgCp0druWKFrDO9RGpv+Gp0PGBvhbkol3YJrai6H3OeJuNT52rDEwPWyzetZNX8giS1ubWFz3A/Kafsu0MQ12mlRwpGBZiExA7reYwMe4cIuHvzJSQk/FRS6EpA1bb3nCTSwo9W4OtG5KhO2HP4w7eJZFpLHdUk/N1co9GmwA== 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=sacOGMlj7zShq8LgdLxIOG00IIGVp1JdjPFKRDq3X2o=; b=RtFwISY1iPGDougfQ5yLpP+V/F+pjMD/6PeMNEURHFpJyVYpMqKtLaHomfRHY5L0CjTqjYF/AIQDvXHKjm+c8EekI+1xk+8a81Ez36SkBEMxk19CjbOzJQZQetYYrDZ84laCUuSTGMpeUxuVWLaIITiGe7kqWbvAwqPaSM+ZJdE= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB5694.namprd08.prod.outlook.com (2603:10b6:805:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Sat, 13 Mar 2021 19:13:47 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3912.030; Sat, 13 Mar 2021 19:13:47 +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 v2 9/9] dt-bindings: input: iqs5xx: Convert to YAML Date: Sat, 13 Mar 2021 13:12:36 -0600 Message-Id: <20210313191236.4366-10-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210313191236.4366-1-jeff@labundy.com> References: <20210313191236.4366-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.90.243) by SN7PR04CA0231.namprd04.prod.outlook.com (2603:10b6:806:127::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Sat, 13 Mar 2021 19:13:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f095917-ee51-432d-db19-08d8e6542070 X-MS-TrafficTypeDiagnostic: SN6PR08MB5694: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: szW9UyrczsGCDLmMavjGMLgKUA82WJxa3QRB450GFyK7W34cUvCAREA3Tluekm/o1YfbjOyS+Tt2mBKgr205LJYQKQ/pml9ZEtR5nzDZ/AbKxpNlFakFveUF1V1ruJaYEjzgCQCOnFWR5GrxUw+n+lGBuPmJuPCiYirs4GWij711kgFYLvZA+aUA0kehsySIjHKQyGUqf73HntUg3Sb5tpSiCGlbmm4UOzt9ws6o/ruAhE+wZdyAuK7oz+KmqyapC0p3jWorVS/3bD2EP9J9KIexijmnHOu9XlSlKGfyGHqwZxHm1MlHbqaxHgjICDLKK/swGcoEzIuwOuYs+EB5yOSlR/vFYVYR35wQRphIyRPzcd5JEBEfHGdHwdZiJbwuzi8dO703B+H73EoxAQMgNX5iWjAEMMnRDfmI6tVgeRugUYk2FEpMQvyazsGTznYsKep32nbQHXI9MLVN4H1vRMJQOr90Hs2kC+MqHK+Gr2QObCAizamZ/WEhEEPZjK8lPF+PJfnKeVaYZ+3JG1S1XZZihqBYrdh24yuDdgiKaXTohXKYudJIhBfevPHNYgqKcn23qbAT+TcvpHSWEI5hNDcy4GyCM03ro1XuG4GOjGeFXw6RkVMlYdto+oypH0Kjwg6ssNRDTJDokcHoMlAcpwlo/vWFUQaNinMMgBJQWk3uMq8Cw2xOpN5N5F7nP5EoMyy2mOrpHHemX94iEbjhVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(39830400003)(396003)(136003)(376002)(346002)(366004)(6486002)(52116002)(2906002)(66946007)(6512007)(2616005)(36756003)(186003)(69590400012)(6666004)(16526019)(26005)(1076003)(66476007)(478600001)(83380400001)(316002)(66556008)(956004)(966005)(4326008)(8936002)(6506007)(86362001)(5660300002)(107886003)(8676002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: o3oAqMtuyzA2tC/Wfx076O4pgIk0i6GU3gqIiuNUCwWNC7dY2/it/SBQg5+hODcAbs6qoUhDWtyRf58ASyE20qxrvuG5a5RSS+5fZHJAaXDiB9/WDMZx0yPvbR9w5VWZXmWXs0rRfHVznvQh/a9+eTdzpawv1xIwVlO/+nRi5SvJc+GQL7G35+cXMdiLjoJpz3E6bE+4Y0w0Xeb8Rn8WQYkHCDF+hSSdBiXDTQlth1AZdJVZFqApIP8cOXIUbWCQNdnL+IQkapIa0GWLfQPVLsMBtpoip0FKNhJ8qxQ7H9CcayYZEs6vmJ7GboLxxt3SqZqcSmAzg+IxG+QjYdhNkNIDO77D1osY7h1Hg06TBrAR9BwTWpoHYqDVELPegWTB0hbwnYgZt1Tf7ynvAkLGCaxT0x5I+w3pcuCWDhUm6g5V4zwF6RPAaIEETYkcomBK5ddhmTEB9JhRZn4ho5YuYdqDqRusFjykcHKjbsqEN49jhoM234ly5H20tNm5KUPBu5daVvt31pfCWTP2jEPr9qEup5RckztKHtkpU9Sw4dhgGee5PkgSfoZMzmhnLs3vC/pO2JiHakErFdyIxufwxknzcBD3oCgL4FvD3bEy++xFlGjja5Qq/zolBATmKz11gGrusL6/VLXqWDdMYFxe6l9biORup/JN0aNaQr07WwTcRTm+T0ScvFkc6d3l5f+IOkcpH20zv3RpWvaHbzq15aDNXdBERuH6Hr9mu9FPZGKuFOyP5DQI4aexGmhscgPbEBCm8eBAy4D5NvaNL62U10ipnlJF5yoFNCqDI3fH7n9RqfE28mmNT2AdvP2IgiQOBEHPtBOBO/aBY0yB7TcUfqTAycKgCfudU/78QIlCjR/s4jqDYWqS66bJC08SSWMnCbdYLg7LLaO88uWkVQIFbZrnGjdhE0D10xU8dW61uPUe7Y9JLMNu6SdiuhwOGQQcVpsY7/4V99Zi5++xziV96mH7rfXyayP9JmaScTQL5xzcUutCjV7xylJ1lm6elhNxH1idGSFnZmko7TMiDFauMv1e5YcYad2SdZ/qtCaaaWIUFYiBbQ8LX/PLlCqFbbs8Tmcdg1nXD9HrzmJx+kzaCik9lPbNoCeHfq4xVbIrmXDrttaTT900I7izm2ROpMaPN78v+OqQbI8VDE9yUPOVnU2UK8pRcNFVvm69fnwDji+SESoy/uM54wp0qYxOQHq2LQTvJI/YDZvu51T1fB4HdcfigtY17iB52q+4pwzN9uQo1gmqE4Fbo5Ip2SRV7drhLkDQJukxieCMO6FossZmFoQcU9ZH+OKP8wiEZvv61UxF8HbPcpx8wdW5O8Tfkrrr X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f095917-ee51-432d-db19-08d8e6542070 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2021 19:13:47.0162 (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: IGJuOs8RIg54naY5rvGNkg77hRh+O6/41UMHUmdoWWI4xyim5eAhVPGLAL5qguBu9+okeBuN3OoIjngHXorYFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5694 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch converts the legacy text-based binding document to YAML format. Extraneous details and touchscreen properties that weren't actually supported have been dropped. The reset GPIO has since been made optional in the driver; this is now reflected here as well. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- Changes in v2: - Added vendor prefix to filename and $id - Added Reviewed-by trailer .../input/touchscreen/azoteq,iqs5xx.yaml | 75 +++++++++++++++++ .../bindings/input/touchscreen/iqs5xx.txt | 80 ------------------- 2 files changed, 75 insertions(+), 80 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/azoteq,iqs5xx.yaml delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt -- 2.17.1 diff --git a/Documentation/devicetree/bindings/input/touchscreen/azoteq,iqs5xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/azoteq,iqs5xx.yaml new file mode 100644 index 000000000000..b5f377215c09 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/azoteq,iqs5xx.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/azoteq,iqs5xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Azoteq IQS550/572/525 Trackpad/Touchscreen Controller + +maintainers: + - Jeff LaBundy + +description: | + The Azoteq IQS550, IQS572 and IQS525 trackpad and touchscreen controllers + employ projected-capacitance sensing and can track up to five independent + contacts. + + Link to datasheet: https://www.azoteq.com/ + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - azoteq,iqs550 + - azoteq,iqs572 + - azoteq,iqs525 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + wakeup-source: true + + touchscreen-size-x: true + touchscreen-size-y: true + touchscreen-inverted-x: true + touchscreen-inverted-y: true + touchscreen-swapped-x-y: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@74 { + compatible = "azoteq,iqs550"; + reg = <0x74>; + interrupt-parent = <&gpio>; + interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios = <&gpio 22 (GPIO_ACTIVE_LOW | + GPIO_PUSH_PULL)>; + + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt b/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt deleted file mode 100644 index efa0820e2469..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt +++ /dev/null @@ -1,80 +0,0 @@ -Azoteq IQS550/572/525 Trackpad/Touchscreen Controller - -Required properties: - -- compatible : Must be equal to one of the following: - "azoteq,iqs550" - "azoteq,iqs572" - "azoteq,iqs525" - -- reg : I2C slave address for the device. - -- interrupts : GPIO to which the device's active-high RDY - output is connected (see [0]). - -- reset-gpios : GPIO to which the device's active-low NRST - input is connected (see [1]). - -Optional properties: - -- touchscreen-min-x : See [2]. - -- touchscreen-min-y : See [2]. - -- touchscreen-size-x : See [2]. If this property is omitted, the - maximum x-coordinate is specified by the - device's "X Resolution" register. - -- touchscreen-size-y : See [2]. If this property is omitted, the - maximum y-coordinate is specified by the - device's "Y Resolution" register. - -- touchscreen-max-pressure : See [2]. Pressure is expressed as the sum of - the deltas across all channels impacted by a - touch event. A channel's delta is calculated - as its count value minus a reference, where - the count value is inversely proportional to - the channel's capacitance. - -- touchscreen-fuzz-x : See [2]. - -- touchscreen-fuzz-y : See [2]. - -- touchscreen-fuzz-pressure : See [2]. - -- touchscreen-inverted-x : See [2]. Inversion is applied relative to that - which may already be specified by the device's - FLIP_X and FLIP_Y register fields. - -- touchscreen-inverted-y : See [2]. Inversion is applied relative to that - which may already be specified by the device's - FLIP_X and FLIP_Y register fields. - -- touchscreen-swapped-x-y : See [2]. Swapping is applied relative to that - which may already be specified by the device's - SWITCH_XY_AXIS register field. - -[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -[1]: Documentation/devicetree/bindings/gpio/gpio.txt -[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt - -Example: - - &i2c1 { - /* ... */ - - touchscreen@74 { - compatible = "azoteq,iqs550"; - reg = <0x74>; - interrupt-parent = <&gpio>; - interrupts = <17 4>; - reset-gpios = <&gpio 27 1>; - - touchscreen-size-x = <640>; - touchscreen-size-y = <480>; - - touchscreen-max-pressure = <16000>; - }; - - /* ... */ - };