Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branches 'regulator/topic/load', 'regulator/topic/max77802', 'regulator/topic/pwm', 'regulator/topic/qcom-smd' and 'regulator/topic/stw481x' into regulator-next

+72 -22
+24 -1
Documentation/devicetree/bindings/regulator/max77802.txt
··· 8 8 9 9 Following properties should be present in main device node of the MFD chip. 10 10 11 - Optional node: 11 + Optional properties: 12 + - inb1-supply: The input supply for BUCK1 13 + - inb2-supply: The input supply for BUCK2 14 + - inb3-supply: The input supply for BUCK3 15 + - inb4-supply: The input supply for BUCK4 16 + - inb5-supply: The input supply for BUCK5 17 + - inb6-supply: The input supply for BUCK6 18 + - inb7-supply: The input supply for BUCK7 19 + - inb8-supply: The input supply for BUCK8 20 + - inb9-supply: The input supply for BUCK9 21 + - inb10-supply: The input supply for BUCK10 22 + - inl1-supply: The input supply for LDO8 and LDO15 23 + - inl2-supply: The input supply for LDO17, LDO27, LDO30 and LDO35 24 + - inl3-supply: The input supply for LDO3, LDO5, LDO6 and LDO7 25 + - inl4-supply: The input supply for LDO10, LDO11, LDO13 and LDO14 26 + - inl5-supply: The input supply for LDO9 and LDO19 27 + - inl6-supply: The input supply for LDO4, LDO21, LDO24 and LDO33 28 + - inl7-supply: The input supply for LDO18, LDO20, LDO28 and LDO29 29 + - inl9-supply: The input supply for LDO12, LDO23, LDO25, LDO26, LDO32 and LDO34 30 + - inl10-supply: The input supply for LDO1 and LDO2 31 + 32 + Optional nodes: 12 33 - regulators : The regulators of max77802 have to be instantiated 13 34 under subnode named "regulators" using the following format. 14 35 ··· 78 57 reg = <0x09>; 79 58 #address-cells = <1>; 80 59 #size-cells = <0>; 60 + 61 + inb1-supply = <&parent_reg>; 81 62 82 63 regulators { 83 64 ldo1_reg: LDO1 {
+1
Documentation/devicetree/bindings/regulator/regulator.txt
··· 11 11 - regulator-always-on: boolean, regulator should never be disabled 12 12 - regulator-boot-on: bootloader/firmware enabled regulator 13 13 - regulator-allow-bypass: allow the regulator to go into bypass mode 14 + - regulator-allow-set-load: allow the regulator performance level to be configured 14 15 - <name>-supply: phandle to the parent supply/regulator node 15 16 - regulator-ramp-delay: ramp delay for regulator(in uV/uS) 16 17 For hardware which supports disabling ramp rate, it should be explicitly
+1 -1
drivers/regulator/Kconfig
··· 627 627 628 628 config REGULATOR_STW481X_VMMC 629 629 bool "ST Microelectronics STW481X VMMC regulator" 630 - depends on MFD_STW481X 630 + depends on MFD_STW481X || COMPILE_TEST 631 631 default y if MFD_STW481X 632 632 help 633 633 This driver supports the internal VMMC regulator in the STw481x
+3
drivers/regulator/of_regulator.c
··· 76 76 if (of_property_read_bool(np, "regulator-allow-bypass")) 77 77 constraints->valid_ops_mask |= REGULATOR_CHANGE_BYPASS; 78 78 79 + if (of_property_read_bool(np, "regulator-allow-set-load")) 80 + constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS; 81 + 79 82 ret = of_property_read_u32(np, "regulator-ramp-delay", &pval); 80 83 if (!ret) { 81 84 if (pval)
+29 -6
drivers/regulator/pwm-regulator.c
··· 69 69 70 70 drvdata->state = selector; 71 71 72 - ret = pwm_enable(drvdata->pwm); 73 - if (ret) { 74 - dev_err(&rdev->dev, "Failed to enable PWM\n"); 75 - return ret; 76 - } 77 - 78 72 return 0; 79 73 } 80 74 ··· 81 87 return -EINVAL; 82 88 83 89 return drvdata->duty_cycle_table[selector].uV; 90 + } 91 + 92 + static int pwm_regulator_enable(struct regulator_dev *dev) 93 + { 94 + struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); 95 + 96 + return pwm_enable(drvdata->pwm); 97 + } 98 + 99 + static int pwm_regulator_disable(struct regulator_dev *dev) 100 + { 101 + struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); 102 + 103 + pwm_disable(drvdata->pwm); 104 + 105 + return 0; 106 + } 107 + 108 + static int pwm_regulator_is_enabled(struct regulator_dev *dev) 109 + { 110 + struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); 111 + 112 + return pwm_is_enabled(drvdata->pwm); 84 113 } 85 114 86 115 /** ··· 161 144 .get_voltage_sel = pwm_regulator_get_voltage_sel, 162 145 .list_voltage = pwm_regulator_list_voltage, 163 146 .map_voltage = regulator_map_voltage_iterate, 147 + .enable = pwm_regulator_enable, 148 + .disable = pwm_regulator_disable, 149 + .is_enabled = pwm_regulator_is_enabled, 164 150 }; 165 151 166 152 static struct regulator_ops pwm_regulator_voltage_continuous_ops = { 167 153 .get_voltage = pwm_regulator_get_voltage, 168 154 .set_voltage = pwm_regulator_set_voltage, 155 + .enable = pwm_regulator_enable, 156 + .disable = pwm_regulator_disable, 157 + .is_enabled = pwm_regulator_is_enabled, 169 158 }; 170 159 171 160 static struct regulator_desc pwm_regulator_desc = {
+14 -14
drivers/regulator/qcom_smd-regulator.c
··· 36 36 }; 37 37 38 38 struct rpm_regulator_req { 39 - u32 key; 40 - u32 nbytes; 41 - u32 value; 39 + __le32 key; 40 + __le32 nbytes; 41 + __le32 value; 42 42 }; 43 43 44 44 #define RPM_KEY_SWEN 0x6e657773 /* "swen" */ ··· 62 62 struct rpm_regulator_req req; 63 63 int ret; 64 64 65 - req.key = RPM_KEY_SWEN; 66 - req.nbytes = sizeof(u32); 67 - req.value = 1; 65 + req.key = cpu_to_le32(RPM_KEY_SWEN); 66 + req.nbytes = cpu_to_le32(sizeof(u32)); 67 + req.value = cpu_to_le32(1); 68 68 69 69 ret = rpm_reg_write_active(vreg, &req, sizeof(req)); 70 70 if (!ret) ··· 86 86 struct rpm_regulator_req req; 87 87 int ret; 88 88 89 - req.key = RPM_KEY_SWEN; 90 - req.nbytes = sizeof(u32); 89 + req.key = cpu_to_le32(RPM_KEY_SWEN); 90 + req.nbytes = cpu_to_le32(sizeof(u32)); 91 91 req.value = 0; 92 92 93 93 ret = rpm_reg_write_active(vreg, &req, sizeof(req)); ··· 113 113 struct rpm_regulator_req req; 114 114 int ret = 0; 115 115 116 - req.key = RPM_KEY_UV; 117 - req.nbytes = sizeof(u32); 118 - req.value = min_uV; 116 + req.key = cpu_to_le32(RPM_KEY_UV); 117 + req.nbytes = cpu_to_le32(sizeof(u32)); 118 + req.value = cpu_to_le32(min_uV); 119 119 120 120 ret = rpm_reg_write_active(vreg, &req, sizeof(req)); 121 121 if (!ret) ··· 129 129 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 130 130 struct rpm_regulator_req req; 131 131 132 - req.key = RPM_KEY_MA; 133 - req.nbytes = sizeof(u32); 134 - req.value = load_uA; 132 + req.key = cpu_to_le32(RPM_KEY_MA); 133 + req.nbytes = cpu_to_le32(sizeof(u32)); 134 + req.value = cpu_to_le32(load_uA / 1000); 135 135 136 136 return rpm_reg_write_active(vreg, &req, sizeof(req)); 137 137 }