lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors
On Tue, Oct 10, 2023 at 7:39 PM Bartosz Golaszewski <brgl@bgdev.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.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2023-10-10 22:08    [W:4.489 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site