From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
kernel@pengutronix.de,
Oliver Lang <Oliver.Lang@gossenmetrawatt.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH v2 2/4] iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR
Date: Thu, 10 Jun 2021 15:46:17 +0200 [thread overview]
Message-ID: <20210610134619.2101372-3-mkl@pengutronix.de> (raw)
In-Reply-To: <20210610134619.2101372-1-mkl@pengutronix.de>
From: Oliver Lang <Oliver.Lang@gossenmetrawatt.com>
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>
---
drivers/iio/light/ltr501.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 0ed3392a33cf..79898b72fe73 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1208,7 +1208,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 = <r501_info,
--
2.30.2
next prev parent reply other threads:[~2021-06-10 13:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 13:46 [PATCH v2 0/4] fix regmap, initialization of ltr559, endianness and mark structs as const Marc Kleine-Budde
2021-06-10 13:46 ` [PATCH v2 1/4] iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too Marc Kleine-Budde
2021-06-10 13:46 ` Marc Kleine-Budde [this message]
2021-06-10 13:46 ` [PATCH v2 3/4] iio: ltr501: ltr501_read_ps(): add missing endianness conversion Marc Kleine-Budde
2021-06-10 13:46 ` [PATCH v2 4/4] iio: ltr501: mark ltr501_chip_info as const Marc Kleine-Budde
2021-06-10 19:20 ` [PATCH v2 0/4] fix regmap, initialization of ltr559, endianness and mark structs " Nikita Travkin
2021-06-11 17:44 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210610134619.2101372-3-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=Oliver.Lang@gossenmetrawatt.com \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).