openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Multi-led configuration in dts
@ 2022-03-24 12:56 sri d
  2022-03-24 13:42 ` Alexander A. Filippov
  2022-04-26  5:12 ` Andrew Jeffery
  0 siblings, 2 replies; 5+ messages in thread
From: sri d @ 2022-03-24 12:56 UTC (permalink / raw)
  To: openbmc; +Cc: spinler, andrew, bradleyb, velumanit

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

Hi Team,

I am working on implementing Power and system identification LEDs, in which
LEDs are connected to GPIO pins directly. I need to handle two colors (blue
& yellow) for LEDs in *.dts file.
In phosphor-led-sysfs repo, whether multi-led configuration is handled ?
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml

As far as I analyzed, multi-led seems to work for dedicated LED controllers
and not for GPIO pins directly. Is there a way we can make it work for
directly connected GPIOs ?
https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.9-Multi-Color-LEDs

Thanks,
Jayashree

[-- Attachment #2: Type: text/html, Size: 5102 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Multi-led configuration in dts
  2022-03-24 12:56 Multi-led configuration in dts sri d
@ 2022-03-24 13:42 ` Alexander A. Filippov
  2022-03-30 16:04   ` Velumani T-ERS,HCLTech
  2022-04-26  5:12 ` Andrew Jeffery
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander A. Filippov @ 2022-03-24 13:42 UTC (permalink / raw)
  To: sri d; +Cc: spinler, andrew, openbmc, bradleyb, velumanit

On Thu, Mar 24, 2022 at 06:26:07PM +0530, sri d wrote:
> 
> Hi Team,
> 
> I am working on implementing Power and system identification LEDs, in which LEDs are connected to GPIO pins directly. I need to handle two colors (blue & yellow) for LEDs in *.dts file.
> In phosphor-led-sysfs repo, whether multi-led configuration is handled ? https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
> 

You could define them as two standalone LED and manage them separately.
It works fine even for a paired LED until you want to synchronized switching
(for example: the blinking of mixed color).


> As far as I analyzed, multi-led seems to work for dedicated LED controllers and not for GPIO pins directly. Is there a way we can make it work for directly connected GPIOs ?
> https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.9-Multi-Color-LEDs
> 

The multi-color LEDs are not supported by the gpio-led driver yet.

We have a desire to implement multi-color LED support in gpio-led driver, but
it's a low priority task and I can't tell when it will be done. :)

> Thanks,
> Jayashree

--
Cheers,
Alexander

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Multi-led configuration in dts
  2022-03-24 13:42 ` Alexander A. Filippov
@ 2022-03-30 16:04   ` Velumani T-ERS,HCLTech
  2022-03-31  9:33     ` Alexander A. Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Velumani T-ERS,HCLTech @ 2022-03-30 16:04 UTC (permalink / raw)
  To: Alexander A. Filippov, sri d
  Cc: spinler, andrew, openbmc, bradleyb, Patrick Williams

Classification: Public

Thanks for your response. There are two ways to get this done.
1. bring support in phosphor-led-sysfs for defining multi-color and use them in the application
2. Add support in multi-color led driver framework.
@Alexander @Andres Jefery Please provide your suggestions. We may be using this in multiple platforms. We can plan for the implementation.

Regards,
Velu

-----Original Message-----
From: Alexander A. Filippov <a.filippov@yadro.com>
Sent: Thursday, March 24, 2022 7:12 PM
To: sri d <srid.11486@gmail.com>
Cc: openbmc@lists.ozlabs.org; spinler@us.ibm.com; andrew@aj.id.au; bradleyb@fuzziesquirrel.com; Velumani T-ERS,HCLTech <velumanit@hcl.com>
Subject: Re: Multi-led configuration in dts

[CAUTION: This Email is from outside the Organization. Unless you trust the sender, Don't click links or open attachments as it may be a Phishing email, which can steal your Information and compromise your Computer.]

On Thu, Mar 24, 2022 at 06:26:07PM +0530, sri d wrote:
>
> Hi Team,
>
> I am working on implementing Power and system identification LEDs, in which LEDs are connected to GPIO pins directly. I need to handle two colors (blue & yellow) for LEDs in *.dts file.
> In phosphor-led-sysfs repo, whether multi-led configuration is handled
> ?
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2FDocumentation%2Fdevicetree
> %2Fbindings%2Fleds%2Fleds-class-multicolor.yaml&amp;data=04%7C01%7Cvel
> umanit%40hcl.com%7C6e6ac0bef1cd4f6b11e308da0d9c2064%7C189de737c93a4f5a
> 8b686f4ca9941912%7C0%7C0%7C637837261456946008%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3
> 000&amp;sdata=TnjigzS2VvhsqrJk%2Bp9UkXxi7aozqbfgdITZQpK7uxQ%3D&amp;res
> erved=0
>

You could define them as two standalone LED and manage them separately.
It works fine even for a paired LED until you want to synchronized switching (for example: the blinking of mixed color).


> As far as I analyzed, multi-led seems to work for dedicated LED controllers and not for GPIO pins directly. Is there a way we can make it work for directly connected GPIOs ?
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> phoronix.com%2Fscan.php%3Fpage%3Dnews_item%26px%3DLinux-5.9-Multi-Colo
> r-LEDs&amp;data=04%7C01%7Cvelumanit%40hcl.com%7C6e6ac0bef1cd4f6b11e308
> da0d9c2064%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C0%7C63783726145694
> 6008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
> iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=JyoXl7fN6eYe6G5optiYYPkYoAJ
> bRXByJufEgN%2F3hiI%3D&amp;reserved=0
>

The multi-color LEDs are not supported by the gpio-led driver yet.

We have a desire to implement multi-color LED support in gpio-led driver, but it's a low priority task and I can't tell when it will be done. :)

> Thanks,
> Jayashree

--
Cheers,
Alexander
::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Multi-led configuration in dts
  2022-03-30 16:04   ` Velumani T-ERS,HCLTech
@ 2022-03-31  9:33     ` Alexander A. Filippov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander A. Filippov @ 2022-03-31  9:33 UTC (permalink / raw)
  To: Velumani T-ERS,HCLTech
  Cc: spinler, sri d, andrew, openbmc, bradleyb, Patrick Williams,
	Alexander A. Filippov

On Wed, Mar 30, 2022 at 04:04:28PM +0000, Velumani T-ERS,HCLTech wrote:
> 
> Thanks for your response. There are two ways to get this done.
> 1. bring support in phosphor-led-sysfs for defining multi-color and use them in the application
> 2. Add support in multi-color led driver framework.
> @Alexander @Andres Jefery Please provide your suggestions. We may be using this in multiple platforms. We can plan for the implementation.

I had the similar question earlier:
https://lists.ozlabs.org/pipermail/openbmc/2021-October/028045.html
It looks like a preferred solution is 2.


> 
> Regards,
> Velu
> 

Cheers,
Alexander

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Multi-led configuration in dts
  2022-03-24 12:56 Multi-led configuration in dts sri d
  2022-03-24 13:42 ` Alexander A. Filippov
@ 2022-04-26  5:12 ` Andrew Jeffery
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Jeffery @ 2022-04-26  5:12 UTC (permalink / raw)
  To: sri d, openbmc; +Cc: Matt Spinler, Brad Bishop, Velumani T-ERS, HCLTech



On Thu, 24 Mar 2022, at 23:26, sri d wrote:
> Hi Team,
>
> I am working on implementing Power and system identification LEDs, in 
> which
> LEDs are connected to GPIO pins directly. I need to handle two colors 
> (blue
> & yellow) for LEDs in *.dts file.
> In phosphor-led-sysfs repo, whether multi-led configuration is handled ?
> https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml

I did a quick grep in phosphor-led-sysfs and there's no support for the 
multicolor sysfs attributes that I saw.

>
> As far as I analyzed, multi-led seems to work for dedicated LED controllers
> and not for GPIO pins directly. Is there a way we can make it work for
> directly connected GPIOs ?
> https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.9-Multi-Color-LEDs

I'm not sure whether this should be handled in the kernel or in 
userspace. From a conceptual standpoint (and from some background 
discussion with Patrick) it sounds like you're using two LEDs as one, 
operating with a small, well-defined set of states across the two. It 
feels like it would be nice if this was exposed to userspace as a 
single thing, though whether that's an LED or not is another matter.

The alternative is to come up with some way to identify pairs of LEDs 
via the devicetree (the obvious, cheap-and-nasty approach is to use 
pairs of LED names) and do the work in userspace.

I don't know which is better (maybe someone should write a design 
document analysing the trade-offs?) but it would get kind of awkward 
with the current phosphor-led-sysfs design which exposes one process 
per LED. This doesn't give you much (any) abstraction in terms of the 
DBus objects/interfaces involved. I think it would be nice if we had 
something a bit more coherent for this specific use case. Something to 
consider is reworking phosphor-led-sysfs such that it exposes all the 
LEDs in a single process (but is still dynamic and driven by udev under 
the covers - e.g. make the udev rule do DBus calls to poke the one 
phosphor-led-sysfs instance). From there you can handle the pairing 
internally and expose a coherent interface that drives both LEDs once 
both are found by userspace.

Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-26  5:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 12:56 Multi-led configuration in dts sri d
2022-03-24 13:42 ` Alexander A. Filippov
2022-03-30 16:04   ` Velumani T-ERS,HCLTech
2022-03-31  9:33     ` Alexander A. Filippov
2022-04-26  5:12 ` Andrew Jeffery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).