[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkda=gb=u94CqYC8LuBtqg7x0eUVyJnuixLuyNonZ0=X3Kg@mail.gmail.com>
Date: Mon, 24 Mar 2025 08:30:09 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: 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-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-arm-msm@...r.kernel.org, Peng Fan <peng.fan@....com>
Subject: Re: [PATCH 1/3] ASoC: codec: wcd939x: Convert to GPIO descriptors
Hi Peng,
thanks for your patch, and thanks a *LOT* for working on the gpio descriptor
task!!
On Mon, Mar 24, 2025 at 3:28 AM Peng Fan (OSS) <peng.fan@....nxp.com> wrote:
> From: Peng Fan <peng.fan@....com>
>
> of_gpio.h is deprecated, update the driver to use GPIO descriptors.
> - Use dev_gpiod_get to get GPIO descriptor.
> - Use gpiod_set_value to configure output value.
>
> With legacy of_gpio API, the driver set gpio value 0 to assert reset,
> and 1 to deassert reset. And the reset-gpios use GPIO_ACTIVE_LOW flag in
> DTS, so set GPIOD_ASIS when get GPIO descriptors, and set value 1 means
> output low, set value 0 means output high with gpiod API.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
The patch as such is perfect:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
However we need to watch out for users:
$ git grep qcom,wcd939
arch/arm64/boot/dts/qcom/sm8650-hdk.dts: compatible =
"qcom,wcd9395-codec", "qcom,wcd9390-codec";
arch/arm64/boot/dts/qcom/sm8650-hdk.dts: compatible =
"qcom,wcd9395-usbss", "qcom,wcd9390-usbss";
reset-gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/qcom/sm8650-qrd.dts: compatible =
"qcom,wcd9395-codec", "qcom,wcd9390-codec";
arch/arm64/boot/dts/qcom/sm8650-qrd.dts: compatible =
"qcom,wcd9395-usbss", "qcom,wcd9390-usbss";
reset-gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
Mention in the commit message that the in-tree DTS files have the right
polarity set up already so we can expect this to "just work".
I would also mention that the current code in the driver is quite ugly:
it doesn't even request the GPIO before starting to use it :/
Yours,
Linus Walleij
Powered by blists - more mailing lists