Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* How to synchronize leds in trigger
@ 2020-01-27 21:51 Oleh Kravchenko
  2020-01-28 19:58 ` Jacek Anaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2020-01-27 21:51 UTC (permalink / raw)
  To: linux-leds

[-- Attachment #1.1: Type: text/plain, Size: 409 bytes --]

Hello Linux LEDs developer!

I have two GPIO LEDs one is red another is blue.
I want that LEDs is blinking in pair.

Could you please advice how to achive this behaviour:
1. Red is active for 500 ms, Blue stays off.
2. Next step is Blue is active for 500 ms, Red is stays off.
3. Goto #1

I tried standard pattern trigger, but very quickly it miss matches.

-- 
Best regards,
Oleh Kravchenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: How to synchronize leds in trigger
  2020-01-27 21:51 How to synchronize leds in trigger Oleh Kravchenko
@ 2020-01-28 19:58 ` Jacek Anaszewski
  2020-01-30  7:57   ` Oleh Kravchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Jacek Anaszewski @ 2020-01-28 19:58 UTC (permalink / raw)
  To: Oleh Kravchenko, linux-leds

Hi Oleh,

On 1/27/20 10:51 PM, Oleh Kravchenko wrote:
> Hello Linux LEDs developer!
> 
> I have two GPIO LEDs one is red another is blue.
> I want that LEDs is blinking in pair.
> 
> Could you please advice how to achive this behaviour:
> 1. Red is active for 500 ms, Blue stays off.
> 2. Next step is Blue is active for 500 ms, Red is stays off.
> 3. Goto #1
> 
> I tried standard pattern trigger, but very quickly it miss matches.

Currently LED framework does not support that.
We would need a global pattern trigger, that would allow registering
a set of LEDs for events firing at different time slots.

It is feasible, but it would take months to agree upon interface
and implementation. The question is whether it wouldn't be an overkill.
What prevents you from solving this problem in userspace?

-- 
Best regards,
Jacek Anaszewski

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

* Re: How to synchronize leds in trigger
  2020-01-28 19:58 ` Jacek Anaszewski
@ 2020-01-30  7:57   ` Oleh Kravchenko
  2020-01-30  9:44     ` Marek Behun
  2020-01-30 10:37     ` Pavel Machek
  0 siblings, 2 replies; 6+ messages in thread
From: Oleh Kravchenko @ 2020-01-30  7:57 UTC (permalink / raw)
  To: Jacek Anaszewski, linux-leds

[-- Attachment #1.1: Type: text/plain, Size: 953 bytes --]

Hello Jacek,

On 28.01.20 21:58, Jacek Anaszewski wrote:
> Currently LED framework does not support that.
> We would need a global pattern trigger, that would allow registering
> a set of LEDs for events firing at different time slots.
>
> It is feasible, but it would take months to agree upon interface
> and implementation. The question is whether it wouldn't be an overkill.

I'm happy to invest my time to implement such functionality.
I think it can be really useful for LEDs array like CR0014114 <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.5&id=b9dd69155371ebd7055c182e30423edc9104239f>.

In few days I can publish my vision,
but before that could you please explain why it will took months?
Where it can be hard to implement?

> What prevents you from solving this problem in userspace?

User-space don't fast enough to provide correct timings.

-- 
Best regards,
Oleh Kravchenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: How to synchronize leds in trigger
  2020-01-30  7:57   ` Oleh Kravchenko
@ 2020-01-30  9:44     ` Marek Behun
  2020-01-31 16:39       ` Dan Murphy
  2020-01-30 10:37     ` Pavel Machek
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Behun @ 2020-01-30  9:44 UTC (permalink / raw)
  To: Oleh Kravchenko; +Cc: Jacek Anaszewski, linux-leds

On Thu, 30 Jan 2020 09:57:08 +0200
Oleh Kravchenko <oleg@kaa.org.ua> wrote:

> I'm happy to invest my time to implement such functionality.
> I think it can be really useful for LEDs array like CR0014114 <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.5&id=b9dd69155371ebd7055c182e30423edc9104239f>.
> 
> In few days I can publish my vision,
> but before that could you please explain why it will took months?
> Where it can be hard to implement?
> 

Just look at how long the API for RGB LEDs is being agreed upon. It is
over a year already, if not longer, and still not merged.

> > What prevents you from solving this problem in userspace?  
> 
> User-space don't fast enough to provide correct timings.
> 

Can you provide a video or something where we can see?

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

* Re: How to synchronize leds in trigger
  2020-01-30  7:57   ` Oleh Kravchenko
  2020-01-30  9:44     ` Marek Behun
@ 2020-01-30 10:37     ` Pavel Machek
  1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2020-01-30 10:37 UTC (permalink / raw)
  To: Oleh Kravchenko; +Cc: Jacek Anaszewski, linux-leds

Hi!

> > What prevents you from solving this problem in userspace?
> 
> User-space don't fast enough to provide correct timings.

That's hard to believe.

							Pavel



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

* Re: How to synchronize leds in trigger
  2020-01-30  9:44     ` Marek Behun
@ 2020-01-31 16:39       ` Dan Murphy
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-01-31 16:39 UTC (permalink / raw)
  To: Marek Behun, Oleh Kravchenko; +Cc: Jacek Anaszewski, linux-leds

Marek

On 1/30/20 3:44 AM, Marek Behun wrote:
> On Thu, 30 Jan 2020 09:57:08 +0200
> Oleh Kravchenko <oleg@kaa.org.ua> wrote:
>
>> I'm happy to invest my time to implement such functionality.
>> I think it can be really useful for LEDs array like CR0014114 <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.5&id=b9dd69155371ebd7055c182e30423edc9104239f>.
>>
>> In few days I can publish my vision,
>> but before that could you please explain why it will took months?
>> Where it can be hard to implement?
>>
> Just look at how long the API for RGB LEDs is being agreed upon. It is
> over a year already, if not longer, and still not merged.

Agreed. The patchset for RGB LEDs has been waiting since November for 
merge or even applied to led-next.  I rebased the patches and added the 
ACKs and resent.  Kinda hoped it would have made 5.6.

Dan


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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-27 21:51 How to synchronize leds in trigger Oleh Kravchenko
2020-01-28 19:58 ` Jacek Anaszewski
2020-01-30  7:57   ` Oleh Kravchenko
2020-01-30  9:44     ` Marek Behun
2020-01-31 16:39       ` Dan Murphy
2020-01-30 10:37     ` Pavel Machek

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git