diff options
author | he, bo <bo.he@intel.com> | 2019-03-06 10:32:20 +0800 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-03-09 17:30:14 +0000 |
commit | fe2d3df639a7940a125a33d6460529b9689c5406 (patch) | |
tree | 541863f0e63c12e76fcc735e01e249f8318b6189 /drivers/iio/accel/kxcjk-1013.c | |
parent | 73f3bc6da506711302bb67572440eb84b1ec4a2c (diff) | |
download | lwn-fe2d3df639a7940a125a33d6460529b9689c5406.tar.gz lwn-fe2d3df639a7940a125a33d6460529b9689c5406.zip |
io: accel: kxcjk1013: restore the range after resume.
On some laptops, kxcjk1013 is powered off when system enters S3. We need
restore the range regiter during resume. Otherwise, the sensor doesn't
work properly after S3.
Signed-off-by: he, bo <bo.he@intel.com>
Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/kxcjk-1013.c')
-rw-r--r-- | drivers/iio/accel/kxcjk-1013.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 7096e577b23f..50f3ff386bea 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1437,6 +1437,8 @@ static int kxcjk1013_resume(struct device *dev) mutex_lock(&data->mutex); ret = kxcjk1013_set_mode(data, OPERATION); + if (ret == 0) + ret = kxcjk1013_set_range(data, data->range); mutex_unlock(&data->mutex); return ret; |