]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.111/regulator-act8865-fix-act8600_sudcdc_voltage_ranges-.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / releases / 4.14.111 / regulator-act8865-fix-act8600_sudcdc_voltage_ranges-.patch
CommitLineData
04fd09d4
SL
1From 5f783c45fda520b47f54ba2eff63fd63eb8ac47f Mon Sep 17 00:00:00 2001
2From: Axel Lin <axel.lin@ingics.com>
3Date: Thu, 10 Jan 2019 17:26:16 +0800
4Subject: regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
5
6[ Upstream commit f01a7beb6791f1c419424c1a6958b7d0a289c974 ]
7
8The act8600_sudcdc_voltage_ranges setting does not match the datasheet.
9
10The problems in below entry:
11 REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000),
12
131. The off-by-one min_sel causes wrong volatage calculation.
14 The min_sel should be 192.
152. According to the datasheet[1] Table 7. (on page 43):
16 The selector 248 (0b11111000) ~ 255 (0b11111111) are 41.400V.
17
18Also fix off-by-one for ACT8600_SUDCDC_VOLTAGE_NUM.
19
20[1] https://active-semi.com/wp-content/uploads/ACT8600_Datasheet.pdf
21
22Fixes: df3a950e4e73 ("regulator: act8865: Add act8600 support")
23Signed-off-by: Axel Lin <axel.lin@ingics.com>
24Signed-off-by: Mark Brown <broonie@kernel.org>
25Signed-off-by: Sasha Levin <sashal@kernel.org>
26---
27 drivers/regulator/act8865-regulator.c | 5 +++--
28 1 file changed, 3 insertions(+), 2 deletions(-)
29
30diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
31index 7652477e6a9d..39e8d60df060 100644
32--- a/drivers/regulator/act8865-regulator.c
33+++ b/drivers/regulator/act8865-regulator.c
34@@ -131,7 +131,7 @@
35 * ACT8865 voltage number
36 */
37 #define ACT8865_VOLTAGE_NUM 64
38-#define ACT8600_SUDCDC_VOLTAGE_NUM 255
39+#define ACT8600_SUDCDC_VOLTAGE_NUM 256
40
41 struct act8865 {
42 struct regmap *regmap;
43@@ -222,7 +222,8 @@ static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = {
44 REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0),
45 REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000),
46 REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000),
47- REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000),
48+ REGULATOR_LINEAR_RANGE(19000000, 192, 247, 400000),
49+ REGULATOR_LINEAR_RANGE(41400000, 248, 255, 0),
50 };
51
52 static struct regulator_ops act8865_ops = {
53--
542.19.1
55