[PATCH v3 2/5] iio: light: vcnl4000: clear DRDY interrupt when buffer disabled
From: Tsz Shan Chan
Date: Thu Sep 03 2026 - 00:58:59 EST
on vcnl4010/4020, interrupt status bits are cleared by writing 1 to the
corresponding bit in the ISR register. If data ready interrupt triggers
when the iio buffer is disabled, the DRDY bit is never cleared and the
interrupt line stays low.
Clear the DRDY bit in the interrupt handler when the buffer is disabled.
Signed-off-by: Tsz Shan Chan <tchan@xxxxxxxxxxxxxx>
---
drivers/iio/light/vcnl4000.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index cf55fe6afcba..c5f34e748e1a 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -1545,8 +1545,13 @@ static irqreturn_t vcnl4010_irq_thread(int irq, void *p)
isr & VCNL4010_INT_THR);
}
- if (isr & VCNL4010_INT_DRDY && iio_buffer_enabled(indio_dev))
- iio_trigger_poll_nested(indio_dev->trig);
+ if ((isr & VCNL4010_INT_DRDY)) {
+ if (iio_buffer_enabled(indio_dev))
+ iio_trigger_poll_nested(indio_dev->trig);
+ else
+ i2c_smbus_write_byte_data(data->client, VCNL4010_ISR,
+ isr & VCNL4010_INT_DRDY);
+ }
end:
return IRQ_HANDLED;
--
2.55.0