[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200826095247.16368-1-ceggers@arri.de>
Date: Wed, 26 Aug 2020 11:52:48 +0200
From: Christian Eggers <ceggers@...i.de>
To: Jonathan Cameron <jic23@...nel.org>
CC: Andy Shevchenko <andy.shevchenko@...il.com>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
"Peter Meerwald-Stadler" <pmeerw@...erw.net>,
<linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Christian Eggers <ceggers@...i.de>
Subject: [PATCH] iio: light: as73211: Fix AS73211_CREG1_GAIN_1
Wrong value was introduced during review process.
Signed-off-by: Christian Eggers <ceggers@...i.de>
---
Patch against jic23/iio.git, branch testing
drivers/iio/light/as73211.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c
index 3383aaacbf52..e76747b99b92 100644
--- a/drivers/iio/light/as73211.c
+++ b/drivers/iio/light/as73211.c
@@ -56,7 +56,7 @@
#define AS73211_AGEN_MUT(x) FIELD_PREP(AS73211_AGEN_MUT_MASK, (x))
#define AS73211_CREG1_GAIN_MASK GENMASK(7, 4)
-#define AS73211_CREG1_GAIN_1 13
+#define AS73211_CREG1_GAIN_1 11
#define AS73211_CREG1_TIME_MASK GENMASK(3, 0)
#define AS73211_CREG3_CCLK_MASK GENMASK(1, 0)
@@ -217,7 +217,7 @@ static void as73211_integration_time_calc_avail(struct as73211_data *data)
static unsigned int as73211_gain(struct as73211_data *data)
{
- /* gain can be calculated from CREG1 as 2^(13 - CREG1_GAIN) */
+ /* gain can be calculated from CREG1 as 2^(11 - CREG1_GAIN) */
return BIT(AS73211_CREG1_GAIN_1 - FIELD_GET(AS73211_CREG1_GAIN_MASK, data->creg1));
}
@@ -473,7 +473,7 @@ static int _as73211_write_raw(struct iio_dev *indio_dev,
if (val < 0 || !is_power_of_2(val) || val2)
return -EINVAL;
- /* gain can be calculated from CREG1 as 2^(13 - CREG1_GAIN) */
+ /* gain can be calculated from CREG1 as 2^(11 - CREG1_GAIN) */
reg_bits = AS73211_CREG1_GAIN_1 - ilog2(val);
if (!FIELD_FIT(AS73211_CREG1_GAIN_MASK, reg_bits))
return -EINVAL;
--
Christian Eggers
Embedded software developer
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
Powered by blists - more mailing lists