iio: mma8452: power saving features for v4.7

From: Martin Kepplinger
Date: Thu Mar 03 2016 - 03:26:51 EST


The accelerometers supported by mma8452 can use significantly less power if
configured accordingly. Let's make use of this:

* add support for runtime power management
(disabling the device after 2 seconds of inactivity), and
* add a "power_modes" property to IIO sysfs, that offers a "low_power"
*active* mode of operation that roughly consumes half the power of
the default mode.

If you don't have CONFIG_PM enabled, by default nothing changes for you.

Here's how it's done and tested on MMA8653FC:

[PATCH 1/4] iio: mma8452: coding style fixes
[PATCH 2/4] iio: mma8452: avoid switching to active because of config
[PATCH 3/4] iio: mma8452: add support for runtime power management
[PATCH 4/4] iio: mma8452: add low_power mode