[lkml]   [2017]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.12 32/65] iio: accel: bmc150: Always restore device to normal mode after suspend-resume
4.12-stable review patch.  If anyone has any objections, please let me know.


From: Hans de Goede <>

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 <>
Reviewed-by: Srinivas Pandruvada <>
Signed-off-by: Jonathan Cameron <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/iio/accel/bmc150-accel-core.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -193,7 +193,6 @@ struct bmc150_accel_data {
struct regmap *regmap;
int irq;
struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS];
- atomic_t active_intr;
struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS];
struct mutex mutex;
u8 fifo_mode, watermark;
@@ -493,11 +492,6 @@ static int bmc150_accel_set_interrupt(st
goto out_fix_power_state;

- if (state)
- atomic_inc(&data->active_intr);
- else
- atomic_dec(&data->active_intr);
return 0;

@@ -1710,8 +1704,7 @@ static int bmc150_accel_resume(struct de
struct bmc150_accel_data *data = iio_priv(indio_dev);

- if (atomic_read(&data->active_intr))
- bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0);
+ bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0);

 \ /
  Last update: 2017-08-15 03:29    [W:0.236 / U:3.084 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site