linux-stable/drivers/iio
Alexandru Ardelean 3ce868bb05 iio: accel: bma220: make suspend state setting more robust
The datasheet mentions that the suspend mode is toggled by reading the
suspend register. The reading returns value 0xFF if the system was in
suspend mode, otherwise it returns value 0x00.

The bma220_deinit() function does up to 2 reads, in case the device was in
suspend mode, which suggests a level of paranoia that makes the logic in
bma220_suspend() and bma220_resume() look insufficient.

This change implements a bma220_power() function which does up to 2 reads
of the suspend register to make sure that the chip enters a desired
(suspended or normal) mode.

If the transition fails, then -EBUSY is returned.

Since only a reference to SPI device is required, we can remove the
spi_set_drvdata() call and get the SPI device object from the base device
object in the suspend/resume routines.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210625140137.362282-2-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-07-19 09:51:59 +01:00
..
accel iio: accel: bma220: make suspend state setting more robust 2021-07-19 09:51:59 +01:00
adc iio: adc: rockchip_saradc: add support for rk3568 saradc 2021-07-17 18:03:39 +01:00
afe iio: afe: iio-rescale: Support processed channels 2021-06-03 18:24:13 +01:00
amplifiers iio: amplifiers: hmc425a: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
buffer iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
cdc iio:cdc:ad7150: Fix use of uninitialized ret 2021-04-07 08:36:39 +01:00
chemical iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get() 2021-06-16 14:53:13 +01:00
common iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
dac iio: dac: ad5624r: Fix incorrect handling of an optional regulator. 2021-07-19 09:51:58 +01:00
dummy iio: dummy: Fix build error when CONFIG_IIO_TRIGGERED_BUFFER is not set 2021-06-13 17:00:17 +01:00
frequency iio: frequency: adf4350: disable reg and clk on error in adf4350_probe() 2021-06-13 17:00:17 +01:00
gyro iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
health iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
humidity iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
imu iio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get() 2021-06-16 14:53:13 +01:00
light iio: light: adjd_s311: convert probe to device-managed functions 2021-07-17 18:44:18 +01:00
magnetometer iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
multiplexer iio: multiplexer: iio-mux: Simplify with dev_err_probe() 2020-09-03 19:40:51 +01:00
orientation iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
position iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
potentiometer iio: use getter/setter functions 2021-03-11 20:47:07 +00:00
potentiostat iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:30 +01:00
pressure iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
proximity iio: proximity: rfd77402: convert probe to device-managed functions 2021-07-17 18:49:30 +01:00
resolver iio:resolver:ad2s1200: Drop of_match_ptr protection 2020-09-21 18:41:31 +01:00
temperature iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
test iio: Remove a cast in iio-test-format which is no longer required 2021-06-23 16:38:24 -06:00
trigger iio: trigger: stm32-timer: Convert sysfs sprintf/snprintf family to sysfs_emit 2021-05-17 13:49:05 +01:00
iio_core.h iio: buffer: fix use-after-free for attached_buffers array 2021-03-25 19:13:51 +00:00
iio_core_trigger.h iio: core-trigger: make iio_device_register_trigger_consumer() an int return 2021-03-11 20:47:02 +00:00
industrialio-buffer.c iio: buffer: Move a sanity check at the beginning of 'iio_scan_mask_set()' 2021-07-17 17:57:46 +01:00
industrialio-configfs.c
industrialio-core.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
industrialio-event.c iio:event: Add timeout event info type 2021-04-07 08:36:36 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: core: move @trig_readonly from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
industrialio-triggered-event.c iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
inkern.c iio: core: move @info_exist_lock to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
Kconfig iio:cdc:ad7150: Move driver out of staging. 2021-04-07 08:36:37 +01:00
Makefile iio:cdc:ad7150: Move driver out of staging. 2021-04-07 08:36:37 +01:00
TODO