[PATCH v2] leds: add new transient trigger for one shot timeractivation

From: Shuah Khan
Date: Wed Apr 25 2012 - 13:42:39 EST


Second version of the patch to add new transient trigger to support
one shot timer activation. This trigger has two properties, activate
and duration. duration allows setting timer value in msecs. activate
allows activating and deactivating the timer specified by duration as
needed.

There was a suggestion to change units to seconds similar to "safe_delay_show"
and "safe_delay_store" in drivers/md/md.c. safe_delay_show shows time in
seconds, however safe_delay_store still takes the value in msecs. This
sounded like an asymmetric interface.

I decided to leave duration units as msecs to be consistent with the
rest of the triggers in the leds sub-system for now.

I also found couple of bugs in activate store causing it to cancel the
timer when it shouldn't and extending the timer when a second activate
comes in while timer is running.

Hope I addressed all of the review comments and didn't miss anything.
Thanks again for a good discussion and ideas.