[PATCH 4/4] ASoC: ac97: Convert to GPIO descriptors

Andy Shevchenko andriy.shevchenko at intel.com
Thu Jan 22 07:07:20 PST 2026


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





More information about the linux-arm-kernel mailing list