Re: [PATCH 1/3] ASoC: wm8962: implement GPIO .get callback

From: Charles Keepax

Date: Mon Nov 30 2026 - 06:20:57 EST


On Fri, Nov 27, 2026 at 07:00:37PM +0200, Laurentiu Mihalcea wrote:
> + /*
> + * only GPIO5/GPIO6 can be used as inputs! Note the difference between the GPIO
> + * index and the register offset.
> + */
> + if (offset != 4 && offset != 5) {
> + dev_err(component->dev, "Only GPIO5/GPIO6 can be used as inputs!\n");
> + return -EINVAL;
> + }

I feel like it would be better to add a direction_input callback
and fail there for the other GPIOs. Better to not allow setting
the GPIO to an input than to error out whilst reading it.

Otherwise, I think this looks ok to me.

Thanks,
Charles