From: Ray Jui <ray.jui@broadcom.com>
To: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>,
rjui@broadcom.com, sbranden@broadcom.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: bcm: pinctrl-iproc-gpio: Fix setting GPIO as output
Date: Mon, 16 Nov 2020 14:23:24 -0800 [thread overview]
Message-ID: <2d0ed323-d2c4-b60c-7f10-a313458e4656@broadcom.com> (raw)
In-Reply-To: <20201116215842.29488-1-mark.tomlinson@alliedtelesis.co.nz>
[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]
On 11/16/2020 1:58 PM, Mark Tomlinson wrote:
> 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: b64333ce769c ("pinctrl: cygnus: add gpio/pinconf driver")
> Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
> ---
> drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> index e2bd2dce6bb4..cadcf5eb0466 100644
> --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> @@ -348,8 +348,8 @@ static int iproc_gpio_direction_output(struct gpio_chip *gc, unsigned gpio,
> unsigned long flags;
>
> raw_spin_lock_irqsave(&chip->lock, flags);
> - iproc_set_bit(chip, IPROC_GPIO_OUT_EN_OFFSET, gpio, true);
> iproc_set_bit(chip, IPROC_GPIO_DATA_OUT_OFFSET, gpio, !!(val));
> + iproc_set_bit(chip, IPROC_GPIO_OUT_EN_OFFSET, gpio, true);
> raw_spin_unlock_irqrestore(&chip->lock, flags);
>
> dev_dbg(chip->dev, "gpio:%u set output, value:%d\n", gpio, val);
>
Thanks. The fix looks good. Would you be able to also help fix this in
pinctrl-nsp-gpio.c ?
Acked-by: Ray Jui <ray.jui@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4151 bytes --]
prev parent reply other threads:[~2020-11-16 22:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 21:58 Mark Tomlinson
2020-11-16 22:23 ` Ray Jui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d0ed323-d2c4-b60c-7f10-a313458e4656@broadcom.com \
--to=ray.jui@broadcom.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.tomlinson@alliedtelesis.co.nz \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®