[PATCH RESEND 07/14] gpio: ts4800: use new generic GPIO chip API
Bartosz Golaszewski
brgl at bgdev.pl
Wed Sep 3 09:14:39 PDT 2025
On Wed, Sep 3, 2025 at 5:48 PM Andy Shevchenko
<andriy.shevchenko at intel.com> wrote:
>
> On Wed, Sep 03, 2025 at 05:44:59PM +0200, Andy Shevchenko wrote:
> > On Mon, Aug 25, 2025 at 11:48:48AM +0200, Bartosz Golaszewski wrote:
> > >
> > > Convert the driver to using the new generic GPIO chip interfaces from
> > > linux/gpio/generic.h.
>
> ...
>
> > > + config = (typeof(config)){
> >
> > First of all, what's wrong with the pattern used in the kernel when we
> > explicitly show the compound literal? Also we put a space before {.
> >
> > > + .dev = dev,
> > > + .sz = 2,
> > > + .dat = base_addr + INPUT_REG_OFFSET,
> > > + .set = base_addr + OUTPUT_REG_OFFSET,
> > > + .dirout = base_addr + DIRECTION_REG_OFFSET,
> > > + };
> > > +
> > > + retval = gpio_generic_chip_init(chip, &config);
> > > if (retval)
> > > - return dev_err_probe(dev, retval, "bgpio_init failed\n");
> > > + return dev_err_probe(dev, retval,
> > > + "failed to initialize the generic GPIO chip\n");
> >
> > Second, can't it all be hidden in the GPIOLIB just by passing the pointer to
> > the above initialised structure? Yes, it will take a pointer space in GPIO chip
> > for all, but I think it will reduce the burden.
>
> Okay, it seems the motivation is to make it in align with, e.g., gpio-regmap.
> But why not simply convert the drivers to use gpio-regmap instead?
>
Because the goal of this rework is removing the gpio-mmio fields out
of struct gpio_chip and also I can't test this conversion
functionally. Out of scope basically. But if you want to do the
conversion, I'm absolutely open to it. :)
Bart
More information about the linux-arm-kernel
mailing list