From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Mark Brown <broonie@kernel.org>, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code
Date: Wed, 6 May 2026 11:13:48 +0300 [thread overview]
Message-ID: <afr4PEk9OPpJnu49@ashevche-desk.local> (raw)
In-Reply-To: <20260505202426.3605262-2-arnd@kernel.org>
On Tue, May 05, 2026 at 10:24:25PM +0200, Arnd Bergmann wrote:
> There are no remaining static platform_device users of pxa2xx ac97,
> so the rest of that code path can go away as well.
>
> Since nothing in the driver uses the gpio number now, constrain the use
GPIO
> of the legacy gpio interface to the architecture specific code.
GPIO
...
> #include <sound/pcm.h>
> #include <sound/ac97_codec.h>
>
> -extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
> +extern void pxa27x_configure_ac97reset(struct gpio_desc *reset_gpio, bool to_gpio);
Looks like this is the only useful line in the header, hence while at it we may
drop 'extern'.
> #endif
...
> + if (cpu_is_pxa27x()) {
> /* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
> - rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
> - if (IS_ERR(rst_gpio)) {
> - ret = PTR_ERR(rst_gpio);
> - if (ret == -ENOENT)
> - reset_gpio = -1;
> - else if (ret)
> - return ret;
> - } else {
> - reset_gpio = desc_to_gpio(rst_gpio);
> - }
> - } else {
> - if (cpu_is_pxa27x())
> - reset_gpio = 113;
> - }
> + rst_gpio = devm_gpiod_get_optional(&dev->dev, "reset",
> + GPIOD_OUT_HIGH);
> + if (IS_ERR(rst_gpio))
> + return dev_err_probe(&dev->dev, PTR_ERR(rst_gpio),
> + "reset gpio failed\n");
I *slightly* tend to have my patch just as preparatory for this one as it does
one logical change, this one does another. But if you think it is not worth it,
okay then.
...
Now looking at this, I am not even sure that we need that if (cpu_is_pxa27x())
since optional GPIO will return NULL and everything should work as long as
there is no mistake in DT or platform code that provides the GPIO.
But such a change should be done carefully.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-05-06 8:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 20:24 [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
2026-05-05 23:58 ` Mark Brown
2026-05-06 8:15 ` Andy Shevchenko
2026-05-06 8:13 ` Andy Shevchenko [this message]
2026-05-05 20:24 ` [PATCH v2 3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx Arnd Bergmann
2026-05-06 1:14 ` [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing 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=afr4PEk9OPpJnu49@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--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