OSDN Git Service
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>