linux-stable/drivers/iio
Hans de Goede 2a512ca151 iio: accel: mxc4005: Interrupt handling fixes
commit 57a1592784 upstream.

There are 2 issues with interrupt handling in the mxc4005 driver:

1. mxc4005_set_trigger_state() writes MXC4005_REG_INT_MASK1_BIT_DRDYE
(0x01) to INT_MASK1 to enable the interrupt, but to disable the interrupt
it writes ~MXC4005_REG_INT_MASK1_BIT_DRDYE which is 0xfe, so it enables
all other interrupt sources in the INT_SRC1 register. On the MXC4005 this
is not an issue because only bit 0 of the register is used. On the MXC6655
OTOH this is a problem since bit7 is used as TC (Temperature Compensation)
disable bit and writing 1 to this disables Temperature Compensation which
should only be done when running self-tests on the chip.

Write 0 instead of ~MXC4005_REG_INT_MASK1_BIT_DRDYE to disable
the interrupts to fix this.

2. The datasheets for the MXC4005 / MXC6655 do not state what the reset
value for the INT_MASK0 and INT_MASK1 registers is and since these are
write only we also cannot learn this from the hw. Presumably the reset
value for both is all 0, which means all interrupts disabled.

Explicitly set both registers to 0 from mxc4005_chip_init() to ensure
both masks are actually set to 0.

Fixes: 79846e33aa ("iio: accel: mxc4005: add support for mxc6655")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240326113700.56725-2-hdegoede@redhat.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-17 11:51:04 +02:00
..
accel iio: accel: mxc4005: Interrupt handling fixes 2024-05-17 11:51:04 +02:00
adc iio:adc:ad7091r: Move exports into IIO_AD7091R namespace. 2024-02-23 08:54:22 +01:00
addac iio: addac: stx104: Fix race condition when converting analog-to-digital 2023-08-26 14:23:27 +02:00
afe iio: afe: rescale: Accept only offset channels 2023-11-08 17:26:42 +01:00
amplifiers
buffer iio: triggered-buffer: prevent possible freeing of wrong buffer 2024-01-05 15:13:32 +01:00
cdc
chemical
common iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2024-01-05 15:13:32 +01:00
dac iio: dac: build ad5758 driver when AD5758 is selected 2023-06-09 10:32:28 +02:00
dummy
frequency
gyro
health
humidity
imu iio:imu: adis16475: Fix sync mode setting 2024-05-17 11:51:04 +02:00
light iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP 2024-02-23 08:55:03 +01:00
magnetometer iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC 2024-02-23 08:55:07 +01:00
multiplexer
orientation
position
potentiometer
potentiostat
pressure iio: pressure: ms5611: ms5611_prom_is_valid false negative bug 2023-10-19 23:05:36 +02:00
proximity
resolver
temperature
test
trigger
Kconfig iio: add addac subdirectory 2023-08-26 14:23:26 +02:00
Makefile iio: add addac subdirectory 2023-08-26 14:23:26 +02:00
TODO
iio_core.h
iio_core_trigger.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c iio: core: fix memleak in iio_device_register_sysfs 2024-02-23 08:55:07 +01:00
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c