[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdagFrz=5fRUfVuaZJRsBao4UrObNa7VknS_hmOAsWFO+Q@mail.gmail.com>
Date: Mon, 24 Mar 2025 09:23:39 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Peng Fan <peng.fan@....com>
Cc: Johan Hovold <johan@...nel.org>, Steev Klimaszewski <steev@...i.org>,
"Peng Fan (OSS)" <peng.fan@....nxp.com>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Bartosz Golaszewski <brgl@...ev.pl>, Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
"linux-sound@...r.kernel.org" <linux-sound@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH 2/3] ASoC: codec: wcd938x: Convert to GPIO descriptors
On Mon, Mar 24, 2025 at 9:09 AM Peng Fan <peng.fan@....com> wrote:
> ok, then the only suspecting point is
> wcd938x->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_ASIS);
>
> I may need to use GPIOD_OUT_LOW to configure it
> to output as set raw set value as 1.
I think there may be a bug in gpiod_configure_flags() in gpiolib.c:
/* Process flags */
if (dflags & GPIOD_FLAGS_BIT_DIR_OUT)
ret = gpiod_direction_output_nonotify(desc,
!!(dflags & GPIOD_FLAGS_BIT_DIR_VAL));
else
ret = gpiod_direction_input_nonotify(desc);
Shouldn't this be:
if (dflags & GPIOD_FLAGS_BIT_DIR_OUT)
ret = gpiod_direction_output_nonotify(desc,
!!(dflags & GPIOD_FLAGS_BIT_DIR_VAL));
else if (dflags & GPIOD_FLAGS_BIT_DIR_SET)
ret = gpiod_direction_input_nonotify(desc);
?
As it looks, the line will be set into input mode unless explicitly
requested as output...
However this means the patch also has another bug: you need
to either:
1. Specify GPIO_OUT_LOW when requesting it or
2. Explicitly call gpiod_direction_out() before setting the value.
Yours,
Linus Walleij
Powered by blists - more mailing lists