Lines Matching +full:twl6035 +full:- +full:pmic
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Regulator part of Palmas PMIC Chips
5 * Copyright 2011-2013 Texas Instruments Inc.
42 .sname = "smps1-in",
50 .sname = "smps1-in",
58 .sname = "smps3-in",
65 .sname = "smps4-in",
73 .sname = "smps4-in",
81 .sname = "smps6-in",
89 .sname = "smps7-in",
96 .sname = "smps8-in",
104 .sname = "smps9-in",
111 .sname = "smps10-in",
117 .sname = "smps10-out2",
123 .sname = "ldo1-in",
130 .sname = "ldo2-in",
137 .sname = "ldo3-in",
144 .sname = "ldo4-in",
151 .sname = "ldo5-in",
158 .sname = "ldo6-in",
165 .sname = "ldo7-in",
172 .sname = "ldo8-in",
179 .sname = "ldo9-in",
186 .sname = "ldoln-in",
193 .sname = "ldousb-in",
228 .sname = "smps1-in",
235 .sname = "smps2-in",
242 .sname = "smps3-in",
249 .sname = "smps4-in",
256 .sname = "smps5-in",
263 .sname = "smps1-in",
270 .sname = "ldo1-in",
277 .sname = "ldo2-in",
284 .sname = "ldo3-in",
291 .sname = "ldo4-in",
298 .sname = "ldo5-in",
405 return regmap_read(palmas->regmap[REGULATOR_SLAVE], addr, dest); in palmas_smps_read()
415 return regmap_write(palmas->regmap[REGULATOR_SLAVE], addr, value); in palmas_smps_write()
425 return regmap_read(palmas->regmap[REGULATOR_SLAVE], addr, dest); in palmas_ldo_read()
435 return regmap_write(palmas->regmap[REGULATOR_SLAVE], addr, value); in palmas_ldo_write()
442 struct palmas_pmic *pmic = rdev_get_drvdata(dev); in palmas_set_mode_smps() local
443 struct palmas_pmic_driver_data *ddata = pmic->palmas->pmic_ddata; in palmas_set_mode_smps()
444 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_set_mode_smps()
448 ret = palmas_smps_read(pmic->palmas, rinfo->ctrl_addr, ®); in palmas_set_mode_smps()
468 return -EINVAL; in palmas_set_mode_smps()
471 pmic->current_reg_mode[id] = reg & PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; in palmas_set_mode_smps()
473 palmas_smps_write(pmic->palmas, rinfo->ctrl_addr, reg); in palmas_set_mode_smps()
476 pmic->desc[id].enable_val = pmic->current_reg_mode[id]; in palmas_set_mode_smps()
483 struct palmas_pmic *pmic = rdev_get_drvdata(dev); in palmas_get_mode_smps() local
487 reg = pmic->current_reg_mode[id] & PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; in palmas_get_mode_smps()
505 struct palmas_pmic *pmic = rdev_get_drvdata(rdev); in palmas_smps_set_ramp_delay() local
506 struct palmas_pmic_driver_data *ddata = pmic->palmas->pmic_ddata; in palmas_smps_set_ramp_delay()
507 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_smps_set_ramp_delay()
527 ret = palmas_smps_write(pmic->palmas, rinfo->tstep_addr, reg); in palmas_smps_set_ramp_delay()
529 dev_err(pmic->palmas->dev, "TSTEP write failed: %d\n", ret); in palmas_smps_set_ramp_delay()
533 pmic->ramp_delay[id] = palmas_smps_ramp_delay[reg]; in palmas_smps_set_ramp_delay()
599 struct palmas_pmic *pmic = rdev_get_drvdata(dev); in palmas_is_enabled_ldo() local
600 struct palmas_pmic_driver_data *ddata = pmic->palmas->pmic_ddata; in palmas_is_enabled_ldo()
601 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_is_enabled_ldo()
604 palmas_ldo_read(pmic->palmas, rinfo->ctrl_addr, ®); in palmas_is_enabled_ldo()
676 struct palmas_pmic_driver_data *ddata = palmas->pmic_ddata; in palmas_regulator_config_external()
677 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_regulator_config_external()
680 ret = palmas_ext_control_req_config(palmas, rinfo->sleep_id, in palmas_regulator_config_external()
681 reg_init->roof_floor, true); in palmas_regulator_config_external()
683 dev_err(palmas->dev, in palmas_regulator_config_external()
693 * pins on the PMIC such as PREQ, SYSEN, ...
700 struct palmas_pmic_driver_data *ddata = palmas->pmic_ddata; in palmas_smps_init()
701 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_smps_init()
702 unsigned int addr = rinfo->ctrl_addr; in palmas_smps_init()
712 if (reg_init->mode_sleep) in palmas_smps_init()
713 reg |= reg_init->mode_sleep << in palmas_smps_init()
717 if (reg_init->warm_reset) in palmas_smps_init()
722 if (reg_init->roof_floor) in palmas_smps_init()
728 if (reg_init->mode_sleep) in palmas_smps_init()
729 reg |= reg_init->mode_sleep << in palmas_smps_init()
737 if (rinfo->vsel_addr && reg_init->vsel) { in palmas_smps_init()
739 reg = reg_init->vsel; in palmas_smps_init()
741 ret = palmas_smps_write(palmas, rinfo->vsel_addr, reg); in palmas_smps_init()
746 if (reg_init->roof_floor && (id != PALMAS_REG_SMPS10_OUT1) && in palmas_smps_init()
770 struct palmas_pmic_driver_data *ddata = palmas->pmic_ddata; in palmas_ldo_init()
771 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_ldo_init()
773 addr = rinfo->ctrl_addr; in palmas_ldo_init()
779 if (reg_init->warm_reset) in palmas_ldo_init()
784 if (reg_init->mode_sleep) in palmas_ldo_init()
793 if (reg_init->roof_floor) { in palmas_ldo_init()
799 dev_err(palmas->dev, in palmas_ldo_init()
815 struct palmas_pmic_driver_data *ddata = palmas->pmic_ddata; in palmas_extreg_init()
816 struct palmas_regs_info *rinfo = &ddata->palmas_regs_info[id]; in palmas_extreg_init()
818 addr = rinfo->ctrl_addr; in palmas_extreg_init()
820 if (reg_init->mode_sleep) in palmas_extreg_init()
826 dev_err(palmas->dev, "Resource reg 0x%02x update failed %d\n", in palmas_extreg_init()
831 if (reg_init->roof_floor) { in palmas_extreg_init()
837 dev_err(palmas->dev, in palmas_extreg_init()
852 struct palmas_pmic_driver_data *ddata = palmas->pmic_ddata; in palmas_enable_ldo8_track()
855 rinfo = &ddata->palmas_regs_info[PALMAS_REG_LDO8]; in palmas_enable_ldo8_track()
856 addr = rinfo->ctrl_addr; in palmas_enable_ldo8_track()
860 dev_err(palmas->dev, "Error in reading ldo8 control reg\n"); in palmas_enable_ldo8_track()
867 dev_err(palmas->dev, "Error in enabling tracking mode\n"); in palmas_enable_ldo8_track()
875 addr = rinfo->vsel_addr; in palmas_enable_ldo8_track()
878 dev_err(palmas->dev, "Error in reading ldo8 voltage reg\n"); in palmas_enable_ldo8_track()
885 dev_err(palmas->dev, "Error in setting ldo8 voltage reg\n"); in palmas_enable_ldo8_track()
890 static int palmas_ldo_registration(struct palmas_pmic *pmic, in palmas_ldo_registration() argument
902 for (id = ddata->ldo_begin; id < ddata->max_reg; id++) { in palmas_ldo_registration()
903 if (pdata && pdata->reg_init[id]) in palmas_ldo_registration()
904 reg_init = pdata->reg_init[id]; in palmas_ldo_registration()
908 rinfo = &ddata->palmas_regs_info[id]; in palmas_ldo_registration()
914 desc = &pmic->desc[id]; in palmas_ldo_registration()
915 desc->name = rinfo->name; in palmas_ldo_registration()
916 desc->id = id; in palmas_ldo_registration()
917 desc->type = REGULATOR_VOLTAGE; in palmas_ldo_registration()
918 desc->owner = THIS_MODULE; in palmas_ldo_registration()
921 desc->n_voltages = PALMAS_LDO_NUM_VOLTAGES; in palmas_ldo_registration()
922 if (reg_init && reg_init->roof_floor) in palmas_ldo_registration()
923 desc->ops = &palmas_ops_ext_control_ldo; in palmas_ldo_registration()
925 desc->ops = &palmas_ops_ldo; in palmas_ldo_registration()
926 desc->min_uV = 900000; in palmas_ldo_registration()
927 desc->uV_step = 50000; in palmas_ldo_registration()
928 desc->linear_min_sel = 1; in palmas_ldo_registration()
929 desc->enable_time = 500; in palmas_ldo_registration()
930 desc->vsel_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, in palmas_ldo_registration()
931 rinfo->vsel_addr); in palmas_ldo_registration()
932 desc->vsel_mask = PALMAS_LDO1_VOLTAGE_VSEL_MASK; in palmas_ldo_registration()
933 desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, in palmas_ldo_registration()
934 rinfo->ctrl_addr); in palmas_ldo_registration()
935 desc->enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE; in palmas_ldo_registration()
939 pdata->enable_ldo8_tracking) { in palmas_ldo_registration()
940 palmas_enable_ldo8_track(pmic->palmas); in palmas_ldo_registration()
941 desc->min_uV = 450000; in palmas_ldo_registration()
942 desc->uV_step = 25000; in palmas_ldo_registration()
946 if (pdata && pdata->ldo6_vibrator && in palmas_ldo_registration()
948 desc->enable_time = 2000; in palmas_ldo_registration()
951 desc->ops = &palmas_ops_ldo9; in palmas_ldo_registration()
952 desc->bypass_reg = desc->enable_reg; in palmas_ldo_registration()
953 desc->bypass_val_on = in palmas_ldo_registration()
955 desc->bypass_mask = in palmas_ldo_registration()
959 if (!ddata->has_regen3 && id == PALMAS_REG_REGEN3) in palmas_ldo_registration()
962 desc->n_voltages = 1; in palmas_ldo_registration()
963 if (reg_init && reg_init->roof_floor) in palmas_ldo_registration()
964 desc->ops = &palmas_ops_ext_control_extreg; in palmas_ldo_registration()
966 desc->ops = &palmas_ops_extreg; in palmas_ldo_registration()
967 desc->enable_reg = in palmas_ldo_registration()
969 rinfo->ctrl_addr); in palmas_ldo_registration()
970 desc->enable_mask = PALMAS_REGEN1_CTRL_MODE_ACTIVE; in palmas_ldo_registration()
974 config.init_data = pdata->reg_data[id]; in palmas_ldo_registration()
978 desc->supply_name = rinfo->sname; in palmas_ldo_registration()
979 config.of_node = ddata->palmas_matches[id].of_node; in palmas_ldo_registration()
981 rdev = devm_regulator_register(pmic->dev, desc, &config); in palmas_ldo_registration()
983 dev_err(pmic->dev, in palmas_ldo_registration()
991 reg_init = pdata->reg_init[id]; in palmas_ldo_registration()
993 if (id <= ddata->ldo_end) in palmas_ldo_registration()
994 ret = palmas_ldo_init(pmic->palmas, id, in palmas_ldo_registration()
997 ret = palmas_extreg_init(pmic->palmas, in palmas_ldo_registration()
1008 static int tps65917_ldo_registration(struct palmas_pmic *pmic, in tps65917_ldo_registration() argument
1020 for (id = ddata->ldo_begin; id < ddata->max_reg; id++) { in tps65917_ldo_registration()
1021 if (pdata && pdata->reg_init[id]) in tps65917_ldo_registration()
1022 reg_init = pdata->reg_init[id]; in tps65917_ldo_registration()
1029 rinfo = &ddata->palmas_regs_info[id]; in tps65917_ldo_registration()
1032 desc = &pmic->desc[id]; in tps65917_ldo_registration()
1033 desc->name = rinfo->name; in tps65917_ldo_registration()
1034 desc->id = id; in tps65917_ldo_registration()
1035 desc->type = REGULATOR_VOLTAGE; in tps65917_ldo_registration()
1036 desc->owner = THIS_MODULE; in tps65917_ldo_registration()
1039 desc->n_voltages = PALMAS_LDO_NUM_VOLTAGES; in tps65917_ldo_registration()
1040 if (reg_init && reg_init->roof_floor) in tps65917_ldo_registration()
1041 desc->ops = &palmas_ops_ext_control_ldo; in tps65917_ldo_registration()
1043 desc->ops = &tps65917_ops_ldo; in tps65917_ldo_registration()
1044 desc->min_uV = 900000; in tps65917_ldo_registration()
1045 desc->uV_step = 50000; in tps65917_ldo_registration()
1046 desc->linear_min_sel = 1; in tps65917_ldo_registration()
1047 desc->enable_time = 500; in tps65917_ldo_registration()
1048 desc->vsel_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, in tps65917_ldo_registration()
1049 rinfo->vsel_addr); in tps65917_ldo_registration()
1050 desc->vsel_mask = PALMAS_LDO1_VOLTAGE_VSEL_MASK; in tps65917_ldo_registration()
1051 desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, in tps65917_ldo_registration()
1052 rinfo->ctrl_addr); in tps65917_ldo_registration()
1053 desc->enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE; in tps65917_ldo_registration()
1055 * To be confirmed. Discussion on going with PMIC Team. in tps65917_ldo_registration()
1058 desc->ramp_delay = 2500; in tps65917_ldo_registration()
1061 desc->ops = &tps65917_ops_ldo_1_2; in tps65917_ldo_registration()
1062 desc->bypass_reg = desc->enable_reg; in tps65917_ldo_registration()
1063 desc->bypass_val_on = in tps65917_ldo_registration()
1065 desc->bypass_mask = in tps65917_ldo_registration()
1069 desc->n_voltages = 1; in tps65917_ldo_registration()
1070 if (reg_init && reg_init->roof_floor) in tps65917_ldo_registration()
1071 desc->ops = &palmas_ops_ext_control_extreg; in tps65917_ldo_registration()
1073 desc->ops = &palmas_ops_extreg; in tps65917_ldo_registration()
1074 desc->enable_reg = in tps65917_ldo_registration()
1076 rinfo->ctrl_addr); in tps65917_ldo_registration()
1077 desc->enable_mask = PALMAS_REGEN1_CTRL_MODE_ACTIVE; in tps65917_ldo_registration()
1081 config.init_data = pdata->reg_data[id]; in tps65917_ldo_registration()
1085 desc->supply_name = rinfo->sname; in tps65917_ldo_registration()
1086 config.of_node = ddata->palmas_matches[id].of_node; in tps65917_ldo_registration()
1088 rdev = devm_regulator_register(pmic->dev, desc, &config); in tps65917_ldo_registration()
1090 dev_err(pmic->dev, in tps65917_ldo_registration()
1098 reg_init = pdata->reg_init[id]; in tps65917_ldo_registration()
1101 ret = palmas_ldo_init(pmic->palmas, in tps65917_ldo_registration()
1104 ret = palmas_extreg_init(pmic->palmas, in tps65917_ldo_registration()
1115 static int palmas_smps_registration(struct palmas_pmic *pmic, in palmas_smps_registration() argument
1128 for (id = ddata->smps_start; id <= ddata->smps_end; id++) { in palmas_smps_registration()
1138 if (pmic->smps123) in palmas_smps_registration()
1144 if (!pmic->smps123) in palmas_smps_registration()
1150 if (pmic->smps457) in palmas_smps_registration()
1156 if (!pmic->smps457) in palmas_smps_registration()
1162 if (!PALMAS_PMIC_HAS(pmic->palmas, SMPS10_BOOST)) in palmas_smps_registration()
1165 rinfo = &ddata->palmas_regs_info[id]; in palmas_smps_registration()
1166 desc = &pmic->desc[id]; in palmas_smps_registration()
1172 addr = rinfo->tstep_addr; in palmas_smps_registration()
1173 ret = palmas_smps_read(pmic->palmas, addr, ®); in palmas_smps_registration()
1175 dev_err(pmic->dev, in palmas_smps_registration()
1179 desc->ramp_delay = palmas_smps_ramp_delay[reg & 0x3]; in palmas_smps_registration()
1180 pmic->ramp_delay[id] = desc->ramp_delay; in palmas_smps_registration()
1184 if (pdata && pdata->reg_init[id]) { in palmas_smps_registration()
1185 reg_init = pdata->reg_init[id]; in palmas_smps_registration()
1186 ret = palmas_smps_init(pmic->palmas, id, reg_init); in palmas_smps_registration()
1194 desc->name = rinfo->name; in palmas_smps_registration()
1195 desc->id = id; in palmas_smps_registration()
1200 desc->n_voltages = PALMAS_SMPS10_NUM_VOLTAGES; in palmas_smps_registration()
1201 desc->ops = &palmas_ops_smps10; in palmas_smps_registration()
1202 desc->vsel_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in palmas_smps_registration()
1204 desc->vsel_mask = SMPS10_VSEL; in palmas_smps_registration()
1205 desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in palmas_smps_registration()
1208 desc->enable_mask = SMPS10_SWITCH_EN; in palmas_smps_registration()
1210 desc->enable_mask = SMPS10_BOOST_EN; in palmas_smps_registration()
1211 desc->bypass_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in palmas_smps_registration()
1213 desc->bypass_val_on = SMPS10_BYPASS_EN; in palmas_smps_registration()
1214 desc->bypass_mask = SMPS10_BYPASS_EN; in palmas_smps_registration()
1215 desc->min_uV = 3750000; in palmas_smps_registration()
1216 desc->uV_step = 1250000; in palmas_smps_registration()
1225 addr = rinfo->vsel_addr; in palmas_smps_registration()
1226 desc->n_linear_ranges = 3; in palmas_smps_registration()
1228 ret = palmas_smps_read(pmic->palmas, addr, ®); in palmas_smps_registration()
1232 pmic->range[id] = 1; in palmas_smps_registration()
1233 if (pmic->range[id]) in palmas_smps_registration()
1234 desc->linear_ranges = smps_high_ranges; in palmas_smps_registration()
1236 desc->linear_ranges = smps_low_ranges; in palmas_smps_registration()
1238 if (reg_init && reg_init->roof_floor) in palmas_smps_registration()
1239 desc->ops = &palmas_ops_ext_control_smps; in palmas_smps_registration()
1241 desc->ops = &palmas_ops_smps; in palmas_smps_registration()
1242 desc->n_voltages = PALMAS_SMPS_NUM_VOLTAGES; in palmas_smps_registration()
1243 desc->vsel_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in palmas_smps_registration()
1244 rinfo->vsel_addr); in palmas_smps_registration()
1245 desc->vsel_mask = PALMAS_SMPS12_VOLTAGE_VSEL_MASK; in palmas_smps_registration()
1248 addr = rinfo->ctrl_addr; in palmas_smps_registration()
1249 ret = palmas_smps_read(pmic->palmas, addr, ®); in palmas_smps_registration()
1252 pmic->current_reg_mode[id] = reg & in palmas_smps_registration()
1255 desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in palmas_smps_registration()
1256 rinfo->ctrl_addr); in palmas_smps_registration()
1257 desc->enable_mask = PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; in palmas_smps_registration()
1259 desc->enable_val = SMPS_CTRL_MODE_ON; in palmas_smps_registration()
1262 desc->type = REGULATOR_VOLTAGE; in palmas_smps_registration()
1263 desc->owner = THIS_MODULE; in palmas_smps_registration()
1266 config.init_data = pdata->reg_data[id]; in palmas_smps_registration()
1270 desc->supply_name = rinfo->sname; in palmas_smps_registration()
1271 config.of_node = ddata->palmas_matches[id].of_node; in palmas_smps_registration()
1273 rdev = devm_regulator_register(pmic->dev, desc, &config); in palmas_smps_registration()
1275 dev_err(pmic->dev, in palmas_smps_registration()
1285 static int tps65917_smps_registration(struct palmas_pmic *pmic, in tps65917_smps_registration() argument
1298 for (id = ddata->smps_start; id <= ddata->smps_end; id++) { in tps65917_smps_registration()
1303 desc = &pmic->desc[id]; in tps65917_smps_registration()
1304 desc->n_linear_ranges = 3; in tps65917_smps_registration()
1306 pmic->smps12) in tps65917_smps_registration()
1310 if (pdata && pdata->reg_init[id]) { in tps65917_smps_registration()
1311 reg_init = pdata->reg_init[id]; in tps65917_smps_registration()
1312 ret = palmas_smps_init(pmic->palmas, id, reg_init); in tps65917_smps_registration()
1318 rinfo = &ddata->palmas_regs_info[id]; in tps65917_smps_registration()
1321 desc->name = rinfo->name; in tps65917_smps_registration()
1322 desc->id = id; in tps65917_smps_registration()
1330 addr = rinfo->vsel_addr; in tps65917_smps_registration()
1332 ret = palmas_smps_read(pmic->palmas, addr, ®); in tps65917_smps_registration()
1336 pmic->range[id] = 1; in tps65917_smps_registration()
1338 if (pmic->range[id]) in tps65917_smps_registration()
1339 desc->linear_ranges = smps_high_ranges; in tps65917_smps_registration()
1341 desc->linear_ranges = smps_low_ranges; in tps65917_smps_registration()
1343 if (reg_init && reg_init->roof_floor) in tps65917_smps_registration()
1344 desc->ops = &tps65917_ops_ext_control_smps; in tps65917_smps_registration()
1346 desc->ops = &tps65917_ops_smps; in tps65917_smps_registration()
1347 desc->n_voltages = PALMAS_SMPS_NUM_VOLTAGES; in tps65917_smps_registration()
1348 desc->vsel_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in tps65917_smps_registration()
1349 rinfo->vsel_addr); in tps65917_smps_registration()
1350 desc->vsel_mask = PALMAS_SMPS12_VOLTAGE_VSEL_MASK; in tps65917_smps_registration()
1351 desc->ramp_delay = 2500; in tps65917_smps_registration()
1354 addr = rinfo->ctrl_addr; in tps65917_smps_registration()
1355 ret = palmas_smps_read(pmic->palmas, addr, ®); in tps65917_smps_registration()
1358 pmic->current_reg_mode[id] = reg & in tps65917_smps_registration()
1360 desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, in tps65917_smps_registration()
1361 rinfo->ctrl_addr); in tps65917_smps_registration()
1362 desc->enable_mask = PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; in tps65917_smps_registration()
1364 desc->enable_val = SMPS_CTRL_MODE_ON; in tps65917_smps_registration()
1366 desc->type = REGULATOR_VOLTAGE; in tps65917_smps_registration()
1367 desc->owner = THIS_MODULE; in tps65917_smps_registration()
1370 config.init_data = pdata->reg_data[id]; in tps65917_smps_registration()
1374 desc->supply_name = rinfo->sname; in tps65917_smps_registration()
1375 config.of_node = ddata->palmas_matches[id].of_node; in tps65917_smps_registration()
1377 rdev = devm_regulator_register(pmic->dev, desc, &config); in tps65917_smps_registration()
1379 dev_err(pmic->dev, in tps65917_smps_registration()
1481 ret = of_regulator_match(dev, regulators, ddata->palmas_matches, in palmas_dt_to_pdata()
1482 ddata->max_reg); in palmas_dt_to_pdata()
1489 for (idx = 0; idx < ddata->max_reg; idx++) { in palmas_dt_to_pdata()
1494 match = &ddata->palmas_matches[idx]; in palmas_dt_to_pdata()
1495 np = match->of_node; in palmas_dt_to_pdata()
1497 if (!match->init_data || !np) in palmas_dt_to_pdata()
1502 return -ENOMEM; in palmas_dt_to_pdata()
1504 pdata->reg_data[idx] = match->init_data; in palmas_dt_to_pdata()
1505 pdata->reg_init[idx] = rinit; in palmas_dt_to_pdata()
1507 rinit->warm_reset = of_property_read_bool(np, "ti,warm-reset"); in palmas_dt_to_pdata()
1508 ret = of_property_read_u32(np, "ti,roof-floor", &prop); in palmas_dt_to_pdata()
1510 if (ret != -EINVAL) { in palmas_dt_to_pdata()
1529 "%s: Invalid roof-floor option: %u\n", in palmas_dt_to_pdata()
1530 match->name, prop); in palmas_dt_to_pdata()
1534 rinit->roof_floor = econtrol; in palmas_dt_to_pdata()
1537 ret = of_property_read_u32(np, "ti,mode-sleep", &prop); in palmas_dt_to_pdata()
1539 rinit->mode_sleep = prop; in palmas_dt_to_pdata()
1541 ret = of_property_read_bool(np, "ti,smps-range"); in palmas_dt_to_pdata()
1543 rinit->vsel = PALMAS_SMPS12_VOLTAGE_RANGE; in palmas_dt_to_pdata()
1546 pdata->enable_ldo8_tracking = of_property_read_bool( in palmas_dt_to_pdata()
1547 np, "ti,enable-ldo8-tracking"); in palmas_dt_to_pdata()
1550 pdata->ldo6_vibrator = of_property_read_bool(node, "ti,ldo6-vibrator"); in palmas_dt_to_pdata()
1557 .compatible = "ti,palmas-pmic",
1561 .compatible = "ti,twl6035-pmic",
1565 .compatible = "ti,twl6036-pmic",
1569 .compatible = "ti,twl6037-pmic",
1573 .compatible = "ti,tps65913-pmic",
1577 .compatible = "ti,tps65914-pmic",
1581 .compatible = "ti,tps80036-pmic",
1585 .compatible = "ti,tps659038-pmic",
1589 .compatible = "ti,tps65917-pmic",
1597 struct palmas *palmas = dev_get_drvdata(pdev->dev.parent); in palmas_regulators_probe()
1598 struct palmas_pmic_platform_data *pdata = dev_get_platdata(&pdev->dev); in palmas_regulators_probe()
1599 struct device_node *node = pdev->dev.of_node; in palmas_regulators_probe()
1602 struct palmas_pmic *pmic; in palmas_regulators_probe() local
1608 match = of_match_device(of_match_ptr(of_palmas_match_tbl), &pdev->dev); in palmas_regulators_probe()
1611 return -ENODATA; in palmas_regulators_probe()
1613 driver_data = (struct palmas_pmic_driver_data *)match->data; in palmas_regulators_probe()
1614 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); in palmas_regulators_probe()
1616 return -ENOMEM; in palmas_regulators_probe()
1618 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); in palmas_regulators_probe()
1619 if (!pmic) in palmas_regulators_probe()
1620 return -ENOMEM; in palmas_regulators_probe()
1622 if (of_device_is_compatible(node, "ti,tps659038-pmic")) { in palmas_regulators_probe()
1628 pmic->dev = &pdev->dev; in palmas_regulators_probe()
1629 pmic->palmas = palmas; in palmas_regulators_probe()
1630 palmas->pmic = pmic; in palmas_regulators_probe()
1631 platform_set_drvdata(pdev, pmic); in palmas_regulators_probe()
1632 pmic->palmas->pmic_ddata = driver_data; in palmas_regulators_probe()
1634 ret = palmas_dt_to_pdata(&pdev->dev, node, pdata, driver_data); in palmas_regulators_probe()
1643 pmic->smps123 = 1; in palmas_regulators_probe()
1644 pmic->smps12 = 1; in palmas_regulators_probe()
1648 pmic->smps457 = 1; in palmas_regulators_probe()
1650 config.regmap = palmas->regmap[REGULATOR_SLAVE]; in palmas_regulators_probe()
1651 config.dev = &pdev->dev; in palmas_regulators_probe()
1652 config.driver_data = pmic; in palmas_regulators_probe()
1653 pdev_name = pdev->name; in palmas_regulators_probe()
1655 ret = driver_data->smps_register(pmic, driver_data, pdata, pdev_name, in palmas_regulators_probe()
1660 ret = driver_data->ldo_register(pmic, driver_data, pdata, pdev_name, in palmas_regulators_probe()
1668 .name = "palmas-pmic",
1689 MODULE_ALIAS("platform:palmas-pmic");