On Thu, May 03, 2012 at 12:19:21PM -0600, Shuah Khan wrote:
> Sorry, forgot to Cc stable when the patch was sent to lkml. Please note
> this patch depends on 
> [PATCH 1/2] leds: add new field to led_classdev struct to save activation 
> state
> 
> ------------------------------------------------------------------------------
> 
> 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.
> 
> >From a8249a6738020823277ef02d7787e8078c17844b Mon Sep 17 00:00:00 2001
> From: Shuah Khan <shuahk...@gmail.com>
> Date: Mon, 30 Apr 2012 14:18:16 -0600
> Subject: [PATCH v3] leds: add new transient trigger for one shot timer
>  activation
> 
> 
> Signed-off-by: Shuah Khan <shuahk...@gmail.com>
> Cc: <stable@vger.kernel.org> v3.3
> Cc: <stable@vger.kernel.org> v3.2
> Cc: <stable@vger.kernel.org> v3.0
> ---
>  Documentation/leds/ledtrig-transient.txt |  152 +++++++++++++++++++
>  drivers/leds/Kconfig                     |    8 +
>  drivers/leds/Makefile                    |    1 +
>  drivers/leds/ledtrig-transient.c         |  237 
> ++++++++++++++++++++++++++++++
>  4 files changed, 398 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/leds/ledtrig-transient.txt
>  create mode 100644 drivers/leds/ledtrig-transient.c

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to