Re: [PATCH 1/3] pinctrl: mediatek: Add gpio-range record in pinctrl driver

From: Andy Shevchenko

Date: Wed Nov 26 2025 - 13:06:53 EST


On Tue, Nov 25, 2025 at 10:36:34AM +0800, Lei Xue wrote:
> Kernel GPIO subsystem mapping hardware pin number to a different
> range of gpio number. Add gpio-range structure to hold
> the mapped gpio range in pinctrl driver. That enables the kernel
> to search a range of mapped gpio range against a pinctrl device.

...

> static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
> {
> struct gpio_chip *chip = &hw->chip;

> if (ret < 0)
> return ret;
>
> + mtk_pinctrl_gpio_range_init(hw, chip);
> +
> return 0;

We have a callback for that in struct gpio_chip. Any reason not to use it?

> }

...

> + pinctrl_add_gpio_range(hw->pctrl, &hw->range);

Not sure if this is needed.

--
With Best Regards,
Andy Shevchenko