Lines Matching +full:dcdc +full:- +full:reg
354 .n_voltages = (((_max) - (_min)) / (_step) + 1), \
376 .n_voltages = (((_max) - (_min)) / (_step) + 1), \
444 u8 reg, mask, enable, cfg = 0xff; in axp20x_set_ramp_delay() local
448 switch (axp20x->variant) { in axp20x_set_ramp_delay()
453 reg = AXP20X_DCDC2_LDO3_V_RAMP; in axp20x_set_ramp_delay()
464 reg = AXP20X_DCDC2_LDO3_V_RAMP; in axp20x_set_ramp_delay()
478 return -ENOTSUPP; in axp20x_set_ramp_delay()
497 dev_err(axp20x->dev, "unsupported ramp value %d", ramp); in axp20x_set_ramp_delay()
498 return -EINVAL; in axp20x_set_ramp_delay()
504 return regmap_update_bits(axp20x->regmap, reg, mask, cfg); in axp20x_set_ramp_delay()
512 switch (axp20x->variant) { in axp20x_regulator_enable_regmap()
515 rdev->constraints && rdev->constraints->soft_start) { in axp20x_regulator_enable_regmap()
752 AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
755 /* DCDC ranges shared with AXP813 */
865 AXP_DESC_IO(AXP803, LDO_IO0, "ldo-io0", "ips", 700, 3300, 100,
869 AXP_DESC_IO(AXP803, LDO_IO1, "ldo-io1", "ips", 700, 3300, 100,
873 AXP_DESC_FIXED(AXP803, RTC_LDO, "rtc-ldo", "ips", 3000),
1105 AXP_DESC_FIXED(AXP813, RTC_LDO, "rtc-ldo", "ips", 1800),
1106 AXP_DESC_IO(AXP813, LDO_IO0, "ldo-io0", "ips", 700, 3300, 100,
1110 AXP_DESC_IO(AXP813, LDO_IO1, "ldo-io1", "ips", 700, 3300, 100,
1213 AXP_DESC_FIXED(AXP15060, RTC_LDO, "rtc-ldo", NULL, 1800),
1218 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_set_dcdc_freq()
1219 unsigned int reg = AXP20X_DCDC_FREQ; in axp20x_set_dcdc_freq() local
1222 switch (axp20x->variant) { in axp20x_set_dcdc_freq()
1233 * AXP803/AXP813 DCDC work frequency setting has the same in axp20x_set_dcdc_freq()
1237 reg = AXP803_DCDC_FREQ_CTRL; in axp20x_set_dcdc_freq()
1241 * AXP806 also have DCDC work frequency setting register at a in axp20x_set_dcdc_freq()
1244 if (axp20x->variant == AXP806_ID) in axp20x_set_dcdc_freq()
1245 reg = AXP806_DCDC_FREQ_CTRL; in axp20x_set_dcdc_freq()
1257 /* The DCDC PWM frequency seems to be fixed to 3 MHz. */ in axp20x_set_dcdc_freq()
1259 dev_err(&pdev->dev, in axp20x_set_dcdc_freq()
1260 "DCDC frequency on this PMIC is fixed to 3 MHz.\n"); in axp20x_set_dcdc_freq()
1261 return -EINVAL; in axp20x_set_dcdc_freq()
1266 dev_err(&pdev->dev, in axp20x_set_dcdc_freq()
1267 "Setting DCDC frequency for unsupported AXP variant\n"); in axp20x_set_dcdc_freq()
1268 return -EINVAL; in axp20x_set_dcdc_freq()
1276 dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n", in axp20x_set_dcdc_freq()
1282 dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n", in axp20x_set_dcdc_freq()
1286 dcdcfreq = (dcdcfreq - min) / step; in axp20x_set_dcdc_freq()
1288 return regmap_update_bits(axp20x->regmap, reg, in axp20x_set_dcdc_freq()
1298 np = of_node_get(pdev->dev.parent->of_node); in axp20x_regulator_parse_dt()
1304 dev_warn(&pdev->dev, "regulators node not found\n"); in axp20x_regulator_parse_dt()
1306 of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq); in axp20x_regulator_parse_dt()
1309 dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); in axp20x_regulator_parse_dt()
1321 unsigned int reg = AXP20X_DCDC_MODE; in axp20x_set_dcdc_workmode() local
1324 switch (axp20x->variant) { in axp20x_set_dcdc_workmode()
1328 return -EINVAL; in axp20x_set_dcdc_workmode()
1334 workmode <<= ffs(mask) - 1; in axp20x_set_dcdc_workmode()
1339 * AXP806 DCDC regulator IDs have the same range as AXP22X. in axp20x_set_dcdc_workmode()
1342 reg = AXP806_DCDC_MODE_CTRL2; in axp20x_set_dcdc_workmode()
1348 return -EINVAL; in axp20x_set_dcdc_workmode()
1350 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1); in axp20x_set_dcdc_workmode()
1351 workmode <<= id - AXP22X_DCDC1; in axp20x_set_dcdc_workmode()
1356 return -EINVAL; in axp20x_set_dcdc_workmode()
1358 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP803_DCDC1); in axp20x_set_dcdc_workmode()
1359 workmode <<= id - AXP803_DCDC1; in axp20x_set_dcdc_workmode()
1364 return -EINVAL; in axp20x_set_dcdc_workmode()
1366 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP813_DCDC1); in axp20x_set_dcdc_workmode()
1367 workmode <<= id - AXP813_DCDC1; in axp20x_set_dcdc_workmode()
1371 reg = AXP15060_DCDC_MODE_CTRL2; in axp20x_set_dcdc_workmode()
1373 return -EINVAL; in axp20x_set_dcdc_workmode()
1375 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP15060_DCDC1); in axp20x_set_dcdc_workmode()
1376 workmode <<= id - AXP15060_DCDC1; in axp20x_set_dcdc_workmode()
1382 return -EINVAL; in axp20x_set_dcdc_workmode()
1385 return regmap_update_bits(rdev->regmap, reg, mask, workmode); in axp20x_set_dcdc_workmode()
1389 * This function checks whether a regulator is part of a poly-phase
1394 u32 reg = 0; in axp20x_is_polyphase_slave() local
1400 switch (axp20x->variant) { in axp20x_is_polyphase_slave()
1403 regmap_read(axp20x->regmap, AXP803_POLYPHASE_CTRL, ®); in axp20x_is_polyphase_slave()
1407 return !!(reg & AXP803_DCDC23_POLYPHASE_DUAL); in axp20x_is_polyphase_slave()
1409 return !!(reg & AXP803_DCDC56_POLYPHASE_DUAL); in axp20x_is_polyphase_slave()
1414 regmap_read(axp20x->regmap, AXP806_DCDC_MODE_CTRL2, ®); in axp20x_is_polyphase_slave()
1418 return (((reg & AXP806_DCDCABC_POLYPHASE_MASK) == in axp20x_is_polyphase_slave()
1420 ((reg & AXP806_DCDCABC_POLYPHASE_MASK) == in axp20x_is_polyphase_slave()
1423 return ((reg & AXP806_DCDCABC_POLYPHASE_MASK) == in axp20x_is_polyphase_slave()
1426 return !!(reg & AXP806_DCDCDE_POLYPHASE_DUAL); in axp20x_is_polyphase_slave()
1431 regmap_read(axp20x->regmap, AXP15060_DCDC_MODE_CTRL1, ®); in axp20x_is_polyphase_slave()
1435 return !!(reg & AXP15060_DCDC23_POLYPHASE_DUAL_MASK); in axp20x_is_polyphase_slave()
1437 return !!(reg & AXP15060_DCDC46_POLYPHASE_DUAL_MASK); in axp20x_is_polyphase_slave()
1451 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_regulator_probe()
1454 .dev = pdev->dev.parent, in axp20x_regulator_probe()
1455 .regmap = axp20x->regmap, in axp20x_regulator_probe()
1465 switch (axp20x->variant) { in axp20x_regulator_probe()
1475 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1476 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1485 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1486 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1499 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1500 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1507 dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n", in axp20x_regulator_probe()
1508 axp20x->variant); in axp20x_regulator_probe()
1509 return -EINVAL; in axp20x_regulator_probe()
1512 /* This only sets the dcdc freq. Ignore any errors */ in axp20x_regulator_probe()
1520 * If this regulator is a slave in a poly-phase setup, in axp20x_regulator_probe()
1528 if (axp20x->variant == AXP813_ID && i == AXP813_FLDO3) in axp20x_regulator_probe()
1545 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1548 return -ENOMEM; in axp20x_regulator_probe()
1551 new_desc->supply_name = dcdc1_name; in axp20x_regulator_probe()
1558 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1561 return -ENOMEM; in axp20x_regulator_probe()
1564 new_desc->supply_name = dcdc5_name; in axp20x_regulator_probe()
1570 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1573 return -ENOMEM; in axp20x_regulator_probe()
1576 new_desc->supply_name = aldo1_name; in axp20x_regulator_probe()
1580 rdev = devm_regulator_register(&pdev->dev, desc, &config); in axp20x_regulator_probe()
1582 dev_err(&pdev->dev, "Failed to register %s\n", in axp20x_regulator_probe()
1588 ret = of_property_read_u32(rdev->dev.of_node, in axp20x_regulator_probe()
1589 "x-powers,dcdc-workmode", in axp20x_regulator_probe()
1593 dev_err(&pdev->dev, "Failed to set workmode on %s\n", in axp20x_regulator_probe()
1594 rdev->desc->name); in axp20x_regulator_probe()
1603 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1604 "regulator-name", in axp20x_regulator_probe()
1610 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1611 "regulator-name", in axp20x_regulator_probe()
1615 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1616 "regulator-name", in axp20x_regulator_probe()
1622 regmap_update_bits(axp20x->regmap, AXP20X_OVER_TMP, in axp20x_regulator_probe()
1624 rdev = devm_regulator_register(&pdev->dev, in axp20x_regulator_probe()
1628 dev_err(&pdev->dev, "Failed to register drivevbus\n"); in axp20x_regulator_probe()
1639 .name = "axp20x-regulator",
1649 MODULE_ALIAS("platform:axp20x-regulator");