Lines Matching +full:- +full:30 +full:mv
1 // SPDX-License-Identifier: GPL-2.0-only
4 // bd71815-regulator.c ROHM BD71815 regulator driver
21 #include <linux/mfd/rohm-generic.h>
22 #include <linux/mfd/rohm-bd71815.h>
31 10, 20, 30, 50, 70, 100, 200, 300, 500, 700, 1000, 2000, 3000, 4000,
179 return rohm_regulator_set_dvs_levels(data->dvs, np, desc, cfg->regmap); in set_hw_dvs_levels()
185 * by a control bit in register - or by HW state. If HW state specific voltages
186 * are given - then we assume HW state based control should be used.
188 * If volatge value is updated to currently selected register - then output
203 if (of_property_present(np, "rohm,dvs-run-voltage") || in buck12_set_hw_dvs_levels()
204 of_property_present(np, "rohm,dvs-suspend-voltage") || in buck12_set_hw_dvs_levels()
205 of_property_present(np, "rohm,dvs-lpsr-voltage") || in buck12_set_hw_dvs_levels()
206 of_property_present(np, "rohm,dvs-snvs-voltage")) { in buck12_set_hw_dvs_levels()
207 ret = regmap_read(cfg->regmap, desc->vsel_reg, &val); in buck12_set_hw_dvs_levels()
221 ret = regmap_read(cfg->regmap, desc->vsel_reg + 1, in buck12_set_hw_dvs_levels()
226 ret = regmap_update_bits(cfg->regmap, desc->vsel_reg, in buck12_set_hw_dvs_levels()
233 ret = rohm_regulator_set_dvs_levels(data->dvs, np, desc, in buck12_set_hw_dvs_levels()
234 cfg->regmap); in buck12_set_hw_dvs_levels()
238 * DVS levels were given => use HW-state machine for voltage in buck12_set_hw_dvs_levels()
240 * by SW the ramp-rate is not respected. Should we disable in buck12_set_hw_dvs_levels()
243 ret = regmap_update_bits(cfg->regmap, desc->vsel_reg, in buck12_set_hw_dvs_levels()
254 * 00: 10.00mV/usec 10mV 1uS
255 * 01: 5.00mV/usec 10mV 2uS
256 * 10: 2.50mV/usec 10mV 4uS
257 * 11: 1.25mV/usec 10mV 8uS
302 ret = regmap_read(rdev->regmap, regh, &val); in bd7181x_buck12_get_voltage_sel()
307 * If we use HW state machine based voltage reg selection - then we in bd7181x_buck12_get_voltage_sel()
314 ret = regmap_read(rdev->regmap, regl, &val); in bd7181x_buck12_get_voltage_sel()
334 ret = regmap_read(rdev->regmap, regh, &val); in bd7181x_buck12_set_voltage_sel()
339 * If bucks 1 & 2 are controlled by state machine - then the RUN state in bd7181x_buck12_set_voltage_sel()
344 return regmap_update_bits(rdev->regmap, regh, BD71815_VOLT_MASK, in bd7181x_buck12_set_voltage_sel()
353 ret = regmap_update_bits(rdev->regmap, reg, BD71815_VOLT_MASK, sel); in bd7181x_buck12_set_voltage_sel()
358 return regmap_update_bits(rdev->regmap, regh, BD71815_BUCK_DVSSEL, in bd7181x_buck12_set_voltage_sel()
432 .n_voltages = ((max) - (min)) / (step) + 1, \
455 .n_voltages = ((max) - (min)) / (step) + 1, \
501 .n_voltages = ((max) - (min)) / (step) + 1, \
568 regmap = dev_get_regmap(pdev->dev.parent, NULL); in bd7181x_probe()
570 dev_err(&pdev->dev, "No parent regmap\n"); in bd7181x_probe()
571 return -ENODEV; in bd7181x_probe()
574 ldo4_en = devm_fwnode_gpiod_get(&pdev->dev, in bd7181x_probe()
575 dev_fwnode(pdev->dev.parent), in bd7181x_probe()
576 "rohm,vsel", GPIOD_ASIS, "ldo4-en"); in bd7181x_probe()
579 if (ret != -ENOENT) in bd7181x_probe()
584 /* Disable to go to ship-mode */ in bd7181x_probe()
589 config.dev = pdev->dev.parent; in bd7181x_probe()
603 rdev = devm_regulator_register(&pdev->dev, desc, &config); in bd7181x_probe()
605 return dev_err_probe(&pdev->dev, PTR_ERR(rdev), in bd7181x_probe()
607 desc->name); in bd7181x_probe()
613 { "bd71815-pmic", ROHM_CHIP_TYPE_BD71815 },
620 .name = "bd7181x-pmic",
631 MODULE_ALIAS("platform:bd7181x-pmic");