OSDN Git Service

iio: accel: bmc150: Always restore device to normal mode after suspend-resume
authorHans de Goede <hdegoede@redhat.com>
Thu, 13 Jul 2017 13:13:41 +0000 (15:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 20:43:20 +0000 (13:43 -0700)
commit1ca3869234d300b9a0543cf55dccce42c2fc77c1
tree64aec247a2fd6c5ca77f157fc733684306bf94e7
parentc5347390e57a19b4f25fc58f3c77e2cc15d2e47a
iio: accel: bmc150: Always restore device to normal mode after suspend-resume

commit e59e18989c68a8d7941005f81ad6abc4ca682de0 upstream.

After probe we would put the device in normal mode, after a runtime
suspend-resume we would put it back in normal mode. But for a regular
suspend-resume we would only put it back in normal mode if triggers
or events have been requested.  This is not consistent and breaks
reading raw values after a suspend-resume.

This commit changes the regular resume path to also unconditionally put
the device back in normal mode, fixing reading of raw values not working
after a regular suspend-resume cycle.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/accel/bmc150-accel-core.c