Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3461616pxb; Mon, 16 Nov 2020 15:41:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWrnhcbvkFROVDs2cnd7IALiFLqJeaWry63jq7UDT27HfJh2GvOXm1MtFhG6cSowch+NNs X-Received: by 2002:a17:906:1497:: with SMTP id x23mr17813691ejc.457.1605570078846; Mon, 16 Nov 2020 15:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605570078; cv=none; d=google.com; s=arc-20160816; b=Uqs7uEnrBONQWvpSR/bGEX0AgMdMtEdX5G5LI5JaQcJsCMlLZVemNrsJmHQfgfplEH +KUkggMxTSMaKlBHzq610rVT8l7oU19He/xYuar4XhHHtayrq2Xf0ntVNE89iIsVXniH YYWrKqyiBRpaSL5BXi6VAZonlm2UwoJ6+fbM4O4LpwH2rl937x0H4UIZGcIwmitjPEfw RaX5s9lRVRXwGblnPxuHruuCCi9cVbYtP+F+5T3u7/zS24uLuiZvD40HBTJC7RH5Em00 ZguokAEh976zrMEg5oEtyF+BdQqg/zWRAqLDCpvvg1BnrvVaFkdjTZ76tUsGbb/8Pqyq j5aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PCTZxln1VKZDYtPBvimsiWg1lsnUSwv12kxkUAuwmrI=; b=IreakFaoIN24HWesCHvYxAcQJzrGK7/3TvouyJUNB0ozzs6XAFfQALX2Ch2Sq6dQ/Z lIx3RGV4dTrBmYHslvKlPSENDs7ufBAprI8d1OvXre0DHUjfqRfj9jYL/NMrSrJcJurF DgSGviOYauvGvU9S+3NFdHvbJP19TToRTGs2tc1SFBwnobeVRuWu40dkqnikF1Z0jO5f Gdijh7cpeWfgRYM9odlR8MXCp84kuhao1TqNwCaQWrEcNpQxS1Zuv+m87BcIHy7z5MB1 5MJR9eaYRpDaKn2BNdCuyKxzVzngaX8dt3v8+Kwja92A41z3zDuVDraiunUIA559yIjN ZNOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=sJ+vgHji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si13954488ejx.340.2020.11.16.15.40.56; Mon, 16 Nov 2020 15:41:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=sJ+vgHji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730355AbgKPXiM (ORCPT + 99 others); Mon, 16 Nov 2020 18:38:12 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:46893 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729977AbgKPXiM (ORCPT ); Mon, 16 Nov 2020 18:38:12 -0500 X-Greylist: delayed 5940 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Nov 2020 18:38:10 EST Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id BD383806A8; Tue, 17 Nov 2020 12:38:08 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1605569888; bh=PCTZxln1VKZDYtPBvimsiWg1lsnUSwv12kxkUAuwmrI=; h=From:To:Cc:Subject:Date; b=sJ+vgHjiIMKVl78mx6OaExKYrZRu0+9ffhe4d7d5hqJc98A0vHtZB1Pw5vqME7+9a f8X/bgg6QditR1aHGK+rFJeKxEmSkIkSTtnNOTnQaVd4jrB7UX5n3ESbFD2KYGN/i0 d3CAp7KiD7YSXdWCWWmF8dw9MAQbdkDXQtJtPUOx5tfRutr6oPYLMtVW1qlxdUw/Kc ryj2J05oDRiWJU+Nwnl4czHP6NJY646xJzrih/LsgJsnAOnFoZ66Zn2cQ9fvadj5J8 WG8AkzGdl8OAS162cSj8vVNxyCugJsS/8UQ12wvhrmVMXen0gfOll0OqBmlHPgudMj ecESL+D6tvj3A== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Tue, 17 Nov 2020 12:38:07 +1300 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.25]) by smtp (Postfix) with ESMTP id D572E13ED56; Tue, 17 Nov 2020 12:38:03 +1300 (NZDT) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 14032340FC9; Tue, 17 Nov 2020 12:38:04 +1300 (NZDT) From: Mark Tomlinson To: rjui@broadcom.com, sbranden@broadcom.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Tomlinson Subject: [PATCH] pinctrl: bcm: pinctrl-nsp-gpio: Fix setting GPIO as output Date: Tue, 17 Nov 2020 12:37:57 +1300 Message-Id: <20201116233757.15409-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When setting a GPIO pin to an output, it is important to set the value correctly before enabling the output so that a glitch is not seen on the pin. This glitch may be very short, but can be important if this is a reset signal. Fixes: 8bfcbbbcabe0 ("pinctrl: nsp: add gpio-a driver support for Broadco= m NSP SoC") Signed-off-by: Mark Tomlinson --- drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm= /pinctrl-nsp-gpio.c index a00a42a61a90..942f04ca4868 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -289,8 +289,8 @@ static int nsp_gpio_direction_output(struct gpio_chip= *gc, unsigned gpio, unsigned long flags; =20 raw_spin_lock_irqsave(&chip->lock, flags); - nsp_set_bit(chip, REG, NSP_GPIO_OUT_EN, gpio, true); nsp_set_bit(chip, REG, NSP_GPIO_DATA_OUT, gpio, !!(val)); + nsp_set_bit(chip, REG, NSP_GPIO_OUT_EN, gpio, true); raw_spin_unlock_irqrestore(&chip->lock, flags); =20 dev_dbg(chip->dev, "gpio:%u set output, value:%d\n", gpio, val); --=20 2.29.2