linux/drivers/iio/light
Mårten Lindahl 7e87ab38ee iio: light: vcnl4000: Don't power on/off chip in config
After enabling/disabling interrupts on the vcnl4040 chip the als and/or
ps sensor is powered on or off depending on the interrupt enable bits.
This is made as a last step in write_event_config.

But there is no reason to do this as the runtime PM handles the power
state of the sensors. Interfering with this may impact sensor readings.

Consider the following:
 1. Userspace makes sensor data reading which triggers RPM resume
    (sensor powered on) and a RPM suspend timeout. The timeout is 2000ms
    before RPM suspend powers the sensor off if no new reading is made
    within the timeout period.
 2. Userspace disables interrupts => powers sensor off
 3. Userspace reads sensor data = 0 because sensor is off and the
    suspend timeout has not passed. For each new reading made within the
    timeout period the timeout is renewed with 2000ms and RPM will not
    make a new resume (device was not suspended). So the sensor will
    not be powered on.
 4. No further userspace reading for 2000ms ends RPM suspend timeout and
    triggers suspend (powers off already powered off sensor).

Powering sensor off in (2) makes all consecutive readings made within
2000ms to the previous reading (3) return invalid data.

Skip setting power state when writing new event config.

Fixes: 546676121c ("iio: light: vcnl4000: Add interrupt support for vcnl4040")
Fixes: bc292aaf9c ("iio: light: vcnl4000: add illuminance irq vcnl4040/4200")
Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
Link: https://lore.kernel.org/r/20230907-vcnl4000-pm-fix-v2-1-298e01f54db4@axis.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-10-05 18:06:46 +01:00
..
acpi-als.c iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
adjd_s311.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
adux1020.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
al3010.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
al3320a.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
apds9300.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
apds9960.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
as73211.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
bh1750.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
bh1780.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
cm3232.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
cm3323.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
cm3605.c iio: adc: Remove redundant dev_err_probe() 2023-07-29 12:13:17 +01:00
cm32181.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
cm36651.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
cros_ec_light_prox.c iio: cros: Register FIFO callback after sensor is registered 2022-07-18 18:29:13 +01:00
gp2ap002.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
gp2ap020a00f.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
hid-sensor-als.c IIO: hid-sensor-als: Use generic usage 2022-12-20 15:24:57 +01:00
hid-sensor-prox.c IIO: hid-sensor-prox: Use generic usage 2022-12-20 15:24:57 +01:00
iqs621-als.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
isl29018.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
isl29028.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
isl29125.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
jsa1212.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
Kconfig iio: light: ROHM BU27008 color sensor 2023-05-23 21:20:17 +01:00
lm3533-als.c iio: lm3533: Use sysfs_emit() 2022-01-23 18:03:36 +00:00
ltr501.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
ltrf216a.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
lv0104cs.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
Makefile iio: light: ROHM BU27008 color sensor 2023-05-23 21:20:17 +01:00
max44000.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
max44009.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
noa1305.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
opt3001.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
opt4001.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
pa12203001.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
rohm-bu27008.c Merge 6.5-rc6 into char-misc-next 2023-08-13 22:14:51 +02:00
rohm-bu27034.c iio: light: bu27034: Fix scale format 2023-07-15 18:02:02 +01:00
rpr0521.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
si1133.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
si1145.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
st_uvis25.h iio:light:st_uvis25: Fix timestamp alignment and prevent data leak. 2020-12-03 19:40:27 +00:00
st_uvis25_core.c iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
st_uvis25_i2c.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
st_uvis25_spi.c iio: light: st_uvis25: Use EXPORT_NS_SIMPLE_DEV_PM_OPS() 2022-09-21 18:42:57 +01:00
stk3310.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tcs3414.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tcs3472.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tsl2563.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tsl2583.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tsl2591.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tsl2772.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
tsl4531.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
us5182d.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
vcnl4000.c iio: light: vcnl4000: Don't power on/off chip in config 2023-10-05 18:06:46 +01:00
vcnl4035.c 1st set of IIO new device support, features and cleanup for the 6.5 cycle. 2023-06-15 13:01:55 +02:00
veml6030.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
veml6070.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
vl6180.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
zopt2201.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00