linux-stable/drivers/iio/imu
Linus Walleij 454c219f5d iio: imu: inv_mpu6050: Use as standalone trigger
It may happen that the MPU6050 is the only hardware
trigger available on your system such as this:

> lsiio
Device 003: hscdtd008a
Device 001: mpu6050
Device 002: gp2ap002
Device 000: ab8500-gpadc
Trigger 000: mpu6050-dev1

And when you want to use it to read periodically from
your magnetometer like this:

> iio_generic_buffer -a -c 100 -n hscdtd008a -t mpu6050-dev1

Then the following happens:

[  209.951334] Internal error: Oops: 5 [#1] SMP ARM
(...)
[  209.981969] Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
[  209.988925] PC is at inv_scan_query_mpu6050+0x8/0xb8
[  209.993914] LR is at inv_mpu6050_set_enable+0x40/0x194

This is because since we are not using any channels from the
same device, the indio_dev->active_scan_mask is NULL.

Just checking for that and bailing out is however not enough:
we have to enable some kind of FIFO for the readout to work.
So enable the temperature as a dummy FIFO and all works
fine.

Not suitable for backporting to stable.  It is an odd corner case
and does not represent a regression.

Fixes: 09a642b785 ("Invensense MPU6050 Device Driver.")
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20210322132408.1003443-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-29 11:18:45 +01:00
..
bmi160 iio:imu:bmi160: Fix alignment and data leak issues 2020-12-03 19:40:28 +00:00
inv_icm42600 iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
inv_mpu6050 iio: imu: inv_mpu6050: Use as standalone trigger 2021-03-29 11:18:45 +01:00
st_lsm6dsx iio: imu: st_lsm6dsx: Drop unneeded explicit castings 2021-03-25 19:13:50 +00:00
adis.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
adis16400.c 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
adis16460.c iio: adis16460: Use Managed device functions 2020-09-16 19:06:09 +01:00
adis16475.c iio: adis: add helpers for locking 2021-03-11 20:47:12 +00:00
adis16480.c iio: adis: add helpers for locking 2021-03-11 20:47:12 +00:00
adis_buffer.c iio: adis: Move burst mode into adis_data 2020-09-21 20:01:45 +01:00
adis_trigger.c iio: adis_trigger: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
fxos8700.h
fxos8700_core.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
fxos8700_i2c.c iio: imu: fxos8700: Drop unneeded explicit castings 2021-03-25 19:13:50 +00:00
fxos8700_spi.c iio: imu: fxos8700: Drop unneeded explicit castings 2021-03-25 19:13:50 +00:00
Kconfig iio: imu: add Kconfig and Makefile for inv_icm42600 driver 2020-06-27 14:20:25 +01:00
kmx61.c iio: fix devm_iio_trigger_alloc with parent.cocci 2021-03-25 19:13:50 +00:00
Makefile iio: imu: add Kconfig and Makefile for inv_icm42600 driver 2020-06-27 14:20:25 +01:00