From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 4/4] ASoC: ac97: Convert to GPIO descriptors
Date: Thu, 22 Jan 2026 17:07:20 +0200 [thread overview]
Message-ID: <aXI9KKlohbA1ySB0@smile.fi.intel.com> (raw)
In-Reply-To: <20260122-sound-cleanup-v1-4-0a91901609b8@nxp.com>
On Thu, Jan 22, 2026 at 08:45:00PM +0800, Peng Fan (OSS) wrote:
> of_gpio.h is deprecated, update the driver to use GPIO descriptors.
> - Use devm_gpiod_get to get GPIO descriptor, and set consumer
> name.
>
> Since the driver still pass the reset_gpio to pxa27x_configure_ac97reset,
> so use desc_to_gpio() to get it gpio id.
GPIO
Why can't we convert that one to use GPIO descriptor to begin with?
...
> if (dev->dev.of_node) {
> - reset_gpio = of_get_named_gpio(dev->dev.of_node, "reset-gpios", 0);
> - if (reset_gpio == -ENOENT)
> + /* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
> + rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
> + ret = PTR_ERR(rst_gpio);
> + if (ret == -ENOENT)
> reset_gpio = -1;
> - else if (reset_gpio < 0)
> - return reset_gpio;
> + else if (ret)
> + return ret;
> + reset_gpio = desc_to_gpio(rst_gpio);
Also, have you considered moving towards 'reset-gpio' driver?
...
And last but not least Q, have you checked gpiolib-of.c if there is any quirks
regarding this case (might be some fixes related to polarity)?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-01-22 15:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 12:44 [PATCH 0/4] ASoC: codec: Remove ak4641/pxa2xx-ac97 and convert to GPIO descriptors Peng Fan (OSS)
2026-01-22 12:44 ` [PATCH 1/4] ASoC: codec: Remove ak4641 Peng Fan (OSS)
2026-01-22 15:03 ` Andy Shevchenko
2026-01-27 9:41 ` Bartosz Golaszewski
2026-01-22 12:44 ` [PATCH 2/4] ASoC: codec: Remove pxa2xx-ac97.c Peng Fan (OSS)
2026-01-22 15:00 ` Andy Shevchenko
2026-01-27 9:43 ` Bartosz Golaszewski
2026-01-22 12:44 ` [PATCH 3/4] ASoC: pxa2xx-ac97: Remove platform_data Peng Fan (OSS)
2026-01-22 14:58 ` Andy Shevchenko
2026-01-22 15:01 ` Andy Shevchenko
2026-01-22 12:45 ` [PATCH 4/4] ASoC: ac97: Convert to GPIO descriptors Peng Fan (OSS)
2026-01-22 15:07 ` Andy Shevchenko [this message]
2026-01-28 3:02 ` [PATCH 0/4] ASoC: codec: Remove ak4641/pxa2xx-ac97 and convert " Mark Brown
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=aXI9KKlohbA1ySB0@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=perex@perex.cz \
--cc=robert.jarzmik@free.fr \
--cc=tiwai@suse.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