msm: pil: Add name and state sysfs nodes
Userspace wants to know when a peripheral is online and if it has
rebooted. Add support for two sysfs nodes, name and state, to
notify userspace when such events happen.
The intent is for userspace to poll() the state node waiting for
the state to change. Once the peripheral goes offline, poll()
should return and userspace knows that the peripheral has booted
again.
Add a name node so that userspace can easily iterate over all
devices in /sys/bus/pil/devices/ to know what peripheral is
in what state.
Change-Id: I33c9dd42419b2e960d58dd2cd04cd82ddc1f5d60
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/Documentation/ABI/testing/sysfs-bus-pil b/Documentation/ABI/testing/sysfs-bus-pil
new file mode 100644
index 0000000..797b2ea
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-pil
@@ -0,0 +1,18 @@
+What: /sys/bus/pil/devices/.../name
+Date: March 2012
+Contact: Stephen Boyd <sboyd@codeaurora.org>
+Description:
+ Shows the name of the peripheral used in pil_get().
+
+What: /sys/bus/pil/devices/.../state
+Date: March 2012
+Contact: Stephen Boyd <sboyd@codeaurora.org>
+Description:
+ Shows the state state of a peripheral. Current states
+ supported are:
+
+ OFFLINE - peripheral is offline
+ ONLINE - peripheral is online
+
+ This file supports poll() to detect when a peripheral changes
+ state.