Loading Documentation/devicetree/bindings/regulator/ltc3676.txt 0 → 100644 +94 −0 Original line number Diff line number Diff line Linear Technology LTC3676 8-output regulators Required properties: - compatible: "lltc,ltc3676" - reg: I2C slave address Required child node: - regulators: Contains eight regulator child nodes sw1, sw2, sw3, sw4, ldo1, ldo2, ldo3, and ldo4, specifying the initialization data as documented in Documentation/devicetree/bindings/regulator/regulator.txt. Each regulator is defined using the standard binding for regulators. The nodes for sw1, sw2, sw3, sw4, ldo1, ldo2 and ldo4 additionally need to specify the resistor values of their external feedback voltage dividers: Required properties (not on ldo3): - lltc,fb-voltage-divider: An array of two integers containing the resistor values R1 and R2 of the feedback voltage divider in ohms. Regulators sw1, sw2, sw3, sw4 can regulate the feedback reference from: 412.5mV to 800mV in 12.5 mV steps. The output voltage thus ranges between 0.4125 * (1 + R1/R2) V and 0.8 * (1 + R1/R2) V. Regulators ldo1, ldo2, and ldo4 have a fixed 0.725 V reference and thus output 0.725 * (1 + R1/R2) V. The ldo3 regulator is fixed to 1.8 V. The ldo1 standby regulator can not be disabled and thus should have the regulator-always-on property set. Example: ltc3676: pmic@3c { compatible = "lltc,ltc3676"; reg = <0x3c>; regulators { sw1_reg: sw1 { regulator-min-microvolt = <674400>; regulator-max-microvolt = <1308000>; lltc,fb-voltage-divider = <127000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw2_reg: sw2 { regulator-min-microvolt = <1033310>; regulator-max-microvolt = <200400>; lltc,fb-voltage-divider = <301000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw3_reg: sw3 { regulator-min-microvolt = <674400>; regulator-max-microvolt = <130800>; lltc,fb-voltage-divider = <127000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw4_reg: sw4 { regulator-min-microvolt = <868310>; regulator-max-microvolt = <168400>; lltc,fb-voltage-divider = <221000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; ldo2_reg: ldo2 { regulator-min-microvolt = <2490375>; regulator-max-microvolt = <2490375>; lltc,fb-voltage-divider = <487000 200000>; regulator-boot-on; regulator-always-on; }; ldo3_reg: ldo3 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-boot-on; }; ldo4_reg: ldo4 { regulator-min-microvolt = <3023250>; regulator-max-microvolt = <3023250>; lltc,fb-voltage-divider = <634000 200000>; regulator-boot-on; regulator-always-on; }; }; }; drivers/regulator/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,14 @@ config REGULATOR_LTC3589 This enables support for the LTC3589, LTC3589-1, and LTC3589-2 8-output regulators controlled via I2C. config REGULATOR_LTC3676 tristate "LTC3676 8-output voltage regulator" depends on I2C select REGMAP_I2C help This enables support for the LTC3676 8-output regulators controlled via I2C. config REGULATOR_MAX14577 tristate "Maxim 14577/77836 regulator" depends on MFD_MAX14577 Loading drivers/regulator/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o obj-$(CONFIG_REGULATOR_LTC3676) += ltc3676.o obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o Loading drivers/regulator/core.c +20 −22 Original line number Diff line number Diff line Loading @@ -679,6 +679,18 @@ static int drms_uA_update(struct regulator_dev *rdev) !rdev->desc->ops->set_load) return -EINVAL; /* calc total requested load */ list_for_each_entry(sibling, &rdev->consumer_list, list) current_uA += sibling->uA_load; current_uA += rdev->constraints->system_load; if (rdev->desc->ops->set_load) { /* set the optimum mode for our new total regulator load */ err = rdev->desc->ops->set_load(rdev, current_uA); if (err < 0) rdev_err(rdev, "failed to set load %d\n", current_uA); } else { /* get output voltage */ output_uV = _regulator_get_voltage(rdev); if (output_uV <= 0) { Loading @@ -697,18 +709,6 @@ static int drms_uA_update(struct regulator_dev *rdev) return -EINVAL; } /* calc total requested load */ list_for_each_entry(sibling, &rdev->consumer_list, list) current_uA += sibling->uA_load; current_uA += rdev->constraints->system_load; if (rdev->desc->ops->set_load) { /* set the optimum mode for our new total regulator load */ err = rdev->desc->ops->set_load(rdev, current_uA); if (err < 0) rdev_err(rdev, "failed to set load %d\n", current_uA); } else { /* now get the optimum mode for our new total regulator load */ mode = rdev->desc->ops->get_optimum_mode(rdev, input_uV, output_uV, current_uA); Loading Loading @@ -3483,10 +3483,8 @@ int regulator_bulk_get(struct device *dev, int num_consumers, consumers[i].consumer = NULL; for (i = 0; i < num_consumers; i++) { consumers[i].consumer = _regulator_get(dev, consumers[i].supply, false, !consumers[i].optional); consumers[i].consumer = regulator_get(dev, consumers[i].supply); if (IS_ERR(consumers[i].consumer)) { ret = PTR_ERR(consumers[i].consumer); dev_err(dev, "Failed to get supply '%s': %d\n", Loading drivers/regulator/dbx500-prcmu.c +0 −18 Original line number Diff line number Diff line Loading @@ -75,24 +75,6 @@ static struct ux500_regulator_debug { u8 *state_after_suspend; } rdebug; void ux500_regulator_suspend_debug(void) { int i; for (i = 0; i < rdebug.num_regulators; i++) rdebug.state_before_suspend[i] = rdebug.regulator_array[i].is_enabled; } void ux500_regulator_resume_debug(void) { int i; for (i = 0; i < rdebug.num_regulators; i++) rdebug.state_after_suspend[i] = rdebug.regulator_array[i].is_enabled; } static int ux500_regulator_power_state_cnt_print(struct seq_file *s, void *p) { /* print power state count */ Loading Loading
Documentation/devicetree/bindings/regulator/ltc3676.txt 0 → 100644 +94 −0 Original line number Diff line number Diff line Linear Technology LTC3676 8-output regulators Required properties: - compatible: "lltc,ltc3676" - reg: I2C slave address Required child node: - regulators: Contains eight regulator child nodes sw1, sw2, sw3, sw4, ldo1, ldo2, ldo3, and ldo4, specifying the initialization data as documented in Documentation/devicetree/bindings/regulator/regulator.txt. Each regulator is defined using the standard binding for regulators. The nodes for sw1, sw2, sw3, sw4, ldo1, ldo2 and ldo4 additionally need to specify the resistor values of their external feedback voltage dividers: Required properties (not on ldo3): - lltc,fb-voltage-divider: An array of two integers containing the resistor values R1 and R2 of the feedback voltage divider in ohms. Regulators sw1, sw2, sw3, sw4 can regulate the feedback reference from: 412.5mV to 800mV in 12.5 mV steps. The output voltage thus ranges between 0.4125 * (1 + R1/R2) V and 0.8 * (1 + R1/R2) V. Regulators ldo1, ldo2, and ldo4 have a fixed 0.725 V reference and thus output 0.725 * (1 + R1/R2) V. The ldo3 regulator is fixed to 1.8 V. The ldo1 standby regulator can not be disabled and thus should have the regulator-always-on property set. Example: ltc3676: pmic@3c { compatible = "lltc,ltc3676"; reg = <0x3c>; regulators { sw1_reg: sw1 { regulator-min-microvolt = <674400>; regulator-max-microvolt = <1308000>; lltc,fb-voltage-divider = <127000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw2_reg: sw2 { regulator-min-microvolt = <1033310>; regulator-max-microvolt = <200400>; lltc,fb-voltage-divider = <301000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw3_reg: sw3 { regulator-min-microvolt = <674400>; regulator-max-microvolt = <130800>; lltc,fb-voltage-divider = <127000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; sw4_reg: sw4 { regulator-min-microvolt = <868310>; regulator-max-microvolt = <168400>; lltc,fb-voltage-divider = <221000 200000>; regulator-ramp-delay = <7000>; regulator-boot-on; regulator-always-on; }; ldo2_reg: ldo2 { regulator-min-microvolt = <2490375>; regulator-max-microvolt = <2490375>; lltc,fb-voltage-divider = <487000 200000>; regulator-boot-on; regulator-always-on; }; ldo3_reg: ldo3 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-boot-on; }; ldo4_reg: ldo4 { regulator-min-microvolt = <3023250>; regulator-max-microvolt = <3023250>; lltc,fb-voltage-divider = <634000 200000>; regulator-boot-on; regulator-always-on; }; }; };
drivers/regulator/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,14 @@ config REGULATOR_LTC3589 This enables support for the LTC3589, LTC3589-1, and LTC3589-2 8-output regulators controlled via I2C. config REGULATOR_LTC3676 tristate "LTC3676 8-output voltage regulator" depends on I2C select REGMAP_I2C help This enables support for the LTC3676 8-output regulators controlled via I2C. config REGULATOR_MAX14577 tristate "Maxim 14577/77836 regulator" depends on MFD_MAX14577 Loading
drivers/regulator/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o obj-$(CONFIG_REGULATOR_LTC3676) += ltc3676.o obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o Loading
drivers/regulator/core.c +20 −22 Original line number Diff line number Diff line Loading @@ -679,6 +679,18 @@ static int drms_uA_update(struct regulator_dev *rdev) !rdev->desc->ops->set_load) return -EINVAL; /* calc total requested load */ list_for_each_entry(sibling, &rdev->consumer_list, list) current_uA += sibling->uA_load; current_uA += rdev->constraints->system_load; if (rdev->desc->ops->set_load) { /* set the optimum mode for our new total regulator load */ err = rdev->desc->ops->set_load(rdev, current_uA); if (err < 0) rdev_err(rdev, "failed to set load %d\n", current_uA); } else { /* get output voltage */ output_uV = _regulator_get_voltage(rdev); if (output_uV <= 0) { Loading @@ -697,18 +709,6 @@ static int drms_uA_update(struct regulator_dev *rdev) return -EINVAL; } /* calc total requested load */ list_for_each_entry(sibling, &rdev->consumer_list, list) current_uA += sibling->uA_load; current_uA += rdev->constraints->system_load; if (rdev->desc->ops->set_load) { /* set the optimum mode for our new total regulator load */ err = rdev->desc->ops->set_load(rdev, current_uA); if (err < 0) rdev_err(rdev, "failed to set load %d\n", current_uA); } else { /* now get the optimum mode for our new total regulator load */ mode = rdev->desc->ops->get_optimum_mode(rdev, input_uV, output_uV, current_uA); Loading Loading @@ -3483,10 +3483,8 @@ int regulator_bulk_get(struct device *dev, int num_consumers, consumers[i].consumer = NULL; for (i = 0; i < num_consumers; i++) { consumers[i].consumer = _regulator_get(dev, consumers[i].supply, false, !consumers[i].optional); consumers[i].consumer = regulator_get(dev, consumers[i].supply); if (IS_ERR(consumers[i].consumer)) { ret = PTR_ERR(consumers[i].consumer); dev_err(dev, "Failed to get supply '%s': %d\n", Loading
drivers/regulator/dbx500-prcmu.c +0 −18 Original line number Diff line number Diff line Loading @@ -75,24 +75,6 @@ static struct ux500_regulator_debug { u8 *state_after_suspend; } rdebug; void ux500_regulator_suspend_debug(void) { int i; for (i = 0; i < rdebug.num_regulators; i++) rdebug.state_before_suspend[i] = rdebug.regulator_array[i].is_enabled; } void ux500_regulator_resume_debug(void) { int i; for (i = 0; i < rdebug.num_regulators; i++) rdebug.state_after_suspend[i] = rdebug.regulator_array[i].is_enabled; } static int ux500_regulator_power_state_cnt_print(struct seq_file *s, void *p) { /* print power state count */ Loading