Skip to contentSkip to conversation

Patch "iio: accel: bmc150: Always restore device to normal mode after suspend-resume" has been added to the 4.12-stable tree

PATCH [email protected] 1 participant 1 message Aug 14, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: accel: bmc150: Always restore device to normal mode after suspend-resume

to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
iio-accel-bmc150-always-restore-device-to-normal-mode-after-suspend-resume.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e59e18989c68a8d7941005f81ad6abc4ca682de0 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Thu, 13 Jul 2017 15:13:41 +0200
Subject: iio: accel: bmc150: Always restore device to normal mode after suspend-resume

From: Hans de Goede <[email protected]>

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.

---
 drivers/iio/accel/bmc150-accel-core.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +1 -8
@@ -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;
 
 out_fix_power_state:
@@ -1710,8 +1704,7 @@ static int bmc150_accel_resume(struct de
 	struct bmc150_accel_data *data = iio_priv(indio_dev);
 
 	mutex_lock(&data->mutex);
-	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);
 	bmc150_accel_fifo_set_mode(data);
 	mutex_unlock(&data->mutex);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.12/iio-accel-bmc150-always-restore-device-to-normal-mode-after-suspend-resume.patch queue-4.12/iio-adc-revert-axp288-drop-bogus-axp288_adc_ts_pin_ctrl-register-modifications.patch queue-4.12/i2c-designware-some-broken-dstds-use-1mihz-instead-of-1mhz.patch