Revision 44e1e9f8e70506728b02a18e6d03599a6485d67f authored by Shuah Khan on 29 May 2012, 22:07:30 UTC, committed by Linus Torvalds on 29 May 2012, 23:22:32 UTC
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>
1 parent 49dca5a
History
File Mode Size
debug
events
gcov
irq
power
sched
time
trace
.gitignore -rw-r--r-- 63 bytes
Kconfig.freezer -rw-r--r-- 52 bytes
Kconfig.hz -rw-r--r-- 1.7 KB
Kconfig.locks -rw-r--r-- 4.4 KB
Kconfig.preempt -rw-r--r-- 2.1 KB
Makefile -rw-r--r-- 4.4 KB
acct.c -rw-r--r-- 16.5 KB
async.c -rw-r--r-- 9.0 KB
audit.c -rw-r--r-- 40.2 KB
audit.h -rw-r--r-- 5.5 KB
audit_tree.c -rw-r--r-- 21.7 KB
audit_watch.c -rw-r--r-- 14.2 KB
auditfilter.c -rw-r--r-- 33.3 KB
auditsc.c -rw-r--r-- 71.5 KB
backtracetest.c -rw-r--r-- 2.1 KB
bounds.c -rw-r--r-- 600 bytes
capability.c -rw-r--r-- 11.7 KB
cgroup.c -rw-r--r-- 145.4 KB
cgroup_freezer.c -rw-r--r-- 9.1 KB
compat.c -rw-r--r-- 30.3 KB
configs.c -rw-r--r-- 2.8 KB
cpu.c -rw-r--r-- 15.9 KB
cpu_pm.c -rw-r--r-- 6.5 KB
cpuset.c -rw-r--r-- 72.7 KB
crash_dump.c -rw-r--r-- 1.2 KB
cred.c -rw-r--r-- 22.4 KB
delayacct.c -rw-r--r-- 5.0 KB
dma.c -rw-r--r-- 3.6 KB
elfcore.c -rw-r--r-- 459 bytes
exec_domain.c -rw-r--r-- 4.3 KB
exit.c -rw-r--r-- 47.3 KB
extable.c -rw-r--r-- 3.9 KB
fork.c -rw-r--r-- 44.3 KB
freezer.c -rw-r--r-- 4.2 KB
futex.c -rw-r--r-- 70.8 KB
futex_compat.c -rw-r--r-- 4.5 KB
groups.c -rw-r--r-- 6.0 KB
hrtimer.c -rw-r--r-- 46.4 KB
hung_task.c -rw-r--r-- 5.3 KB
irq_work.c -rw-r--r-- 3.1 KB
itimer.c -rw-r--r-- 7.3 KB
jump_label.c -rw-r--r-- 10.8 KB
kallsyms.c -rw-r--r-- 14.2 KB
kexec.c -rw-r--r-- 39.6 KB
kfifo.c -rw-r--r-- 12.8 KB
kmod.c -rw-r--r-- 17.3 KB
kprobes.c -rw-r--r-- 56.4 KB
ksysfs.c -rw-r--r-- 5.1 KB
kthread.c -rw-r--r-- 12.5 KB
latencytop.c -rw-r--r-- 7.6 KB
lockdep.c -rw-r--r-- 102.9 KB
lockdep_internals.h -rw-r--r-- 4.5 KB
lockdep_proc.c -rw-r--r-- 17.0 KB
lockdep_states.h -rw-r--r-- 233 bytes
module.c -rw-r--r-- 89.7 KB
mutex-debug.c -rw-r--r-- 2.9 KB
mutex-debug.h -rw-r--r-- 1.7 KB
mutex.c -rw-r--r-- 13.2 KB
mutex.h -rw-r--r-- 1.3 KB
notifier.c -rw-r--r-- 16.0 KB
nsproxy.c -rw-r--r-- 5.9 KB
padata.c -rw-r--r-- 27.2 KB
panic.c -rw-r--r-- 10.9 KB
params.c -rw-r--r-- 21.7 KB
pid.c -rw-r--r-- 14.0 KB
pid_namespace.c -rw-r--r-- 5.9 KB
posix-cpu-timers.c -rw-r--r-- 41.1 KB
posix-timers.c -rw-r--r-- 29.1 KB
printk.c -rw-r--r-- 57.4 KB
profile.c -rw-r--r-- 16.7 KB
ptrace.c -rw-r--r-- 26.3 KB
range.c -rw-r--r-- 2.9 KB
rcu.h -rw-r--r-- 3.8 KB
rcupdate.c -rw-r--r-- 10.2 KB
rcutiny.c -rw-r--r-- 10.2 KB
rcutiny_plugin.h -rw-r--r-- 33.0 KB
rcutorture.c -rw-r--r-- 61.3 KB
rcutree.c -rw-r--r-- 84.5 KB
rcutree.h -rw-r--r-- 19.4 KB
rcutree_plugin.h -rw-r--r-- 69.1 KB
rcutree_trace.c -rw-r--r-- 13.8 KB
relay.c -rw-r--r-- 32.8 KB
res_counter.c -rw-r--r-- 4.7 KB
resource.c -rw-r--r-- 26.8 KB
rtmutex-debug.c -rw-r--r-- 4.7 KB
rtmutex-debug.h -rw-r--r-- 1.4 KB
rtmutex-tester.c -rw-r--r-- 8.7 KB
rtmutex.c -rw-r--r-- 26.3 KB
rtmutex.h -rw-r--r-- 1.1 KB
rtmutex_common.h -rw-r--r-- 3.3 KB
rwsem.c -rw-r--r-- 2.3 KB
seccomp.c -rw-r--r-- 13.7 KB
semaphore.c -rw-r--r-- 7.2 KB
signal.c -rw-r--r-- 85.4 KB
smp.c -rw-r--r-- 22.0 KB
smpboot.c -rw-r--r-- 1.2 KB
smpboot.h -rw-r--r-- 465 bytes
softirq.c -rw-r--r-- 22.0 KB
spinlock.c -rw-r--r-- 9.5 KB
srcu.c -rw-r--r-- 19.5 KB
stacktrace.c -rw-r--r-- 1.1 KB
stop_machine.c -rw-r--r-- 15.5 KB
sys.c -rw-r--r-- 49.7 KB
sys_ni.c -rw-r--r-- 5.8 KB
sysctl.c -rw-r--r-- 56.8 KB
sysctl_binary.c -rw-r--r-- 51.5 KB
taskstats.c -rw-r--r-- 16.0 KB
test_kprobes.c -rw-r--r-- 8.5 KB
time.c -rw-r--r-- 18.6 KB
timeconst.pl -rw-r--r-- 7.2 KB
timer.c -rw-r--r-- 49.4 KB
tracepoint.c -rw-r--r-- 19.7 KB
tsacct.c -rw-r--r-- 4.3 KB
uid16.c -rw-r--r-- 6.0 KB
up.c -rw-r--r-- 413 bytes
user-return-notifier.c -rw-r--r-- 1.3 KB
user.c -rw-r--r-- 5.0 KB
user_namespace.c -rw-r--r-- 15.3 KB
utsname.c -rw-r--r-- 2.5 KB
utsname_sysctl.c -rw-r--r-- 3.0 KB
wait.c -rw-r--r-- 8.2 KB
watchdog.c -rw-r--r-- 14.9 KB
workqueue.c -rw-r--r-- 104.4 KB
workqueue_sched.h -rw-r--r-- 311 bytes

back to top