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

Andy Shevchenko
2025-11-26T18:07:05Z

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