iio: mma8452: avoid switching to active because of config change
authorMartin Kepplinger <martink@posteo.de>
Thu, 3 Mar 2016 08:24:02 +0000 (09:24 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 5 Mar 2016 17:22:16 +0000 (17:22 +0000)
commite866853d67868ac0f7e0779d19aaad07285c9ff3
treeb1bf6e737e28e33ade067b725544978608605b27
parent8b8ff3a6a6e2325662e3af174f54b47487d3ed75
iio: mma8452: avoid switching to active because of config change

The devices' config registers can only be changed in standby mode.
Up until now the driver just held the device *always* active, so for
changing a config it was *always* necessary to switch to standby.

For upcoming support for runtime pm, the device can as well be in standby
mode. Instead of putting runtime pm functions in there, just keep the
device in standby if it already is. This section is protected by a lock
after all.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/mma8452.c