aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Bedel <alban.bedel@avionic-design.de>2014-05-20 06:14:03 -0400
committerMark Brown <broonie@linaro.org>2014-05-26 11:48:02 -0400
commit6c46ccc8bb0660c1805f6662d4646eb5405dcb2d (patch)
treef42f014c7145a25f8b768790b82ef8e93f2a7a7a
parentad0b40fee4081490676b26ec4fb2205607116eaf (diff)
regulator: tps6586x: Add support for the TPS658640
The TPS658640 has a different set of output voltage for most LDO and the RTC LDO isn't settable. This chip also report 2 different version ID, as the datasheet doesn't list the possible values the second ID has simply been named TPS658640v2. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/mfd/tps6586x.c4
-rw-r--r--drivers/regulator/tps6586x-regulator.c36
-rw-r--r--include/linux/mfd/tps6586x.h2
3 files changed, 42 insertions, 0 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index bbd54414a75d..835e5549ecdd 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -495,6 +495,10 @@ static void tps6586x_print_version(struct i2c_client *client, int version)
495 case TPS658623: 495 case TPS658623:
496 name = "TPS658623"; 496 name = "TPS658623";
497 break; 497 break;
498 case TPS658640:
499 case TPS658640v2:
500 name = "TPS658640";
501 break;
498 case TPS658643: 502 case TPS658643:
499 name = "TPS658643"; 503 name = "TPS658643";
500 break; 504 break;
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index da8ee0217573..e045b7fe5572 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -116,6 +116,13 @@ static const unsigned int tps6586x_sm2_voltages[] = {
116 4200000, 4250000, 4300000, 4350000, 4400000, 4450000, 4500000, 4550000, 116 4200000, 4250000, 4300000, 4350000, 4400000, 4450000, 4500000, 4550000,
117}; 117};
118 118
119static int tps658640_sm2_voltages[] = {
120 2150000, 2200000, 2250000, 2300000, 2350000, 2400000, 2450000, 2500000,
121 2550000, 2600000, 2650000, 2700000, 2750000, 2800000, 2850000, 2900000,
122 2950000, 3000000, 3050000, 3100000, 3150000, 3200000, 3250000, 3300000,
123 3350000, 3400000, 3450000, 3500000, 3550000, 3600000, 3650000, 3700000,
124};
125
119static const unsigned int tps658643_sm2_voltages[] = { 126static const unsigned int tps658643_sm2_voltages[] = {
120 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 127 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000,
121 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000, 128 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000,
@@ -130,6 +137,10 @@ static const unsigned int tps6586x_dvm_voltages[] = {
130 1325000, 1350000, 1375000, 1400000, 1425000, 1450000, 1475000, 1500000, 137 1325000, 1350000, 1375000, 1400000, 1425000, 1450000, 1475000, 1500000,
131}; 138};
132 139
140static int tps658640_rtc_voltages[] = {
141 2500000, 2850000, 3100000, 3300000,
142};
143
133#define TPS6586X_REGULATOR(_id, _ops, _pin_name, vdata, vreg, shift, nbits, \ 144#define TPS6586X_REGULATOR(_id, _ops, _pin_name, vdata, vreg, shift, nbits, \
134 ereg0, ebit0, ereg1, ebit1, goreg, gobit) \ 145 ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
135 .desc = { \ 146 .desc = { \
@@ -224,6 +235,26 @@ static struct tps6586x_regulator tps658623_regulator[] = {
224 END, 7), 235 END, 7),
225}; 236};
226 237
238static struct tps6586x_regulator tps658640_regulator[] = {
239 TPS6586X_LDO(LDO_3, "vinldo23", tps6586x_ldo0, SUPPLYV4, 0, 3,
240 ENC, 2, END, 2),
241 TPS6586X_LDO(LDO_5, "REG-SYS", tps6586x_ldo0, SUPPLYV6, 0, 3,
242 ENE, 6, ENE, 6),
243 TPS6586X_LDO(LDO_6, "vinldo678", tps6586x_ldo0, SUPPLYV3, 0, 3,
244 ENC, 4, END, 4),
245 TPS6586X_LDO(LDO_7, "vinldo678", tps6586x_ldo0, SUPPLYV3, 3, 3,
246 ENC, 5, END, 5),
247 TPS6586X_LDO(LDO_8, "vinldo678", tps6586x_ldo0, SUPPLYV2, 5, 3,
248 ENC, 6, END, 6),
249 TPS6586X_LDO(LDO_9, "vinldo9", tps6586x_ldo0, SUPPLYV6, 3, 3,
250 ENE, 7, ENE, 7),
251 TPS6586X_LDO(SM_2, "vin-sm2", tps658640_sm2, SUPPLYV2, 0, 5,
252 ENC, 7, END, 7),
253
254 TPS6586X_FIXED_LDO(LDO_RTC, "REG-SYS", tps658640_rtc, SUPPLYV4, 3, 2,
255 V4, 7, V4, 7),
256};
257
227static struct tps6586x_regulator tps658643_regulator[] = { 258static struct tps6586x_regulator tps658643_regulator[] = {
228 TPS6586X_LDO(SM_2, "vin-sm2", tps658643_sm2, SUPPLYV2, 0, 5, ENC, 7, 259 TPS6586X_LDO(SM_2, "vin-sm2", tps658643_sm2, SUPPLYV2, 0, 5, ENC, 7,
229 END, 7), 260 END, 7),
@@ -312,6 +343,11 @@ static struct tps6586x_regulator *find_regulator_info(int id, int version)
312 table = tps658623_regulator; 343 table = tps658623_regulator;
313 num = ARRAY_SIZE(tps658623_regulator); 344 num = ARRAY_SIZE(tps658623_regulator);
314 break; 345 break;
346 case TPS658640:
347 case TPS658640v2:
348 table = tps658640_regulator;
349 num = ARRAY_SIZE(tps658640_regulator);
350 break;
315 case TPS658643: 351 case TPS658643:
316 table = tps658643_regulator; 352 table = tps658643_regulator;
317 num = ARRAY_SIZE(tps658643_regulator); 353 num = ARRAY_SIZE(tps658643_regulator);
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index cbecec2e353a..96187ed9f9bb 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -17,6 +17,8 @@
17#define TPS658621A 0x15 17#define TPS658621A 0x15
18#define TPS658621CD 0x2c 18#define TPS658621CD 0x2c
19#define TPS658623 0x1b 19#define TPS658623 0x1b
20#define TPS658640 0x01
21#define TPS658640v2 0x02
20#define TPS658643 0x03 22#define TPS658643 0x03
21 23
22enum { 24enum {