[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=Mc6ww7Te+JvzW_=+X9Tj_jjKnQaVRJMKgU4zTuXViPxcg@mail.gmail.com>
Date: Wed, 11 Oct 2023 09:59:14 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Duje Mihanović <duje.mihanovic@...le.hr>,
Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Russell King <linux@...linux.org.uk>,
Alan Stern <stern@...land.harvard.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andy@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Mark Brown <broonie@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-input@...r.kernel.org, linux-spi@...r.kernel.org
Subject: Re: [PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors
On Tue, Oct 10, 2023 at 10:04 PM Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Tue, Oct 10, 2023 at 7:39 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> > It doesn't seem like anyone is using these GPIOs once they're
> > requested? Wouldn't the above definitios be analogous to:
> >
> > GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, GPIO_ACTIVE_HIGH, GPIOD_ASIS)
> > GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, GPIO_ACTIVE_HIGH, GPIOD_ASIS)
>
> They are used:
> + spitz_gpio_leds[0].gpiod = leds->desc[0];
> + spitz_gpio_leds[1].gpiod = leds->desc[1];
>
> The descriptors are passed to the leds-gpio driver.
>
> But wait: no.
>
> This whole thing:
>
> +static struct gpio_descs *leds;
> +
> (...)
> + leds = gpiod_get_array_optional(&spitz_led_device.dev,
> + NULL, GPIOD_ASIS);
> + spitz_gpio_leds[0].gpiod = leds->desc[0];
> + spitz_gpio_leds[1].gpiod = leds->desc[1];
>
> Just delete all that.
>
> The leds-gpio driver will request and use the lines.
>
> It was just so unorthodox that I missed it. Adding the descriptor
> table is enough.
Ah, good catch. Your suggestion is of course the correct one.
Bart
>
> Yours,
> Linus Walleij
Powered by blists - more mailing lists