]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volat...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 10 Jun 2021 13:46:16 +0000 (15:46 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jun 2021 16:00:18 +0000 (17:00 +0100)
commit2ac0b029a04b673ce83b5089368f467c5dca720c
treef2166a44d4b5a28e0ee4a1cd2fc6439084bb2b1a
parentb4c166925d4c6177ca325f0721627c6c2e3f95e6
iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too

The regmap is configured for 8 bit registers, uses a RB-Tree cache and
marks several registers as volatile (i.e. do not cache).

The ALS and PS data registers in the chip are 16 bit wide and spans
two regmap registers. In the current driver only the base register is
marked as volatile, resulting in the upper register only read once.

Further the data sheet notes:

| When the I2C read operation starts, all four ALS data registers are
| locked until the I2C read operation of register 0x8B is completed.

Which results in the registers never update after the 2nd read.

This patch fixes the problem by marking the upper 8 bits of the ALS
and PS registers as volatile, too.

Fixes: 2f2c96338afc ("iio: ltr501: Add regmap support.")
Reported-by: Oliver Lang <Oliver.Lang@gossenmetrawatt.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Nikita Travkin <nikita@trvn.ru> # ltr559
Link: https://lore.kernel.org/r/20210610134619.2101372-2-mkl@pengutronix.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/ltr501.c