summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Lang <Oliver.Lang@gossenmetrawatt.com>2021-06-10 16:46:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 17:17:29 +0300
commit51c1ab060fd08f8109a0ed7602e6328d2470aadb (patch)
treea7ed7b6cf7804b9c8c720f53c07d0e1549486145
parentb9bcecc967a355f6b985929f51df61d3d2588bd1 (diff)
downloadlinux-51c1ab060fd08f8109a0ed7602e6328d2470aadb.tar.xz
iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR
commit 421a26f3d7a7c3ca43f3a9dc0f3cb0f562d5bd95 upstream. The ltr559 chip uses only the lowest bit of the ALS_CONTR register to configure between active and stand-by mode. In the original driver BIT(1) is used, which does a software reset instead. This patch fixes the problem by using BIT(0) as als_mode_active for the ltr559 chip. Fixes: 8592a7eefa54 ("iio: ltr501: Add support for ltr559 chip") Signed-off-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-3-mkl@pengutronix.de Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/light/ltr501.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 714a34904ec6..0ab9bca229db 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1214,7 +1214,7 @@ static struct ltr501_chip_info ltr501_chip_info_tbl[] = {
.als_gain_tbl_size = ARRAY_SIZE(ltr559_als_gain_tbl),
.ps_gain = ltr559_ps_gain_tbl,
.ps_gain_tbl_size = ARRAY_SIZE(ltr559_ps_gain_tbl),
- .als_mode_active = BIT(1),
+ .als_mode_active = BIT(0),
.als_gain_mask = BIT(2) | BIT(3) | BIT(4),
.als_gain_shift = 2,
.info = &ltr501_info,