PM: Add user-space wake lock api.
This adds /sys/power/wake_lock and /sys/power/wake_unlock.
Writing a string to wake_lock creates a wake lock the
first time is sees a string and locks it. Optionally, the
string can be followed by a timeout.
To unlock the wake lock, write the same string to wake_unlock.
Change-Id: I66c6e3fe6487d17f9c2fafde1174042e57d15cd7
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 491c2db..b6b9006 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -253,6 +253,17 @@
extern suspend_state_t requested_suspend_state;
#endif
+#ifdef CONFIG_USER_WAKELOCK
+ssize_t wake_lock_show(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf);
+ssize_t wake_lock_store(struct kobject *kobj, struct kobj_attribute *attr,
+ const char *buf, size_t n);
+ssize_t wake_unlock_show(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf);
+ssize_t wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr,
+ const char *buf, size_t n);
+#endif
+
#ifdef CONFIG_EARLYSUSPEND
/* kernel/power/earlysuspend.c */
void request_suspend_state(suspend_state_t state);