linux/drivers/iio/imu/inv_mpu6050
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
..
inv_mpu_acpi.c iio: imu: inv_mpu6050: Drop double check for ACPI companion device 2020-06-14 11:49:32 +01:00
inv_mpu_aux.c iio: imu: inv_mpu6050: helpers for using i2c master on auxiliary bus 2019-10-05 12:06:16 +01:00
inv_mpu_aux.h iio: imu: inv_mpu6050: helpers for using i2c master on auxiliary bus 2019-10-05 12:06:16 +01:00
inv_mpu_core.c iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
inv_mpu_i2c.c iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
inv_mpu_iio.h iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
inv_mpu_magn.c iio: imu: inv_mpu6050: fix data polling interface 2020-03-08 17:28:38 +00:00
inv_mpu_magn.h iio: imu: inv_mpu6050: fix data polling interface 2020-03-08 17:28:38 +00:00
inv_mpu_ring.c iio:imu:inv_mpu6050: Use regmap_noinc_read for fifo reads. 2020-09-21 20:01:51 +01:00
inv_mpu_spi.c iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
inv_mpu_trigger.c iio: imu: inv_mpu6050: Use as standalone trigger 2021-03-29 11:18:45 +01:00
Kconfig iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
Makefile iio: imu: inv_mpu6050: add MPU925x magnetometer support 2019-10-05 12:14:20 +01:00