kernel-hacking-2024-linux-s.../drivers/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
..
dell-led.c drivers/leds: Add module.h to files using it implicitly 2011-10-31 19:31:49 -04:00
Kconfig leds: add new transient trigger for one shot timer activation 2012-05-29 16:22:32 -07:00
led-class.c leds: simple_strtoul() cleanup 2012-05-29 16:22:31 -07:00
led-core.c led-class: change back LEDS_CLASS to tristate instead of bool 2012-03-23 16:58:35 -07:00
led-triggers.c driver-core: remove sysdev.h usage. 2011-12-21 16:26:03 -08:00
leds-88pm860x.c led: Modified power control of pm860x led 2012-03-06 18:46:53 +01:00
leds-adp5520.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-asic3.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-atmel-pwm.c leds-atmel-pwm.c: Make pwmled_probe() __devinit 2012-04-17 16:29:31 +02:00
leds-bd2802.c drivers/leds/leds-bd2802.c: use gpio_request_one() 2012-01-10 16:30:49 -08:00
leds-clevo-mail.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
leds-cobalt-qube.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-cobalt-raq.c drivers/leds: Add export.h for THIS_MODULE to leds-cobalt-raq.c 2011-10-31 19:31:50 -04:00
leds-da903x.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-da9052.c leds: driver for DA9052/53 PMIC v2 2012-05-29 16:22:31 -07:00
leds-dac124s085.c leds: convert leds-dac124s085 to module_spi_driver 2012-01-10 16:30:49 -08:00
leds-fsg.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-gpio-register.c leds: provide helper to register "leds-gpio" devices 2011-05-25 08:39:51 -07:00
leds-gpio.c drivers/leds/leds-gpio.c: use linux/gpio.h rather than asm/gpio.h 2012-03-23 16:58:35 -07:00
leds-hp6xx.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-lm3530.c drivers/leds/leds-lm3530.c: simplify als configuration on initialization 2012-05-29 16:22:32 -07:00
leds-locomo.c drivers/leds: Add module.h to files using it implicitly 2011-10-31 19:31:49 -04:00
leds-lp3944.c leds: convert led i2c drivers to module_i2c_driver 2012-01-10 16:30:48 -08:00
leds-lp5521.c drivers/leds/leds-lp5521.c: fix lp5521_read() error handling 2012-05-29 16:22:31 -07:00
leds-lp5523.c drivers/leds/leds-lp5523.c: constify some data 2012-03-23 16:58:35 -07:00
leds-lt3593.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-max8997.c leds: Add suuport for MAX8997-LED driver 2012-01-09 00:37:41 +01:00
leds-mc13783.c leds: Use kcalloc instead of kzalloc to allocate array 2012-05-29 16:22:31 -07:00
leds-net48xx.c drivers/leds: Add module.h to files using it implicitly 2011-10-31 19:31:49 -04:00
leds-netxbig.c drivers/leds: correct __devexit annotations 2012-05-10 15:06:44 -07:00
leds-ns2.c drivers/leds: correct __devexit annotations 2012-05-10 15:06:44 -07:00
leds-ot200.c leds: add led driver for Bachmann's ot200 2012-01-23 08:38:47 -08:00
leds-pca955x.c leds: convert led i2c drivers to module_i2c_driver 2012-01-10 16:30:48 -08:00
leds-pca9532.c leds: convert led i2c drivers to module_i2c_driver 2012-01-10 16:30:48 -08:00
leds-pca9633.c drivers/leds/leds-pca9633.c: remove unused 'adapter' variable 2012-03-23 16:58:35 -07:00
leds-pwm.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-rb532.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-regulator.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-renesas-tpu.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-s3c24xx.c leds: convert led platform drivers to module_platform_driver 2012-01-10 16:30:48 -08:00
leds-ss4200.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
leds-sunfire.c drivers/leds/leds-sunfire.c: fix sunfire_led_generic_probe() error handling 2011-07-25 20:57:15 -07:00
leds-tca6507.c drivers/leds/leds-tca6507.c: remove obsolete cleanup for clientdata 2012-03-23 16:58:34 -07:00
leds-wm831x-status.c leds: convert wm831x status driver to devm_kzalloc() 2012-01-10 16:30:49 -08:00
leds-wm8350.c leds: convert wm8350 driver to devm_kzalloc() 2012-01-10 16:30:49 -08:00
leds-wrap.c drivers/leds: Add module.h to files using it implicitly 2011-10-31 19:31:49 -04:00
leds.h leds: support automatic start of blinking with ledtrig-timer 2011-05-25 08:39:49 -07:00
ledtrig-backlight.c leds: change existing triggers to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-default-on.c
ledtrig-gpio.c leds: change existing triggers to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-heartbeat.c leds: heartbeat: stop on shutdown 2012-05-29 16:22:32 -07:00
ledtrig-ide-disk.c
ledtrig-timer.c leds: change ledtrig-timer to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-transient.c leds: add new transient trigger for one shot timer activation 2012-05-29 16:22:32 -07:00
Makefile leds: add new transient trigger for one shot timer activation 2012-05-29 16:22:32 -07:00