aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2017-05-23 08:16:56 -0400
committerMark Brown <broonie@kernel.org>2017-05-25 12:24:47 -0400
commitbe035303182a1260803a1871065d7b1e67c9ebe9 (patch)
tree666f25c496d73bc3e8d4a87893942013f0c97a60
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
regulator: tps65917: Add support for SMPS12
App support for SMPS12 dual phase regulator. Signed-off-by: Keerthy <j-keerthy@ti.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/palmas-regulator.c18
-rw-r--r--include/linux/mfd/palmas.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 31ae5ee3a80d..8018a44ed4f7 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -264,6 +264,13 @@ static struct palmas_regs_info tps65917_regs_info[] = {
264 .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS5, 264 .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS5,
265 }, 265 },
266 { 266 {
267 .name = "SMPS12",
268 .sname = "smps1-in",
269 .vsel_addr = TPS65917_SMPS1_VOLTAGE,
270 .ctrl_addr = TPS65917_SMPS1_CTRL,
271 .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS12,
272 },
273 {
267 .name = "LDO1", 274 .name = "LDO1",
268 .sname = "ldo1-in", 275 .sname = "ldo1-in",
269 .vsel_addr = TPS65917_LDO1_VOLTAGE, 276 .vsel_addr = TPS65917_LDO1_VOLTAGE,
@@ -367,6 +374,7 @@ static struct palmas_sleep_requestor_info tps65917_sleep_req_info[] = {
367 EXTERNAL_REQUESTOR_TPS65917(SMPS3, 1, 2), 374 EXTERNAL_REQUESTOR_TPS65917(SMPS3, 1, 2),
368 EXTERNAL_REQUESTOR_TPS65917(SMPS4, 1, 3), 375 EXTERNAL_REQUESTOR_TPS65917(SMPS4, 1, 3),
369 EXTERNAL_REQUESTOR_TPS65917(SMPS5, 1, 4), 376 EXTERNAL_REQUESTOR_TPS65917(SMPS5, 1, 4),
377 EXTERNAL_REQUESTOR_TPS65917(SMPS12, 1, 5),
370 EXTERNAL_REQUESTOR_TPS65917(LDO1, 2, 0), 378 EXTERNAL_REQUESTOR_TPS65917(LDO1, 2, 0),
371 EXTERNAL_REQUESTOR_TPS65917(LDO2, 2, 1), 379 EXTERNAL_REQUESTOR_TPS65917(LDO2, 2, 1),
372 EXTERNAL_REQUESTOR_TPS65917(LDO3, 2, 2), 380 EXTERNAL_REQUESTOR_TPS65917(LDO3, 2, 2),
@@ -1305,7 +1313,8 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic,
1305 */ 1313 */
1306 desc = &pmic->desc[id]; 1314 desc = &pmic->desc[id];
1307 desc->n_linear_ranges = 3; 1315 desc->n_linear_ranges = 3;
1308 if ((id == TPS65917_REG_SMPS2) && pmic->smps12) 1316 if ((id == TPS65917_REG_SMPS2 || id == TPS65917_REG_SMPS1) &&
1317 pmic->smps12)
1309 continue; 1318 continue;
1310 1319
1311 /* Initialise sleep/init values from platform data */ 1320 /* Initialise sleep/init values from platform data */
@@ -1427,6 +1436,7 @@ static struct of_regulator_match tps65917_matches[] = {
1427 { .name = "smps3", }, 1436 { .name = "smps3", },
1428 { .name = "smps4", }, 1437 { .name = "smps4", },
1429 { .name = "smps5", }, 1438 { .name = "smps5", },
1439 { .name = "smps12",},
1430 { .name = "ldo1", }, 1440 { .name = "ldo1", },
1431 { .name = "ldo2", }, 1441 { .name = "ldo2", },
1432 { .name = "ldo3", }, 1442 { .name = "ldo3", },
@@ -1455,7 +1465,7 @@ static struct palmas_pmic_driver_data palmas_ddata = {
1455 1465
1456static struct palmas_pmic_driver_data tps65917_ddata = { 1466static struct palmas_pmic_driver_data tps65917_ddata = {
1457 .smps_start = TPS65917_REG_SMPS1, 1467 .smps_start = TPS65917_REG_SMPS1,
1458 .smps_end = TPS65917_REG_SMPS5, 1468 .smps_end = TPS65917_REG_SMPS12,
1459 .ldo_begin = TPS65917_REG_LDO1, 1469 .ldo_begin = TPS65917_REG_LDO1,
1460 .ldo_end = TPS65917_REG_LDO5, 1470 .ldo_end = TPS65917_REG_LDO5,
1461 .max_reg = TPS65917_NUM_REGS, 1471 .max_reg = TPS65917_NUM_REGS,
@@ -1643,8 +1653,10 @@ static int palmas_regulators_probe(struct platform_device *pdev)
1643 if (ret) 1653 if (ret)
1644 return ret; 1654 return ret;
1645 1655
1646 if (reg & PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN) 1656 if (reg & PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN) {
1647 pmic->smps123 = 1; 1657 pmic->smps123 = 1;
1658 pmic->smps12 = 1;
1659 }
1648 1660
1649 if (reg & PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN) 1661 if (reg & PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN)
1650 pmic->smps457 = 1; 1662 pmic->smps457 = 1;
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 5c9a1d44c125..6dec43826303 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -250,6 +250,7 @@ enum tps65917_regulators {
250 TPS65917_REG_SMPS3, 250 TPS65917_REG_SMPS3,
251 TPS65917_REG_SMPS4, 251 TPS65917_REG_SMPS4,
252 TPS65917_REG_SMPS5, 252 TPS65917_REG_SMPS5,
253 TPS65917_REG_SMPS12,
253 /* LDO regulators */ 254 /* LDO regulators */
254 TPS65917_REG_LDO1, 255 TPS65917_REG_LDO1,
255 TPS65917_REG_LDO2, 256 TPS65917_REG_LDO2,
@@ -317,6 +318,7 @@ enum tps65917_external_requestor_id {
317 TPS65917_EXTERNAL_REQSTR_ID_SMPS3, 318 TPS65917_EXTERNAL_REQSTR_ID_SMPS3,
318 TPS65917_EXTERNAL_REQSTR_ID_SMPS4, 319 TPS65917_EXTERNAL_REQSTR_ID_SMPS4,
319 TPS65917_EXTERNAL_REQSTR_ID_SMPS5, 320 TPS65917_EXTERNAL_REQSTR_ID_SMPS5,
321 TPS65917_EXTERNAL_REQSTR_ID_SMPS12,
320 TPS65917_EXTERNAL_REQSTR_ID_LDO1, 322 TPS65917_EXTERNAL_REQSTR_ID_LDO1,
321 TPS65917_EXTERNAL_REQSTR_ID_LDO2, 323 TPS65917_EXTERNAL_REQSTR_ID_LDO2,
322 TPS65917_EXTERNAL_REQSTR_ID_LDO3, 324 TPS65917_EXTERNAL_REQSTR_ID_LDO3,