iio: cros_ec: Reapply range at resume
authorGwendal Grignou <gwendal@chromium.org>
Wed, 27 May 2020 04:35:17 +0000 (21:35 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:41 +0000 (11:49 +0100)
commite7e3b9d23f3bc6774cce585ef4fcb02462e04065
tree4c3279b9dcd7fa1c8009f2f8df4ad748db14d625
parent79846e33aac15f1a1451bcf424b7a1cc22440a88
iio: cros_ec: Reapply range at resume

EC does not currently preserve range across sensor reinit.
If sensor is powered down at suspend, it will default to the EC default
range at resume, not the range set by the host.

Save range if modified, and apply at resume.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
drivers/iio/light/cros_ec_light_prox.c
drivers/iio/pressure/cros_ec_baro.c
include/linux/iio/common/cros_ec_sensors_core.h