Re: [PATCH v3 1/3] gpio: vf610: add support to DT 'ngpios' property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 18, 2024 at 10:04 AM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
>
> On Thu, Jan 18, 2024 at 10:25 AM Hector Palacios
> <hector.palacios@xxxxxxxx> wrote:
> > On 1/17/24 21:51, Andy Shevchenko wrote:
> > >> Some SoCs, such as i.MX93, don't have all 32 pins available
> > >> per port. Allow optional generic 'ngpios' property to be
> > >> specified from the device tree and default to
> > >> VF610_GPIO_PER_PORT (32) if the property does not exist.
>
> ...
>
> > >> +       ret = device_property_read_u32(dev, "ngpios", &ngpios);
> > >> +       if (ret || ngpios > VF610_GPIO_PER_PORT)
> > >> +               gc->ngpio = VF610_GPIO_PER_PORT;
> > >> +       else
> > >> +               gc->ngpio = (u16)ngpios;
> > >
> > > This property is being read by the GPIOLIB core. Why do you need to repeat this?
> >
> > My apologies; I had not seen this.
> > I'll use gpiochip_get_ngpios() on the next iteration.
>
> But still why?
> https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpiolib.c#L867
>
> It's called for every driver.
>
> Maybe it's needed to be refactored to allow fallbacks? Then can the
> GPIO MMIO case also be updated?
>

I guess it's because Hector wants to set an upper limit on the number of GPIOs?

Bart

> --
> With Best Regards,
> Andy Shevchenko





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux