Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1711758
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.4 13/23] iio: accel: bmc150: Always restore device to normal mode after suspend-resume |
| Date | 2017-08-15 04:00 +0200 |
| Message-ID | <uezje-3jP-71@gated-at.bofh.it> (permalink) |
| References | <ueyGu-35K-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
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 | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -194,7 +194,6 @@ struct bmc150_accel_data {
struct device *dev;
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;
@@ -489,11 +488,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:
@@ -1704,8 +1698,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);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.4 00/23] 4.4.83-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 16/23] USB: Check for dropped connection before switching to full speed Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 15/23] uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 07/23] USB: serial: option: add D-Link DWM-222 device ID Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 02/23] mm: ratelimit PFNs busy info message Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 13/23] iio: accel: bmc150: Always restore device to normal mode after suspend-resume Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 18/23] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 [PATCH 4.4 17/23] usb: core: unlink urbs from the tail of the endpoints urb_list Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 04:00 +0200 Re: [PATCH 4.4 00/23] 4.4.83-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-15 12:50 +0200 Re: [PATCH 4.4 00/23] 4.4.83-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-15 20:10 +0200
csiph-web