Lines Matching +full:dcdc +full:- +full:workmode

361 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
383 .n_voltages = (((_max) - (_min)) / (_step) + 1), \
467 switch (axp20x->variant) { in axp20x_set_ramp_delay()
497 return -ENOTSUPP; in axp20x_set_ramp_delay()
516 dev_err(axp20x->dev, "unsupported ramp value %d", ramp); in axp20x_set_ramp_delay()
517 return -EINVAL; in axp20x_set_ramp_delay()
523 return regmap_update_bits(axp20x->regmap, reg, mask, cfg); in axp20x_set_ramp_delay()
531 switch (axp20x->variant) { in axp20x_regulator_enable_regmap()
534 rdev->constraints && rdev->constraints->soft_start) { in axp20x_regulator_enable_regmap()
771 AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
855 /* DCDC ranges shared with AXP813 */
965 AXP_DESC_IO(AXP803, LDO_IO0, "ldo-io0", "ips", 700, 3300, 100,
969 AXP_DESC_IO(AXP803, LDO_IO1, "ldo-io1", "ips", 700, 3300, 100,
973 AXP_DESC_FIXED(AXP803, RTC_LDO, "rtc-ldo", "ips", 3000),
1205 AXP_DESC_FIXED(AXP813, RTC_LDO, "rtc-ldo", "ips", 1800),
1206 AXP_DESC_IO(AXP813, LDO_IO0, "ldo-io0", "ips", 700, 3300, 100,
1210 AXP_DESC_IO(AXP813, LDO_IO1, "ldo-io1", "ips", 700, 3300, 100,
1313 AXP_DESC_FIXED(AXP15060, RTC_LDO, "rtc-ldo", NULL, 1800),
1318 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_set_dcdc_freq()
1322 switch (axp20x->variant) { in axp20x_set_dcdc_freq()
1333 * AXP803/AXP813 DCDC work frequency setting has the same in axp20x_set_dcdc_freq()
1341 * AXP806 also have DCDC work frequency setting register at a in axp20x_set_dcdc_freq()
1344 if (axp20x->variant == AXP806_ID) in axp20x_set_dcdc_freq()
1359 /* The DCDC PWM frequency seems to be fixed to 3 MHz. */ in axp20x_set_dcdc_freq()
1361 dev_err(&pdev->dev, in axp20x_set_dcdc_freq()
1362 "DCDC frequency on this PMIC is fixed to 3 MHz.\n"); in axp20x_set_dcdc_freq()
1363 return -EINVAL; in axp20x_set_dcdc_freq()
1368 dev_err(&pdev->dev, in axp20x_set_dcdc_freq()
1369 "Setting DCDC frequency for unsupported AXP variant\n"); in axp20x_set_dcdc_freq()
1370 return -EINVAL; in axp20x_set_dcdc_freq()
1378 dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n", in axp20x_set_dcdc_freq()
1384 dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n", in axp20x_set_dcdc_freq()
1388 dcdcfreq = (dcdcfreq - min) / step; in axp20x_set_dcdc_freq()
1390 return regmap_update_bits(axp20x->regmap, reg, in axp20x_set_dcdc_freq()
1400 np = of_node_get(pdev->dev.parent->of_node); in axp20x_regulator_parse_dt()
1406 dev_warn(&pdev->dev, "regulators node not found\n"); in axp20x_regulator_parse_dt()
1408 of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq); in axp20x_regulator_parse_dt()
1411 dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); in axp20x_regulator_parse_dt()
1420 static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode) in axp20x_set_dcdc_workmode() argument
1426 switch (axp20x->variant) { in axp20x_set_dcdc_workmode()
1430 return -EINVAL; in axp20x_set_dcdc_workmode()
1436 workmode <<= ffs(mask) - 1; in axp20x_set_dcdc_workmode()
1441 * AXP806 DCDC regulator IDs have the same range as AXP22X. in axp20x_set_dcdc_workmode()
1450 return -EINVAL; in axp20x_set_dcdc_workmode()
1452 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1); in axp20x_set_dcdc_workmode()
1453 workmode <<= id - AXP22X_DCDC1; in axp20x_set_dcdc_workmode()
1458 return -EINVAL; in axp20x_set_dcdc_workmode()
1460 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP803_DCDC1); in axp20x_set_dcdc_workmode()
1461 workmode <<= id - AXP803_DCDC1; in axp20x_set_dcdc_workmode()
1466 return -EINVAL; in axp20x_set_dcdc_workmode()
1468 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP813_DCDC1); in axp20x_set_dcdc_workmode()
1469 workmode <<= id - AXP813_DCDC1; in axp20x_set_dcdc_workmode()
1475 return -EINVAL; in axp20x_set_dcdc_workmode()
1477 mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP15060_DCDC1); in axp20x_set_dcdc_workmode()
1478 workmode <<= id - AXP15060_DCDC1; in axp20x_set_dcdc_workmode()
1484 return -EINVAL; in axp20x_set_dcdc_workmode()
1487 return regmap_update_bits(rdev->regmap, reg, mask, workmode); in axp20x_set_dcdc_workmode()
1491 * This function checks whether a regulator is part of a poly-phase
1502 switch (axp20x->variant) { in axp20x_is_polyphase_slave()
1505 regmap_read(axp20x->regmap, AXP803_POLYPHASE_CTRL, &reg); in axp20x_is_polyphase_slave()
1516 regmap_read(axp20x->regmap, AXP806_DCDC_MODE_CTRL2, &reg); in axp20x_is_polyphase_slave()
1533 regmap_read(axp20x->regmap, AXP15060_DCDC_MODE_CTRL1, &reg); in axp20x_is_polyphase_slave()
1544 regmap_read(axp20x->regmap, AXP323_DCDC_MODE_CTRL2, &reg); in axp20x_is_polyphase_slave()
1562 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_regulator_probe()
1565 .dev = pdev->dev.parent, in axp20x_regulator_probe()
1566 .regmap = axp20x->regmap, in axp20x_regulator_probe()
1570 u32 workmode; in axp20x_regulator_probe() local
1576 switch (axp20x->variant) { in axp20x_regulator_probe()
1586 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1587 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1601 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1602 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1615 drivevbus = of_property_read_bool(pdev->dev.parent->of_node, in axp20x_regulator_probe()
1616 "x-powers,drive-vbus-en"); in axp20x_regulator_probe()
1623 dev_err(&pdev->dev, "Unsupported AXP variant: %d\n", in axp20x_regulator_probe()
1624 axp20x->variant); in axp20x_regulator_probe()
1625 return -EINVAL; in axp20x_regulator_probe()
1628 /* This only sets the dcdc freq. Ignore any errors */ in axp20x_regulator_probe()
1636 * If this regulator is a slave in a poly-phase setup, in axp20x_regulator_probe()
1644 if (axp20x->variant == AXP813_ID && i == AXP813_FLDO3) in axp20x_regulator_probe()
1661 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1664 return -ENOMEM; in axp20x_regulator_probe()
1667 new_desc->supply_name = dcdc1_name; in axp20x_regulator_probe()
1674 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1677 return -ENOMEM; in axp20x_regulator_probe()
1680 new_desc->supply_name = dcdc5_name; in axp20x_regulator_probe()
1686 new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), in axp20x_regulator_probe()
1689 return -ENOMEM; in axp20x_regulator_probe()
1692 new_desc->supply_name = aldo1_name; in axp20x_regulator_probe()
1696 rdev = devm_regulator_register(&pdev->dev, desc, &config); in axp20x_regulator_probe()
1698 dev_err(&pdev->dev, "Failed to register %s\n", in axp20x_regulator_probe()
1704 ret = of_property_read_u32(rdev->dev.of_node, in axp20x_regulator_probe()
1705 "x-powers,dcdc-workmode", in axp20x_regulator_probe()
1706 &workmode); in axp20x_regulator_probe()
1708 if (axp20x_set_dcdc_workmode(rdev, i, workmode)) in axp20x_regulator_probe()
1709 dev_err(&pdev->dev, "Failed to set workmode on %s\n", in axp20x_regulator_probe()
1710 rdev->desc->name); in axp20x_regulator_probe()
1719 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1720 "regulator-name", in axp20x_regulator_probe()
1726 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1727 "regulator-name", in axp20x_regulator_probe()
1731 of_property_read_string(rdev->dev.of_node, in axp20x_regulator_probe()
1732 "regulator-name", in axp20x_regulator_probe()
1738 regmap_update_bits(axp20x->regmap, AXP20X_OVER_TMP, in axp20x_regulator_probe()
1740 rdev = devm_regulator_register(&pdev->dev, in axp20x_regulator_probe()
1744 dev_err(&pdev->dev, "Failed to register drivevbus\n"); in axp20x_regulator_probe()
1755 .name = "axp20x-regulator",
1765 MODULE_ALIAS("platform:axp20x-regulator");