lkml.org 
[lkml]   [2023]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] drivers: iio: dac: ad5592r: add gpio_chip names
On Wed, 23 Nov 2022 20:48:32 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Thu, 17 Nov 2022 11:01:30 +0200
> Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
>
> > Add array of explicit gpio names for the `gpiochip` structure of
> > ad5592r, mainly for debug purposes.
> Can you give an example of when this is more useful than the offset?
> (which I'm assuming is also available when debugging?)
>
> Jonathan

This one is still outstanding in patchwork.

Antoniu, if you want this to be applied please address the question above.

Thanks,

Jonathan

>
> >
> > Since the gpios are configurable via the dts, generic names are
> > used.
> >
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
> > drivers/iio/dac/ad5592r-base.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
> > index 7a9b5fc1e579..076bc9ecfb49 100644
> > --- a/drivers/iio/dac/ad5592r-base.c
> > +++ b/drivers/iio/dac/ad5592r-base.c
> > @@ -124,6 +124,10 @@ static int ad5592r_gpio_request(struct gpio_chip *chip, unsigned offset)
> > return 0;
> > }
> >
> > +static const char * const ad5592r_gpio_names[] = {
> > + "GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7",
> > +};
> > +
> > static int ad5592r_gpio_init(struct ad5592r_state *st)
> > {
> > if (!st->gpio_map)
> > @@ -140,6 +144,7 @@ static int ad5592r_gpio_init(struct ad5592r_state *st)
> > st->gpiochip.set = ad5592r_gpio_set;
> > st->gpiochip.request = ad5592r_gpio_request;
> > st->gpiochip.owner = THIS_MODULE;
> > + st->gpiochip.names = ad5592r_gpio_names;
> >
> > mutex_init(&st->gpio_lock);
> >
>

\
 
 \ /
  Last update: 2023-03-27 00:00    [W:0.555 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site