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

Fred-WY Chen (陳威宇)
2026-03-26T12:33:33Z

On Wed, 2025-11-26 at 19:06 +0100, Andy Shevchenko wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> 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.
>

Hi Deep,

Could you please check this and feedback?

Regards,
Fred-WY Chen

> --
> With Best Regards,
> Andy Shevchenko
>
>