linux-stable/drivers/iio
Hans de Goede 5eba2638a2 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 12:02:31 +02:00
..
accel iio: accel: mxc4005: Interrupt handling fixes 2024-05-17 12:02:31 +02:00
adc iio: adc: rockchip_saradc: use mask for write_enable bitfield 2024-04-03 15:28:22 +02:00
addac iio: addac: Kconfig: update ad74413r selections 2023-10-05 18:06:45 +01:00
afe iio: afe: rescale: Accept only offset channels 2023-10-17 20:25:32 +01:00
amplifiers iio: amplifiers: ad8366: add support for HMC792A Attenuator 2023-07-23 12:22:56 +01:00
buffer iio: triggered-buffer: prevent possible freeing of wrong buffer 2024-01-01 12:42:38 +00:00
cdc iio: cdc: ad7150: relax return value check for IRQ get 2023-08-01 18:55:55 +01:00
chemical iio: chemical: scd4x: Add pressure compensation 2023-07-20 19:21:30 +01:00
common iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2024-01-01 12:42:37 +00:00
dac iio: dac: ad3552r: Correct device IDs 2023-09-11 20:12:59 +01:00
dummy
filter drivers: iio: filter: admv8818: add bypass mode 2023-08-08 09:51:06 +01:00
frequency iio: frequency: adf4350: Use device managed functions and fix power down issue. 2023-11-20 11:59:24 +01:00
gyro
health
humidity
imu iio:imu: adis16475: Fix sync mode setting 2024-05-17 12:02:31 +02:00
light iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP 2024-02-23 09:24:56 +01:00
magnetometer iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC 2024-02-23 09:25:06 +01:00
multiplexer
orientation
position
potentiometer iio: potentiometer: mcp4531: Use i2c_get_match_data() 2023-07-29 15:55:48 +01:00
potentiostat
pressure iio: pressure: Fixes BME280 SPI driver data 2024-05-17 12:02:31 +02:00
proximity iio: irsd200: fix -Warray-bounds bug in irsd200_trigger_handler 2023-10-05 18:06:45 +01:00
resolver
temperature iio: adc: Explicitly include correct DT includes 2023-07-23 13:38:13 +01:00
test
trigger iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() 2023-08-05 19:29:39 +01:00
Kconfig
Makefile
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 09:25:06 +01:00
industrialio-event.c iio: Add event enums for running period and count 2023-07-23 13:16:18 +01:00
industrialio-gts-helper.c iio: gts-helper: Fix division loop 2024-03-26 18:20:05 -04:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: Make return value check for set_trigger_state() consistent 2023-07-20 19:21:30 +01:00
industrialio-triggered-event.c
inkern.c iio: inkern: Add a helper to query an available minimum raw value 2023-07-09 22:48:17 +01:00