[PATCH 1/3] pinctrl: mediatek: Add gpio-range record in pinctrl driver
Andy Shevchenko
andriy.shevchenko at intel.com
Wed Nov 26 10:06:47 PST 2025
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
More information about the Linux-mediatek
mailing list