From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Alex Tran <alex.tran@oss.qualcomm.com>
Cc: Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Carpenter <error27@gmail.com>,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: Re: [PATCH v2] gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper
Date: Fri, 7 Aug 2026 00:58:59 +0300 [thread overview]
Message-ID: <anUDo61Y1ZkoUgRv@ashevche-desk.local> (raw)
In-Reply-To: <20260724-gpio-pinctrl-output-set-val-v2-1-cad55d025636@oss.qualcomm.com>
On Fri, Jul 24, 2026 at 09:42:28AM -0700, Alex Tran wrote:
> After successfully configuring gpio pin as output, set the
> requested initial output value via the existing gpio set
> wrapper, so that the pin is not left at its previous level.
...
> +static int pin_control_gpio_direction_output(struct gpio_chip *chip,
> + unsigned int offset, int val)
> +{
> + int ret;
> +
> + ret = pinctrl_gpio_direction_output(chip, offset);
> + if (ret)
> + return ret;
> +
> + return pin_control_gpio_set(chip, offset, val);
> +}
But this is a wrong order. First we should submit the value and
only _then_ set the direction. This is not glitch-free in such
an order. Granted, not all HW is well implemented.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-08-06 21:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 16:42 [PATCH v2] gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper Alex Tran
2026-07-25 14:01 ` Linus Walleij
2026-07-27 11:14 ` Bartosz Golaszewski
2026-08-06 21:59 ` Andy Shevchenko
2026-08-06 21:58 ` Andy Shevchenko [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=anUDo61Y1ZkoUgRv@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=alex.tran@oss.qualcomm.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=error27@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=takahiro.akashi@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).