linux-stable/drivers/iio
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
..
accel iio:accel:adis16201: Fix wrong axis assignment that prevents loading 2021-03-29 11:14:41 +01:00
adc 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
afe iio: afe: iio-rescale: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
amplifiers iio: amplifiers: hmc425a: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
buffer iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant 2021-03-25 19:13:52 +00:00
chemical iio: chemical: atlas: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
common Merge remote-tracking branch 'local/ib-iio-scmi-5.12-rc2-take3' into togreg 2021-03-26 10:23:46 +00:00
dac iio: dac: Convert powerdown read callbacks to sysfs_emit() 2021-03-29 11:12:30 +01:00
dummy iio: dummy: iio_simple_dummy_buffer: use triggered buffer core calls 2021-03-11 20:47:05 +00:00
frequency iio: frequency: adf4350: Remove redundant null check before clk_disable_unprepare 2021-01-09 21:52:46 +00:00
gyro 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
health iio: fix devm_iio_trigger_alloc with parent.cocci 2021-03-25 19:13:50 +00:00
humidity 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
imu iio: imu: inv_mpu6050: Use as standalone trigger 2021-03-29 11:18:45 +01:00
light 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
magnetometer iio:magnetometer: Add Support for ST IIS2MDC 2021-03-25 19:13:52 +00:00
multiplexer iio: multiplexer: iio-mux: Simplify with dev_err_probe() 2020-09-03 19:40:51 +01:00
orientation hid-sensors: Add more data fields for sensitivity checking 2021-03-11 20:47:09 +00:00
position iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common 2021-03-11 20:47:09 +00:00
potentiometer iio: use getter/setter functions 2021-03-11 20:47:07 +00:00
potentiostat iio: lmp91000: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
pressure iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
proximity iio: as3935: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
resolver iio:resolver:ad2s1200: Drop of_match_ptr protection 2020-09-21 18:41:31 +01:00
temperature 1st set of IIO/counter device support, features and cleanup in the 5.13 cycle 2021-03-26 12:09:47 +01:00
test iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
trigger iio: set default trig->dev.parent 2021-03-25 19:13:50 +00: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: core: Use sysfs_emit() (trivial bits) 2021-03-29 11:12:30 +01:00
industrialio-configfs.c
industrialio-core.c iio: __iio_format_value(): Convert to sysfs_emit_at() 2021-03-29 11:12:30 +01:00
industrialio-event.c iio: core: Use sysfs_emit() (trivial bits) 2021-03-29 11:12:30 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: core: Use sysfs_emit() (trivial bits) 2021-03-29 11:12:30 +01:00
industrialio-triggered-event.c
inkern.c iio: Provide iio_read_channel_processed_scale() API 2021-03-25 19:13:51 +00:00
Kconfig iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
Makefile iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
TODO iio: add a TODO 2020-03-08 17:28:53 +00:00