Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: palmas: Add has_regen3 check for TPS659038

Palmas driver is used to cater to even TPS659038 but TPS659038 does not have
REGEN3 resource. Adding another field in the driver data to check on that.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Keerthy and committed by
Mark Brown
e999c728 a26aeb17

+9 -1
+8 -1
drivers/regulator/palmas-regulator.c
··· 916 916 (id == PALMAS_REG_LDO6)) 917 917 desc->enable_time = 2000; 918 918 } else { 919 + if (!ddata->has_regen3 && id == PALMAS_REG_REGEN3) 920 + continue; 921 + 919 922 desc->n_voltages = 1; 920 923 if (reg_init && reg_init->roof_floor) 921 924 desc->ops = &palmas_ops_ext_control_extreg; ··· 1401 1398 .ldo_begin = PALMAS_REG_LDO1, 1402 1399 .ldo_end = PALMAS_REG_LDOUSB, 1403 1400 .max_reg = PALMAS_NUM_REGS, 1401 + .has_regen3 = true, 1404 1402 .palmas_regs_info = palmas_generic_regs_info, 1405 1403 .palmas_matches = palmas_matches, 1406 1404 .sleep_req_info = palma_sleep_req_info, ··· 1415 1411 .ldo_begin = TPS65917_REG_LDO1, 1416 1412 .ldo_end = TPS65917_REG_LDO5, 1417 1413 .max_reg = TPS65917_NUM_REGS, 1414 + .has_regen3 = true, 1418 1415 .palmas_regs_info = tps65917_regs_info, 1419 1416 .palmas_matches = tps65917_matches, 1420 1417 .sleep_req_info = tps65917_sleep_req_info, ··· 1577 1572 if (!pmic) 1578 1573 return -ENOMEM; 1579 1574 1580 - if (of_device_is_compatible(node, "ti,tps659038-pmic")) 1575 + if (of_device_is_compatible(node, "ti,tps659038-pmic")) { 1581 1576 palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr = 1582 1577 TPS659038_REGEN2_CTRL; 1578 + palmas_ddata.has_regen3 = false; 1579 + } 1583 1580 1584 1581 pmic->dev = &pdev->dev; 1585 1582 pmic->palmas = palmas;
+1
include/linux/mfd/palmas.h
··· 117 117 int ldo_begin; 118 118 int ldo_end; 119 119 int max_reg; 120 + bool has_regen3; 120 121 struct palmas_regs_info *palmas_regs_info; 121 122 struct of_regulator_match *palmas_matches; 122 123 struct palmas_sleep_requestor_info *sleep_req_info;