linux-stable/drivers/iio
Hans de Goede e2648b3d17 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:48:09 +02:00
..
accel iio: accel: mxc4005: Interrupt handling fixes 2024-05-17 11:48:09 +02:00
adc iio:adc:ad7091r: Move exports into IIO_AD7091R namespace. 2024-02-23 08:41:52 +01:00
addac iio: add addac subdirectory 2023-08-26 15:26:47 +02:00
afe iio: afe: rescale: use s64 for temporary scale calculations 2022-04-08 14:39:49 +02:00
amplifiers
buffer
chemical iio:chemical:ccs811: rearrange iio trigger get and register 2022-06-29 08:59:51 +02:00
common iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2024-01-05 15:12:26 +01:00
dac iio: dac: build ad5758 driver when AD5758 is selected 2023-06-09 10:30:14 +02:00
dummy iio: dummy: iio_simple_dummy: check the return value of kstrdup() 2022-06-14 18:32:41 +02:00
frequency
gyro iio:imu:adis: Move exports into IIO_ADISLIB namespace 2023-01-14 10:15:58 +01:00
health iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw 2022-12-08 11:23:54 +01:00
humidity
imu iio:imu: adis16475: Fix sync mode setting 2024-05-17 11:48:09 +02:00
light iio: light: vcnl4035: fixed chip ID check 2023-06-09 10:30:13 +02:00
magnetometer iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC 2024-02-23 08:42:27 +01:00
multiplexer
orientation
position
potentiometer
potentiostat
pressure iio: pressure: ms5611: ms5611_prom_is_valid false negative bug 2023-10-25 11:54:15 +02:00
proximity iio: proximity: vl53l0x: Fix return value check of wait_for_completion_timeout 2022-06-14 18:32:32 +02:00
resolver
temperature iio: temperature: ltc2983: make bulk write buffer DMA-safe 2023-01-14 10:15:57 +01:00
trigger iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() 2022-11-25 17:45:51 +01:00
Kconfig iio: add addac subdirectory 2023-08-26 15:26:47 +02:00
Makefile iio: add addac subdirectory 2023-08-26 15:26:47 +02:00
TODO
iio_core.h
iio_core_trigger.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails 2022-12-02 17:40:02 +01:00
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c iio: inkern: only release the device node when done with it 2022-10-26 13:25:30 +02:00