]>
Commit | Line | Data |
---|---|---|
91861a69 SL |
1 | From ac3e2f12d50f586a5d02459473fa0ca568a87cb6 Mon Sep 17 00:00:00 2001 |
2 | From: Axel Lin <axel.lin@ingics.com> | |
3 | Date: Thu, 10 Jan 2019 17:26:16 +0800 | |
4 | Subject: regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting | |
5 | ||
6 | [ Upstream commit f01a7beb6791f1c419424c1a6958b7d0a289c974 ] | |
7 | ||
8 | The act8600_sudcdc_voltage_ranges setting does not match the datasheet. | |
9 | ||
10 | The problems in below entry: | |
11 | REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000), | |
12 | ||
13 | 1. The off-by-one min_sel causes wrong volatage calculation. | |
14 | The min_sel should be 192. | |
15 | 2. According to the datasheet[1] Table 7. (on page 43): | |
16 | The selector 248 (0b11111000) ~ 255 (0b11111111) are 41.400V. | |
17 | ||
18 | Also fix off-by-one for ACT8600_SUDCDC_VOLTAGE_NUM. | |
19 | ||
20 | [1] https://active-semi.com/wp-content/uploads/ACT8600_Datasheet.pdf | |
21 | ||
22 | Fixes: df3a950e4e73 ("regulator: act8865: Add act8600 support") | |
23 | Signed-off-by: Axel Lin <axel.lin@ingics.com> | |
24 | Signed-off-by: Mark Brown <broonie@kernel.org> | |
25 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
26 | --- | |
27 | drivers/regulator/act8865-regulator.c | 5 +++-- | |
28 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
29 | ||
30 | diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c | |
31 | index f8d4cd3d1397..63a00d1d9360 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 | @@ -154,7 +154,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 | -- | |
54 | 2.19.1 | |
55 |