OSDN Git Service

i2c-hid: Add an "enable" sysfs node to control runtime pm state
authorAndy Ross <andy.ross@windriver.com>
Tue, 17 Sep 2013 17:27:34 +0000 (10:27 -0700)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 18 Mar 2014 02:15:42 +0000 (10:15 +0800)
commit878763944cab5bcbf7dab601199430d8b828f424
tree8449183570b09089c5edd83c5933738d342a3bdd
parent44a03b34b1e3b1fce32d2ee15d98260457f1201c
i2c-hid: Add an "enable" sysfs node to control runtime pm state

Some devices (touchscreens) have high power requirements, and some
systems (Android) have architectures that allow the system policy to
declare a "non-interactive" mode where user input from the device
isn't needed.  Unfortunately the Android framework isn't set up to be
able to cleanly close and re-open the file descriptor to effect this,
so we have to do it in the driver.  Writing 0/1 to the "enable" sysfs
node essentially provides a userspace hook to the runtime PM state of
the device.

(Mergable for Android/HSW tree, but not acceptable to upstream.  This
kind of mechanism is typical in the Android world, where you have to
drive power state out of a HAL interface that doesn't interract with
the EventHub framework.  But the kernel prefers simply opening/closing
the device to indicate "in use" and leveraging the existing runtime PM
timeouts instead, which Android can't do without modification.
Basically, we have to carry either a simple out-of-tree kernel module
or a complicated change to Google's EventHub implementation, or else
find a way to do the latter and get it upstreamed.  Punt for now.)

Change-Id: I0a98d894d6c6dec4739dabeab0d4232421a373dc
Original-Change-Id: Ibe455e4f11af134f9f99b74a81426f9ca6332a2e
Issue: AXIA-4280
Signed-off-by: Andy Ross <andy.ross@windriver.com>
drivers/hid/i2c-hid/i2c-hid.c