1
linux/Documentation/leds
Shuah Khan 44e1e9f8e7 leds: add new transient trigger for one shot timer activation
The leds timer trigger does not currently have an interface to activate a
one shot timer.  The current support allows for setting two timers, one
for specifying how long a state to be on, and the second for how long the
state to be off.  The delay_on value specifies the time period an LED
should stay in on state, followed by a delay_off value that specifies how
long the LED should stay in off state.  The on and off cycle repeats until
the trigger gets deactivated.  There is no provision for one time
activation to implement features that require an on or off state to be
held just once and then stay in the original state forever.

Without one shot timer interface, user space can still use timer trigger
to set a timer to hold a state, however when user space application
crashes or goes away without deactivating the timer, the hardware will be
left in that state permanently.

As a specific example of this use-case, let's look at vibrate feature on
phones.  Vibrate function on phones is implemented using PWM pins on SoC
or PMIC.  There is a need to activate one shot timer to control the
vibrate feature, to prevent user space crashes leaving the phone in
vibrate mode permanently causing the battery to drain.

This trigger exports three properties, activate, state, and duration When
transient trigger is activated these properties are set to default values.

- duration allows setting timer value in msecs. The initial value is 0.
- activate allows activating and deactivating the timer specified by
  duration as needed. The initial and default value is 0.  This will allow
  duration to be set after trigger activation.
- state allows user to specify a transient state to be held for the specified
  duration.

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: NeilBrown <neilb@suse.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
..
00-INDEX Documentation: consolidate leds files to leds/ subdir 2011-04-04 17:51:47 -07:00
leds-class.txt Documentation: fix leds-class.txt duplicated word 2011-11-04 12:01:48 -07:00
leds-lp3944.txt Documentation: consolidate leds files to leds/ subdir 2011-04-04 17:51:47 -07:00
leds-lp5521.txt drivers/leds/leds-lp5521.c: support led pattern data 2012-03-23 16:58:34 -07:00
leds-lp5523.txt Documentation: led drivers lp5521 and lp5523 2010-11-12 07:55:32 -08:00
ledtrig-transient.txt leds: add new transient trigger for one shot timer activation 2012-05-29 16:22:32 -07:00