On 4/4/2014 17:13, simon@xxxxxxxxxxxxx wrote:
I see the driver has a special case/function for setting blink with
'sony_led_blink_set()' which could be made to do funky stuff but that
might very rapidly become messy.
These software-only triggers are why I'm thinking it would be good to
have an extra global control for controlling the whole light bar
synchronously.
A while ago (summer 2012) I messed around with the idea of 'chaining'
(grouping) leds together into a linked list, such that any actions on the
head of the list were duplicated to all leds in the chain.
The chain was created by a new trigger 'chain' and given the parameter of
the led to follow. I got as far as some code (wanted to learn about linked
lists in the kernel), but don't remember whether it worked properly on
not.
In this use case we could 'chain' the red->blue, and then have the blue
trigger set as 'timer' (or 'heartbeat') to cause a 'off->purple' blinking.
This would remove the contention in your scheme of having two places/leds
('red' and 'all') which could be set differently.
I can see if there's still some code on my disk if others are interested
in the idea.
Simon.
This sounds kind of like how things work now: The blink function maps
all blink requests to any of the LEDs to one global value and uses that
to set the hardware delay on/off values.
I'd be interested in seeing your solution if you still have it, but that
still sounds like it still wouldn't work in the case of something like
the heartbeat trigger which doesn't actually use the blink function,
just runs it's own internal timer and just changes the brightness every
so often. The LED code in the module doesn't know where the commands
are coming from, just that it's being told to change brightness so it
wouldn't know which commands come from a trigger and should effect
everything vs which are user commands and should just change the
brightness of that specific LED.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html