From patchwork Tue Oct 17 10:42:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 734796 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 5FFBBC41513 for ; Tue, 17 Oct 2023 10:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbjJQKhu (ORCPT ); Tue, 17 Oct 2023 06:37:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbjJQKht (ORCPT ); Tue, 17 Oct 2023 06:37:49 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE328E for ; Tue, 17 Oct 2023 03:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kNCuCj9OMwG7NRWB6wzGM9PTLrvlaFzP6oOYenAunx3q9LtfQyV/1qP4r0HSaQj63gCRb1c8ZIq7e3N2YglI+dcV+dNbLXomuRksB4BU+5s1X00f4mqu2R1m6cD9jzV0tsCHZKXpr+1H7LDmGg2DLig53ObSHBW+3tPyB7Mi7xXLkdeis/s2slkrRQFMeh8oysDnr5ZPdp4+6o+AR/vbMcBDbQv8W/m0ohx+zood8bpzvqZ2tRluHrABGwO7m80wGGn/gqOqQfQ7tFBSTcmTSx7qiAi5UvSb2gHui51l0pALrqNe8hRIJ/2yv6U5F1w1jpixjzGrZv5T+V6kUXNNxg== 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=Vp+qPtM7wDtxHTIQUrSk4dQm4XFDOqXsWFRXwRKEMWQ=; b=kjEC6zXrrEHTwM2TldSCHlYCpEJ/0BrXYnVAFd6/rBDQQOaMFV4DJqlAr/fjdEmQMVsMfh9PM1nPQJIADjheLGJ47AW08i7HtGopWd1uOC2xiqfsTE0QFqhjtF6q4UP88dtXRMYIYNnaxUSbcGPIxKN+fcNuLp950y3+WfFA7C+GWW1ZC+vnvFaBb4qdnjGopOZm0hj/W0UO2baMFm2ab3wa863ToQ51CV2WVFTaEoMNTz6CQQHMcyR/vNXW+OFI0ATqAZaTsQ0Hy4Z4nSEuODfnqpsCNdGqThWIlL1QU5eSERh7eFdL5v78hw/rZg0Fr6LWAM14RWsKwOuw+FurXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vp+qPtM7wDtxHTIQUrSk4dQm4XFDOqXsWFRXwRKEMWQ=; b=VWbwnQAGjgXltPw0jwuC5sWLfR7BhssLeD395hRrpQewPHrRESnY89Ym0Lr2h+XCHOCrFOfHk3t2MnIX0piNNlJuwYGVvFQCVQbTWGi6y7pmv8xBFxRDqMNT9/HvpZ4wr7Q6T6/s1+h7qLBeptYrblElgGYyrjVPIzwCgaT2ZPE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) by AM7PR04MB6837.eurprd04.prod.outlook.com (2603:10a6:20b:10b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.46; Tue, 17 Oct 2023 10:37:46 +0000 Received: from DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::e796:8366:5d4:4188]) by DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::e796:8366:5d4:4188%4]) with mapi id 15.20.6886.034; Tue, 17 Oct 2023 10:37:46 +0000 From: haibo.chen@nxp.com To: linus.walleij@linaro.org, brgl@bgdev.pl Cc: andy@kernel.org, stefan@agner.ch, shawn.guo@freescale.com, aisheng.dong@nxp.com, linux-gpio@vger.kernel.org, linux-imx@nxp.com, haibo.chen@nxp.com Subject: [PATCH v2 1/2] gpio: vf610: mask the gpio irq in system suspend and support wakeup Date: Tue, 17 Oct 2023 18:42:36 +0800 Message-Id: <20231017104237.1966094-2-haibo.chen@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017104237.1966094-1-haibo.chen@nxp.com> References: <20231017104237.1966094-1-haibo.chen@nxp.com> X-ClientProxiedBy: SI1PR02CA0034.apcprd02.prod.outlook.com (2603:1096:4:1f6::10) To DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4010:EE_|AM7PR04MB6837:EE_ X-MS-Office365-Filtering-Correlation-Id: 601f0c25-e0da-4f24-d1d5-08dbcefd1a33 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OrRADBMstuH4Z0QisWVGjTrndHw0ssdHCNKvLnd5ORQiewU5jDTWKlzsHAdLo5hrsjgMbMrhkEAovaVnrAGQfdJiyHGGZQhWBVSDsO3uVUpE0gRwAbLFkRAJ3IJRelqLyHccTDgt4EFq5Q3SXBbUGy1lpNMArgfYq/m7LQhb0uKsbi2kCDpOWeRiXpMPLA3Hn8RQotLvIoqFtRUt9OPmGFQj/WEGuBCXamJVkuPYey8NSbbKeh9pXIGTLmruT68HrIWT99XfE/3a77zf0ZDlq9cy0+Rjqxx8bzJmk4xGVFI7iKKXC5R5Vf0VnrK8YHpi7+huBEhhAihNZE+a9Rfbyb7dEzwQ7iBUZHPbtGUlB2QTIZdhVsQozRAuITv7riQvQn7DKf7rA5dRvu87tX/G/kEmL0Lwv6xpRd6IBk0BcEbtlCOaVleYwZej/ElxkYCa9/jN6N5d9I558thaEQfCfys6KrKNUlDru/JZzzClp/s5O1n8mTS/KhLHOwfzp2mCdnkI0uwWg9aR33zMgwMCk03RLzkrVYH0h5QqXkwKwHlQNbV+8pmOUrr9Dz/G0TiC5ZRXP4lswv5m5emFASJi7U1DCYWVxVgwBfZoVNwbQ+s= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR04MB4010.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(346002)(136003)(39860400002)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(38350700005)(52116002)(6512007)(6666004)(6506007)(9686003)(36756003)(6486002)(478600001)(38100700002)(83380400001)(26005)(1076003)(2616005)(66556008)(66946007)(316002)(8676002)(8936002)(4326008)(66476007)(5660300002)(15650500001)(2906002)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hXa+NaweZWx3+YEoyN0qjlX6qyL3W324otqKCyBPZtm/7PEQlyVtRd3icbdQY52BTUC2nRYM2iSxHR2Zcx5BTxE27DlRU5EV+aESZvHXuePzkuLCoPxF9oBZcGhfHg4Sn64rOptwGfD+qsmvEq6SSzdOJCtr1teq6yNPXueHNea5BBChZepIbT/tX6o6hJuldmmeqpjOwtNr8SuOqgt8e5cx7FxkSUZ5yJZMOLRmazPcAj7K0GzEHtih8mhJehrm5dN/QX+b6R0YyNkBPpQIyjLH3iIIcL8MjgZDOQEh/OdNtDOL/7xOrGK0sDVxI0j7aFw29O+6kftpOgb0v2ioMTPr8V0ES+z00L+X8cMY0l1v7rJswdTetW/FKxwMprKBe/nNMIhYgOLbn1+H81E2vTvSPRFPI6eZ/ve3bEwMaQQATj7XJUMKz3ubp0/0XIY5NfPrPrvUFQaem6uXwfZcBdqICFgJ5yc6V379bEKkmZpCRWuq/x8Vrc9w2WRdf6eF1jJEEdjo77ivR8miL1ZCim0FQf4rlt7adSFYf76Px12SmfjVmPCrlYELMsccxImXUpQk9ZL4kDziMu6EFQ7XcFWQnWg6ssdVM8OP+WPkI6BT4izNDOsmpT6XILhEWG2VXX7EuFFATQMCv087bsNS0YSEmR5osiuPkyogf184mOGCLyq7vRePMcBzY5Ipm02uSQoFapXunKBu+XpQl2Z0fJfhus7udIDJv9Dm40dQK74YlJVORdmGoYYXxw9ornonTawAg0Yrigm0KlcMWCAtW4WnYvSJS3b2hsDKzlvpwIhKqKgF6ZKDafKycrJtup0sFbfrcNJWh5OqFimjcnDh5Tjh9esI7D184kOiDMmhn7SfFf7wlnz+dv6G09HG6KK8M1uGQJWRAnG9l2CvDSzALK+oaOG9jbTlaUpkK6c2sldlXx4IbScGGI+1cyEg1SkOUYNVwpNyCXcsAeEVKkpO0YX0BLYsageIFD5HTwPehVjwHYIl4dIdn4sbV39OrM3e7WuBDaEVj92nPf7rbnmO0OHZSrusD6wDNT0BZrZbRZedI+LIxf/lQTi82/mahmfjJ6gPbHITS7zPHsjP+OE7s6llexL3M9BqHPhYI3XQcYjkjpzE4o/FohpmPKnmjroNuhm+y6aN7TM1rlCQixmG/07oF8KzZ2sWv1zTkrfC4J4yNQY7yt4dWOm1WtVG7gItoV+8XFjTfhXc4ZeNDgLOql65TIILiIMWhrRbEkDhwCAdnyekYevkn/mK560oXGfdVBYhRObNN82979IDGlacQiZz4XMleUMF0srrvgmlm2YJ3LFnVJOd3lzqGEV8d4M0S6fE0yMG0XA46/OJMnaXJQxPNHpE59TQyauETmDB763+YKZJS/RGzXaLm5y+iW7NloTa1inAbEiZht436eSVbMK3M2ogbCwiG6SU//aGGfx19bY2LHjumDgqx7qzrk5Cq/0K2kh1t4e8JCldDtYGIghKm21Ec2ORL0r5V7XeU2fYQQnKscFHl+VJrbYBqvZri1LT58E9+N580eNMRIpH91zCM+Qg3uDb8lu7kAzz4/YT0cUl4AsoA7Dcmyabl8xB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 601f0c25-e0da-4f24-d1d5-08dbcefd1a33 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4010.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:37:46.7909 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U/5sFJfEN4xXSOageWojiuOXUkMIO8J2/0iSj26+90KuUF3mMj00le5FkwF2U56oBLCXJf51wD0bdvCFrVqmiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6837 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Haibo Chen Add flag IRQCHIP_MASK_ON_SUSPEND to make sure gpio irq is masked on suspend, if lack this flag, current irq arctitecture will not mask the irq, and these unmasked gpio irq will wrongly wakeup the system even they are not config as wakeup source. Also add flag IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND to make sure the gpio irq which is configed as wakeup source can work as expect. Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid") Signed-off-by: Haibo Chen --- drivers/gpio/gpio-vf610.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index a89ae84a1fa0..77d5b8dd2bd5 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -260,7 +260,8 @@ static const struct irq_chip vf610_irqchip = { .irq_unmask = vf610_gpio_irq_unmask, .irq_set_type = vf610_gpio_irq_set_type, .irq_set_wake = vf610_gpio_irq_set_wake, - .flags = IRQCHIP_IMMUTABLE, + .flags = IRQCHIP_IMMUTABLE | IRQCHIP_MASK_ON_SUSPEND + | IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND, GPIOCHIP_IRQ_RESOURCE_HELPERS, }; From patchwork Tue Oct 17 10:42:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 736823 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 AEA53CDB482 for ; Tue, 17 Oct 2023 10:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234843AbjJQKh5 (ORCPT ); Tue, 17 Oct 2023 06:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbjJQKh4 (ORCPT ); Tue, 17 Oct 2023 06:37:56 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2042.outbound.protection.outlook.com [40.107.20.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D618A2 for ; Tue, 17 Oct 2023 03:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJWPuqnBoioMp6foMHwQAgTeKoWqb5jfh5OwZyRcAkrotmkNJ8vvESXiAIRJthrYwx4cx0FXHls4uD6Icb9fvgKzMVJUh95AXxkMgBvOUd8NqXuCTLeaOz5HksMdTxW3NmCZebX+c0EIuE/b9yYrOORHp1MqBfjkq4Z85cFFSitBnniSRkFId5Boyf0AxXG4phlwKI/K6NwPEQVJLVf0pv+RC3jeMWhFQEuOo7tETj6s1yAkb0R8v1N16Tqpi8UTXygvyKuDx9oATOI7BMenpMdNjmBothUpu4+FBNbMVtAkTBVZX87495XjYY1lX7bgVHqEUqusW1ChIYFWuAWnMA== 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=K/zyQDkGsGCZSz96kNheoZHCi+VLW5NL2HXz9CfdOJw=; b=Wx7Ra8JxsxWETlXsstii3g11d+qB3AngU5siWv4q3fF8LuqLw51zfmGmDy47F8H3u3MYbAdbVSxQRb+4qsIylh+cp40KWIYiHC1XxcwtbeCceo+l+JH9wgnVBbr3CljGJXxfJYwwDexJN91Tpcd5RZP9y+4DxkY4uHJuORYNJdy5cYFI2tssAhlyAXbaJuCuJJQCcJbPxTMTbfvVudkfJGEYyN67s3neCP1r25pTjI2LxpMDkXNm5+yB29E5J6xqsRkfFhs8QbMsFBpMxb/Op6I41Zbu+USHwCzZzSd+faOqZgrkQuzw4EVAE58ySX97MyrHFYDDFwn0jMr5AwjjGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K/zyQDkGsGCZSz96kNheoZHCi+VLW5NL2HXz9CfdOJw=; b=CIqBPoSVuGnyjIk3ytE1QySmZGKhlBDGFC0mp/csOMBLfdFwjdovCFn0yOZ8uINzY462eHF7TYUOPSj/RFE1YyAnBbhija54RuSCjWKJcY0zYVLfe/ii3W8eOR+0nfGKdJjVxQ37YohIvIkcBaJeWePTfv8accMzGD25lY7OpDQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) by AM7PR04MB6837.eurprd04.prod.outlook.com (2603:10a6:20b:10b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.46; Tue, 17 Oct 2023 10:37:50 +0000 Received: from DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::e796:8366:5d4:4188]) by DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::e796:8366:5d4:4188%4]) with mapi id 15.20.6886.034; Tue, 17 Oct 2023 10:37:50 +0000 From: haibo.chen@nxp.com To: linus.walleij@linaro.org, brgl@bgdev.pl Cc: andy@kernel.org, stefan@agner.ch, shawn.guo@freescale.com, aisheng.dong@nxp.com, linux-gpio@vger.kernel.org, linux-imx@nxp.com, haibo.chen@nxp.com Subject: [PATCH v2 2/2] gpio: vf610: config the data value before the direction setting to avoid glitch Date: Tue, 17 Oct 2023 18:42:37 +0800 Message-Id: <20231017104237.1966094-3-haibo.chen@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017104237.1966094-1-haibo.chen@nxp.com> References: <20231017104237.1966094-1-haibo.chen@nxp.com> X-ClientProxiedBy: SI1PR02CA0034.apcprd02.prod.outlook.com (2603:1096:4:1f6::10) To DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4010:EE_|AM7PR04MB6837:EE_ X-MS-Office365-Filtering-Correlation-Id: 91cca4d1-8353-46f5-f536-08dbcefd1c1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xex0L+YV58Y4vaGVPx33MDcTFLqP58UsAPtuh6nwP4glaX4LWWIrJGpkQKWU06+MJ1xe1V7Ezo+tFKH0GDXrIY/hFiEIk+MFd+zvv0ThDy31AIaW6xxSGONK5XB7c+WVEWpfRn38qGkGQZ1QWZw/I3DcMZsDGZFsWzwAuL/wmjdKllf7OlzSWkXk2FoTpl2uUHj7j2dwjolxGxVOLrJLkry9Mp7Ig/QanCgtCPU0S00+9BHombLSSV04fwPVotyCaTo0+60qzQ36mKggDlLZDKyxSP/0S+LlU530yG8ekFK4LXXZDJYpq/Zyl3UHwnIq77YuDGk0n1uK/Bh+BQgEm8ATZd2lNpr5VsJkW34WDUqz6QjgzvnmLM98NB9I0Kyr9k2ZCcovMp90x8w+A+4yhYEghpuyPduQioSLL0VaO5VkLa5gxkGT2FZN3HsnAFjHgSN2z7plPqOxqEWQcjZA5txYpDauxMgjb0Tg/yuW3V4rv1UZMotrcMzXulZdE89kz92+fmU0OOFQfIdePJYyYIpoSaoOxbFZGWp4FMPOpG4mQ4llhWtW7/Nx0YkW3Vtc9V1IvTbv9RNfhMHtcIEUyZuQ4t5NLzbqikg774xgZl+8hUZ7ENlBUXhOgdEg0hvN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR04MB4010.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(346002)(136003)(39860400002)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(38350700005)(52116002)(6512007)(6666004)(6506007)(9686003)(36756003)(6486002)(478600001)(38100700002)(83380400001)(26005)(1076003)(2616005)(66556008)(66946007)(316002)(8676002)(8936002)(4326008)(66476007)(5660300002)(2906002)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NKdgaTenqXyji/GXqx0Di29visbXEoTEyna+fYdVO9VqF437saRVGp2PrNYphv84iO31RQqGgn0/obL0aai1YVUd8+iJ07RXyuhcb5NIDps70kURo2D8ob4va4K8QgUBDpoad9cEVuYtwyccEV+xM6rrpZlvDvdgcXN/Yq7D3wWyORE4aEeBO+o/a9UslkcvBG4e10X50uFh13kIyCC8G7l2lD9IyZYTd3fCfAlwzqzPUhrLaGEc1TFkBtr1tkyv5GhYHizOKIiyezgU7qvkqUdWmQXCMSCYEBtaYkwqrOpSYmRzRUdG6ZSmQ/gEEbdkikLIWXrVxmUZUHEOk9g9trWBprV3GgAYxB52GlVKE/jdxXz9cnlObN3dsshLDPtYSDQFdKns8L/mM2e0rZv5wtHuAi5rGWKk+7eUxafjAtbTOFSisvHS6lVhDuT/44EfI1ea4dwmccNINGsCM0cgAnsmfpjfYbJrtem6v7D0AttO6RmhcOOhfDdX5RQlATypiXEhXzJ2dUlMrVwM2CdHJnfdJ3TI4/ZBjyiZoTl06N5bnCpd1IXzyemvxsLkASvb0QiCkW0AfnaOsqY6XCT1CbiIAbf5o8CSx0XUMt527lilVnxhVb3Bwl28FxsiiNGlkm7/D4nqTfdCgu2wVX/iTe0sE9on3mhwfyaVu0gB6i/y3s9VJ3qc/o32jup1V/pxAqv4hkoT8IQhHp+fd7pjeoWk5Mc+Ce1zMT0OrUhQ4zRwSfyofrN3WnDkSg95vZWXAgQKsT/Ef3z6Vd2dyT2f8J6oqiIltlaqDJXXSrtZ4S+oRMD3CK95r/zysBGl6jRi3CIM0zrBNB5iTMSCCcjf3tgu2kjL682dDRaR0JhPlkvRNn5cXAnRTdxswAwvNrxAvpS0wR5wFXCkNlLi77A8lhQuv02qXBYyGUIUvR85EXWIIdfo7BMoAQ3wnfZVmEDAy936Ia4XlME0vJDT2rBNF+90t/lFR9iletp7JBKCRfToWC+72DdAi1dDBFavkLKem099KJosDtZk/XAn3TLxCTgBTTPkEgn8V6ao/TdbhkdG54/bskRThNXsfyDNWkSO4lH1quag0Naf0YrWIthkVs31mctEOs2QXVph9Modc8eLy8+Ihzcee/6fDI6iebPooX7o4pwdkVJSCSraAsHhrS1svfxronwcgOK1qMFI1zFCdFj5BxHAXBlXv7T8MKCXEtsZOmh7AJY2/P69T65oRYYetmvmD4tgixOuw3u1XGoFK0kndZY14ATDDPi7RJOTkKhR8vgSOMZ4dBzUB0bZFp0sXT6Lf0BJwg62OvB3Ma8EQl/B2486aO6Ofl9Ag/yHm7I6pVPI0q8yz4VeXu02/STGUCKwFgpHAg3spaBZyAX3TNLXVRbIqZ9CM356Dw370DiPCYOdglV7QywhbEx9Y2pwExaV673Aaedzm56Y06t/ZhhomKP76cupfnvLbck2VoApp9WmgrxJ/drHuI2BILydxjsiqzdWqjUx/8UFuYjt04qBE921NgrDMuurNNfqwQoqXfEFYxyX1ivf8qHEhC3t4Hil997OcTA6yx71zsN/uzKNuly2LOOS+RcND+oU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91cca4d1-8353-46f5-f536-08dbcefd1c1e X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4010.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:37:50.0143 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1qxrhG0cFq2L+RbiGXk9qdILp5UOZsicLpAFd4nkas+MtaECH3zUG13NsgOsXSWeE/iNKeEjzAlV88IOwDfNAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6837 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Haibo Chen We find a glitch when config the pad as output high. To avoid this glitch, move the data value setting before direction config in the function vf610_gpio_direction_output(). Fixes: 659d8a62311f ("gpio: vf610: add imx7ulp support") Signed-off-by: Haibo Chen --- drivers/gpio/gpio-vf610.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 77d5b8dd2bd5..444501c56a3b 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -140,14 +140,14 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, unsigned long mask = BIT(gpio); u32 val; + vf610_gpio_set(chip, gpio, value); + if (port->sdata->have_paddr) { val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR); val |= mask; vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR); } - vf610_gpio_set(chip, gpio, value); - return pinctrl_gpio_direction_output(chip->base + gpio); }