Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-15 Thread Marek Behún
On Wed, 15 Jul 2020 19:07:27 +0200 Marek Behún wrote: > This should instead check: > the names are same and both trigger have the same type (either none > or same). In that case return -EEXIST. My bad, this is of course wrong. -EEXIST should be returned if the names are same and triggers hav

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-15 Thread Marek Behún
On Sat, 11 Jul 2020 12:04:09 +0200 Pavel Machek wrote: > What about this? Should address Marek's concerns about resource use... > > Best regards, > Pavel > ... > @@ -280,7 +291,8 @@ int led_trigger_register(struct led_trigger *trig

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-13 Thread Pavel Machek
On Mon 2020-07-13 01:18:41, Marek Behun wrote: > On Mon, 13 Jul 2020 01:15:44 +0200 > Marek Behun wrote: > > > On Mon, 13 Jul 2020 00:38:21 +0200 > > Ondřej Jirman wrote: > > > > > So after trying to use this, this seems to disallow the use of multiple HW > > > triggers per LED. That's fine by

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Ondřej Jirman
Hello Pavel, On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > > > So.. 48 triggers on Marek's systems means I'll not apply your patch. > > > > > > Please take a look at my version, it is as simple and avoids that > > > problem. > > > > I would, but I don't see your version linked

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Ondřej Jirman
On Mon, Jul 13, 2020 at 01:15:44AM +0200, Marek Behun wrote: > On Mon, 13 Jul 2020 00:38:21 +0200 > Ondřej Jirman wrote: > > > Hello, > > > > On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > [] > > > > > } > > > diff --git a/include/linux/l

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Marek Behun
On Mon, 13 Jul 2020 01:15:44 +0200 Marek Behun wrote: > On Mon, 13 Jul 2020 00:38:21 +0200 > Ondřej Jirman wrote: > > > So after trying to use this, this seems to disallow the use of multiple HW > > triggers per LED. That's fine by me, because using one HW sysfs configured > > trigger per LED t

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Marek Behun
On Mon, 13 Jul 2020 00:38:21 +0200 Ondřej Jirman wrote: > Hello, > > On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > > Hi! > > > > [] > > > } > > diff --git a/include/linux/leds.h b/include/linux/leds.h > > index 2451962d1ec5..cba52714558f 100644 > > --- a/in

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Ondřej Jirman
Hello, On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > Hi! > [] > } > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 2451962d1ec5..cba52714558f 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -57,6 +57,10 @@ struct led_in

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Ondřej Jirman
Hello Pavel, On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > Hi! > > > > > > > Some LED controllers may come with an internal HW triggering > > > > > > mechanism > > > > > > for the LED and an ability to switch between user control of the > > > > > > LED, > > > > > > or the inte

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Marek Behun
On Sun, 12 Jul 2020 21:11:11 +0200 Pavel Machek wrote: > Hi! > > > > > > > Some LED controllers may come with an internal HW triggering > > > > > > mechanism > > > > > > for the LED and an ability to switch between user control of the > > > > > > LED, > > > > > > or the internal control. One s

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Pavel Machek
Hi! > > > > > Some LED controllers may come with an internal HW triggering mechanism > > > > > for the LED and an ability to switch between user control of the LED, > > > > > or the internal control. One such example is AXP20X PMIC, that allows > > > > > wither for user control of the LED, or for

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Ondřej Jirman
Hello, On Sun, Jul 12, 2020 at 09:25:54AM +0200, Pavel Machek wrote: > On Sat 2020-07-11 23:01:11, Ondřej Jirman wrote: > > Hello Pavel, > > > > On Sat, Jul 11, 2020 at 12:04:09PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > Some LED controllers may come with an internal HW triggering mech

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-12 Thread Pavel Machek
On Sat 2020-07-11 23:01:11, Ondřej Jirman wrote: > Hello Pavel, > > On Sat, Jul 11, 2020 at 12:04:09PM +0200, Pavel Machek wrote: > > Hi! > > > > > Some LED controllers may come with an internal HW triggering mechanism > > > for the LED and an ability to switch between user control of the LED, >

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-11 Thread Ondřej Jirman
Hello Pavel, On Sat, Jul 11, 2020 at 12:04:09PM +0200, Pavel Machek wrote: > Hi! > > > Some LED controllers may come with an internal HW triggering mechanism > > for the LED and an ability to switch between user control of the LED, > > or the internal control. One such example is AXP20X PMIC, tha

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-11 Thread Pavel Machek
Hi! > Some LED controllers may come with an internal HW triggering mechanism > for the LED and an ability to switch between user control of the LED, > or the internal control. One such example is AXP20X PMIC, that allows > wither for user control of the LED, or for internal control based on > the

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-08 Thread Marek Behún
On Sat, 4 Jul 2020 14:59:00 +0200 Pavel Machek wrote: > Hi! > > > Some criticism to this approach to HW triggers: > > - every hw trigger for each LED has to be registered via current > > trigger API. This will grow code size and memory footprint once > > this API is widely used > > - one HW trig

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-08 Thread Marek Behún
Hi Ondrej, I overlooked your reply in my inbox, sorry this took so long. On Fri, 3 Jul 2020 15:08:09 +0200 Ondřej Jirman wrote: > Do you have such a switch? Also what's your real usecase? Yes, on Turris MOX three 8-port ethernet switches can be plugged, resulting in 24 ethernet ports, each hav

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-04 Thread Pavel Machek
Hi! > > > Add support for registering per-LED device trigger. > > > > > > Names of private triggers need to be globally unique, but may clash > > > with other private triggers. This is enforced during trigger > > > > Globally unique name is going to be a problem, no? If you have two > > keyboard

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-04 Thread Pavel Machek
Hi! > Some criticism to this approach to HW triggers: > - every hw trigger for each LED has to be registered via current trigger > API. This will grow code size and memory footprint once this API is > widely used > - one HW trigger can only master one LED device (via private_led > member). S

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-04 Thread Ondřej Jirman
Hello, On Sat, Jul 04, 2020 at 02:04:59PM +0200, Pavel Machek wrote: > Hi! > > > Add support for registering per-LED device trigger. > > > > Names of private triggers need to be globally unique, but may clash > > with other private triggers. This is enforced during trigger > > Globally unique n

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-04 Thread Pavel Machek
Hi! > Add support for registering per-LED device trigger. > > Names of private triggers need to be globally unique, but may clash > with other private triggers. This is enforced during trigger Globally unique name is going to be a problem, no? If you have two keyboards with automatical backlight

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-03 Thread Ondřej Jirman
Hello Marek, On Fri, Jul 03, 2020 at 12:06:02PM +0200, Marek Behún wrote: > On Thu, 2 Jul 2020 16:47:11 +0200 > Ondrej Jirman wrote: > > > Some LED controllers may come with an internal HW triggering mechanism > > for the LED and an ability to switch between user control of the LED, > > or the

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-03 Thread Marek Behún
On Thu, 2 Jul 2020 16:47:11 +0200 Ondrej Jirman wrote: > Some LED controllers may come with an internal HW triggering mechanism > for the LED and an ability to switch between user control of the LED, > or the internal control. One such example is AXP20X PMIC, that allows > wither for user contro

Re: [PATCH RFC] leds: Add support for per-LED device triggers

2020-07-02 Thread Ondřej Jirman
Hi, On Thu, Jul 02, 2020 at 04:47:11PM +0200, megous hlavni wrote: > Some LED controllers may come with an internal HW triggering mechanism > for the LED and an ability to switch between user control of the LED, > or the internal control. One such example is AXP20X PMIC, that allows > wither for u

[PATCH RFC] leds: Add support for per-LED device triggers

2020-07-02 Thread Ondrej Jirman
Some LED controllers may come with an internal HW triggering mechanism for the LED and an ability to switch between user control of the LED, or the internal control. One such example is AXP20X PMIC, that allows wither for user control of the LED, or for internal control based on the state of the ba