* leds-gpio: no GPIO labels (in debugfs) @ 2016-11-30 16:24 ` Alexander Stein 2016-12-01 8:45 ` Jacek Anaszewski 0 siblings, 1 reply; 3+ messages in thread From: Alexander Stein @ 2016-11-30 16:24 UTC (permalink / raw) To: Richard Purdie; +Cc: Jacek Anaszewski, Pavel Machek, linux-leds Hi, I jut noticed that the used GPIOs for leds-gpio do not have an actual label which is visible in debugfs (/sys/kernel/debug/gpio): > gpiochip4: GPIOs 368-383, parent: spi/spi0.2, mcp23s17, can sleep: > gpio-369 P0.1 (? ) out hi > gpio-370 P0.2 (? ) out lo > gpio-371 P0.3 (? ) out lo > gpio-372 P0.4 (? ) out lo > gpio-373 P0.5 (? ) out lo > gpio-374 P0.6 (? ) out lo The reason is that the call to devm_get_gpiod_from_child() in gpio_leds_create() eventually calls "gpiod_request(desc, NULL);" in fwnode_get_named_gpiod. So no label attached to GPIO, hence "?" output. As we have already a gpiod in create_gpio_led(), devm_gpio_request_one() with the proper label is not called. I don't know much of that code, so what would be needed to have a proper GPIO label? And how? Best regards, Alexander Stein -- Dipl.-Inf. Alexander Stein SYS TEC electronic GmbH alexander.stein@systec-electronic.com Legal and Commercial Address: Am Windrad 2 08468 Heinsdorfergrund Germany Office: +49 (0) 3765 38600-0 Fax: +49 (0) 3765 38600-4100 Managing Directors: Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt; Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp Commercial Registry: Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: leds-gpio: no GPIO labels (in debugfs) 2016-11-30 16:24 ` leds-gpio: no GPIO labels (in debugfs) Alexander Stein @ 2016-12-01 8:45 ` Jacek Anaszewski 2016-12-02 12:51 ` Linus Walleij 0 siblings, 1 reply; 3+ messages in thread From: Jacek Anaszewski @ 2016-12-01 8:45 UTC (permalink / raw) To: Alexander Stein, Richard Purdie; +Cc: Pavel Machek, linux-leds, Linus Walleij Hi Alexander, On 11/30/2016 05:24 PM, Alexander Stein wrote: > Hi, > > I jut noticed that the used GPIOs for leds-gpio do not have an actual label > which is visible in debugfs (/sys/kernel/debug/gpio): >> gpiochip4: GPIOs 368-383, parent: spi/spi0.2, mcp23s17, can sleep: >> gpio-369 P0.1 (? ) out hi >> gpio-370 P0.2 (? ) out lo >> gpio-371 P0.3 (? ) out lo >> gpio-372 P0.4 (? ) out lo >> gpio-373 P0.5 (? ) out lo >> gpio-374 P0.6 (? ) out lo > > The reason is that the call to devm_get_gpiod_from_child() in > gpio_leds_create() eventually calls "gpiod_request(desc, NULL);" in > fwnode_get_named_gpiod. So no label attached to GPIO, hence "?" output. > > As we have already a gpiod in create_gpio_led(), devm_gpio_request_one() with > the proper label is not called. > I don't know much of that code, so what would be needed to have a proper GPIO > label? And how? From the LED subsystem perspective everything looks OK both in the case when label is defined and without it (node name is used for the LED class device name then). Since this seems to be an issue within GPIOLIB internals, I'm adding Linus Walleij. -- Best regards, Jacek Anaszewski ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: leds-gpio: no GPIO labels (in debugfs) 2016-12-01 8:45 ` Jacek Anaszewski @ 2016-12-02 12:51 ` Linus Walleij 0 siblings, 0 replies; 3+ messages in thread From: Linus Walleij @ 2016-12-02 12:51 UTC (permalink / raw) To: Jacek Anaszewski Cc: Alexander Stein, Richard Purdie, Pavel Machek, linux-leds@vger.kernel.org On Thu, Dec 1, 2016 at 9:45 AM, Jacek Anaszewski <j.anaszewski@samsung.com> wrote: > On 11/30/2016 05:24 PM, Alexander Stein wrote: >> I jut noticed that the used GPIOs for leds-gpio do not have an actual >> label >> which is visible in debugfs (/sys/kernel/debug/gpio): >>> >>> gpiochip4: GPIOs 368-383, parent: spi/spi0.2, mcp23s17, can sleep: >>> gpio-369 P0.1 (? ) out hi >>> gpio-370 P0.2 (? ) out lo >>> gpio-371 P0.3 (? ) out lo >>> gpio-372 P0.4 (? ) out lo >>> gpio-373 P0.5 (? ) out lo >>> gpio-374 P0.6 (? ) out lo >> >> The reason is that the call to devm_get_gpiod_from_child() in >> gpio_leds_create() eventually calls "gpiod_request(desc, NULL);" in >> fwnode_get_named_gpiod. So no label attached to GPIO, hence "?" output. >> >> As we have already a gpiod in create_gpio_led(), devm_gpio_request_one() >> with >> the proper label is not called. >> I don't know much of that code, so what would be needed to have a proper >> GPIO >> label? And how? > > From the LED subsystem perspective everything looks OK both > in the case when label is defined and without it (node name is > used for the LED class device name then). > > Since this seems to be an issue within GPIOLIB internals, > I'm adding Linus Walleij. The consumer label is entirely optional, it's just a very nice thing to get right for debugging and feeling you have everything in check on the system. So it's not a bug, it is an optional feature. If you want to fix it better looking I guess dig into the code :) Yours, Linus Walleij ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-02 12:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20161130162439epcas2p4c540b29ad1d0856e8c5a7155e4d999cf@epcas2p4.samsung.com>
2016-11-30 16:24 ` leds-gpio: no GPIO labels (in debugfs) Alexander Stein
2016-12-01 8:45 ` Jacek Anaszewski
2016-12-02 12:51 ` Linus Walleij
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.