[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=McKc9PR-gDs5PtLJaibouwjm96Fiy37s_DC7_f_pdebpg@mail.gmail.com>
Date: Wed, 3 Sep 2025 18:14:39 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Yinbo Zhu <zhuyinbo@...ngson.cn>,
Hoan Tran <hoan@...amperecomputing.com>, Manivannan Sadhasivam <mani@...nel.org>,
Yang Shen <shenyang39@...wei.com>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-unisoc@...ts.infradead.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH RESEND 07/14] gpio: ts4800: use new generic GPIO chip API
On Wed, Sep 3, 2025 at 5:48 PM Andy Shevchenko
<andriy.shevchenko@...el.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
Powered by blists - more mailing lists