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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'regulator-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
"This has been a very quiet update for the regulator API, the bulk of
the diffstat is DT binding conversions and the most promient series in
the changelog is Johan Hovold cleaning up some leaks of OF nodes. For
some reason we have had several different people sending improvements
to better describe the parent supplies for existing regulators, these
look to be independent efforts.

The only new hardware support is for some Motorola custom varints of
cpcap"

* tag 'regulator-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (35 commits)
regulator: max77620: drop redundant OF node initialisation
regulator: bq257xx: Make OTG enable GPIO really optional
regulator: bq257xx: Remove reference to the parent MFD's dev
regulator: bd9571mwv: fix OF node reference imbalance
regulator: act8945a: fix OF node reference imbalance
regulator: s2dos05: fix OF node reference imbalance
regulator: mt6357: fix OF node reference imbalance
regulator: max77650: fix OF node reference imbalance
regulator: rk808: fix OF node reference imbalance
regulator: bq257xx: fix OF node reference imbalance
regulator: dt-bindings: qcom,qca6390-pmu: Document WCN6755 PMU
regulator: dt-bindings: regulator-max77620: convert to DT schema
regulator: mt6315: Add regulator supplies
regulator: dt-bindings: mt6315: Add regulator supplies
regulator: devres: Use enum regulator_get_type in internal functions
regulator: dt-bindings: mps,mp8859: convert to DT schema
regulator: da9121: Allow caching BUCK registers
regulator: dt-bindings: dlg,da9121: Add dlg,no-gpio-control
regulator: cros-ec: Add regulator supply
regulator: dt-bindings: cros-ec: Add regulator supply
...

+518 -347
+47 -2
Documentation/devicetree/bindings/mfd/spacemit,p1.yaml
··· 27 27 interrupts: 28 28 maxItems: 1 29 29 30 - vin-supply: 31 - description: Input supply phandle. 30 + vin1-supply: 31 + description: 32 + Power supply for BUCK1. Required if BUCK1 is defined. 33 + 34 + vin2-supply: 35 + description: 36 + Power supply for BUCK2. Required if BUCK2 is defined. 37 + 38 + vin3-supply: 39 + description: 40 + Power supply for BUCK3. Required if BUCK3 is defined. 41 + 42 + vin4-supply: 43 + description: 44 + Power supply for BUCK4. Required if BUCK4 is defined. 45 + 46 + vin5-supply: 47 + description: 48 + Power supply for BUCK5. Required if BUCK5 is defined. 49 + 50 + vin6-supply: 51 + description: 52 + Power supply for BUCK6. Required if BUCK6 is defined. 53 + 54 + aldoin-supply: 55 + description: 56 + Power supply for ALDO1-4. Required if any are defined. 57 + 58 + dldoin1-supply: 59 + description: 60 + Power supply for DLDO1-4. Required if any are defined. 61 + 62 + dldoin2-supply: 63 + description: 64 + Power supply for DLDO5-7. Required if any are defined. 32 65 33 66 regulators: 34 67 type: object ··· 91 58 compatible = "spacemit,p1"; 92 59 reg = <0x41>; 93 60 interrupts = <64>; 61 + vin1-supply = <&reg_vcc_5v>; 62 + vin5-supply = <&reg_vcc_5v>; 63 + aldoin-supply = <&reg_vcc_5v>; 64 + dldoin1-supply = <&buck5>; 94 65 95 66 regulators { 96 67 buck1 { 97 68 regulator-name = "buck1"; 69 + regulator-min-microvolt = <500000>; 70 + regulator-max-microvolt = <3450000>; 71 + regulator-ramp-delay = <5000>; 72 + regulator-always-on; 73 + }; 74 + 75 + buck5: buck5 { 76 + regulator-name = "buck5"; 98 77 regulator-min-microvolt = <500000>; 99 78 regulator-max-microvolt = <3450000>; 100 79 regulator-ramp-delay = <5000>;
-35
Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
··· 1 - Motorola CPCAP PMIC voltage regulators 2 - ------------------------------------ 3 - 4 - Requires node properties: 5 - - "compatible" value one of: 6 - "motorola,cpcap-regulator" 7 - "motorola,mapphone-cpcap-regulator" 8 - "motorola,xoom-cpcap-regulator" 9 - 10 - Required regulator properties: 11 - - "regulator-name" 12 - - "regulator-enable-ramp-delay" 13 - - "regulator-min-microvolt" 14 - - "regulator-max-microvolt" 15 - 16 - Optional regulator properties: 17 - - "regulator-boot-on" 18 - 19 - See Documentation/devicetree/bindings/regulator/regulator.txt 20 - for more details about the regulator properties. 21 - 22 - Example: 23 - 24 - cpcap_regulator: regulator { 25 - compatible = "motorola,cpcap-regulator"; 26 - 27 - cpcap_regulators: regulators { 28 - sw5: SW5 { 29 - regulator-min-microvolt = <5050000>; 30 - regulator-max-microvolt = <5050000>; 31 - regulator-enable-ramp-delay = <50000>; 32 - regulator-boot-on; 33 - }; 34 - }; 35 - };
+49
Documentation/devicetree/bindings/regulator/dlg,da9121.yaml
··· 81 81 Specify the polling period, measured in milliseconds, between interrupt status 82 82 update checks. Range 1000-10000 ms. 83 83 84 + dlg,no-gpio-control: 85 + type: boolean 86 + description: | 87 + Available GPIO input pins of the regulator are strapped to fixed levels, therefore 88 + GPIO configurable input functions, DVC/RELOAD/EN, cannot dynamically update BUCK 89 + registers. GPIO pins connected as output pins are not required to be strapped to a 90 + fixed level. Not allowed together with enable-gpios. 91 + 84 92 regulators: 85 93 type: object 86 94 additionalProperties: false ··· 142 134 properties: 143 135 buck2: false 144 136 137 + - if: 138 + required: 139 + - dlg,no-gpio-control 140 + then: 141 + properties: 142 + regulators: 143 + patternProperties: 144 + "^buck([1-2])$": 145 + properties: 146 + enable-gpios: false 147 + 145 148 additionalProperties: false 146 149 147 150 examples: ··· 182 163 regulator-boot-on; 183 164 regulator-initial-mode = <DA9121_BUCK_MODE_AUTO>; 184 165 enable-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; 166 + }; 167 + }; 168 + }; 169 + }; 170 + 171 + - | 172 + #include <dt-bindings/interrupt-controller/irq.h> 173 + #include <dt-bindings/regulator/dlg,da9121-regulator.h> 174 + i2c { 175 + #address-cells = <1>; 176 + #size-cells = <0>; 177 + pmic@68 { 178 + compatible = "dlg,da9121"; 179 + reg = <0x68>; 180 + 181 + interrupt-parent = <&gpio6>; 182 + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; 183 + 184 + dlg,irq-polling-delay-passive-ms = <2000>; 185 + dlg,no-gpio-control; 186 + 187 + regulators { 188 + DA9121_BUCK: buck1 { 189 + regulator-name = "BUCK1"; 190 + regulator-min-microvolt = <300000>; 191 + regulator-max-microvolt = <1900000>; 192 + regulator-min-microamp = <7000000>; 193 + regulator-max-microamp = <20000000>; 194 + regulator-boot-on; 195 + regulator-initial-mode = <DA9121_BUCK_MODE_AUTO>; 185 196 }; 186 197 }; 187 198 };
+1
Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml
··· 66 66 required: 67 67 - compatible 68 68 - reg 69 + - vin-supply 69 70 - pg-gpios 70 71 - enable-gpios 71 72
+4
Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.yaml
··· 24 24 maxItems: 1 25 25 description: Identifier for the voltage regulator to ChromeOS EC. 26 26 27 + vin-supply: 28 + description: Input supply phandle 29 + 27 30 required: 28 31 - compatible 29 32 - reg ··· 51 48 regulator-min-microvolt = <1800000>; 52 49 regulator-max-microvolt = <3300000>; 53 50 reg = <0>; 51 + vin-supply = <&pp4200_s5>; 54 52 }; 55 53 }; 56 54 };
+99
Documentation/devicetree/bindings/regulator/maxim,max77620-regulator.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/maxim,max77620-regulator.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Regulator for MAX77620 Power management IC from Maxim Semiconductor. 8 + 9 + maintainers: 10 + - Svyatoslav Ryhel <clamor95@gmail.com> 11 + 12 + description: 13 + Device has multiple DCDC(sd[0-3]) and LDOs(ldo[0-8]). The input supply 14 + of these regulators are defined under parent device node. Details of 15 + regulator properties are defined as child node under sub-node "regulators" 16 + which is child node of device node. 17 + 18 + patternProperties: 19 + "^in-(sd[0-3]|ldo(0-1|2|3-5|4-6|7-8))-supply$": 20 + $ref: /schemas/types.yaml#/definitions/phandle 21 + description: Input supply for DCDC or LDO 22 + 23 + "^(sd[0-3]|ldo[0-8])$": 24 + type: object 25 + $ref: /schemas/regulator/regulator.yaml# 26 + unevaluatedProperties: false 27 + 28 + properties: 29 + maxim,active-fps-source: 30 + $ref: /schemas/types.yaml#/definitions/uint32 31 + description: | 32 + FPS source for the GPIOs to get enabled/disabled when system is in 33 + active state. Valid values are: 34 + - MAX77620_FPS_SRC_0: FPS source is FPS0. 35 + - MAX77620_FPS_SRC_1: FPS source is FPS1 36 + - MAX77620_FPS_SRC_2: FPS source is FPS2 37 + - MAX77620_FPS_SRC_NONE: GPIO is not controlled by FPS events and 38 + it gets enabled/disabled by register access. 39 + Absence of this property will leave the FPS configuration register 40 + for that GPIO to default configuration. 41 + 42 + maxim,active-fps-power-up-slot: 43 + $ref: /schemas/types.yaml#/definitions/uint32 44 + description: 45 + Sequencing event slot number on which the GPIO get enabled when 46 + master FPS input event set to HIGH. This is applicable if FPS source 47 + is selected as FPS0, FPS1 or FPS2. 48 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 49 + 50 + maxim,active-fps-power-down-slot: 51 + $ref: /schemas/types.yaml#/definitions/uint32 52 + description: 53 + Sequencing event slot number on which the GPIO get disabled when 54 + master FPS input event set to LOW. This is applicable if FPS source 55 + is selected as FPS0, FPS1 or FPS2. 56 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 57 + 58 + maxim,suspend-fps-source: 59 + $ref: /schemas/types.yaml#/definitions/uint32 60 + description: 61 + This is same as property "maxim,active-fps-source" but value get 62 + configured when system enters in to suspend state. 63 + 64 + maxim,suspend-fps-power-up-slot: 65 + $ref: /schemas/types.yaml#/definitions/uint32 66 + description: 67 + This is same as property "maxim,active-fps-power-up-slot" but this 68 + value get configured into FPS configuration register when system 69 + enters into suspend. This is applicable if suspend state FPS source 70 + is selected as FPS0, FPS1 or FPS2. 71 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 72 + 73 + maxim,suspend-fps-power-down-slot: 74 + $ref: /schemas/types.yaml#/definitions/uint32 75 + description: 76 + This is same as property "maxim,active-fps-power-down-slot" but this 77 + value get configured into FPS configuration register when system 78 + enters into suspend. This is applicable if suspend state FPS source 79 + is selected as FPS0, FPS1 or FPS2. 80 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 81 + 82 + maxim,ramp-rate-setting: 83 + $ref: /schemas/types.yaml#/definitions/uint32 84 + description: | 85 + Ramp rate(uV/us) setting to be configured to the device. The platform 86 + may have different ramp rate than advertised ramp rate if it has design 87 + variation from Maxim's recommended. On this case, platform specific 88 + ramp rate is used for ramp time calculation and this property is used 89 + for device register configurations. The measured ramp rate of platform 90 + is provided by the regulator-ramp-delay. 91 + 92 + Maxim Max77620 supports following ramp delay: 93 + SD: 13.75mV/us, 27.5mV/us, 55mV/us 94 + LDOs: 5mV/us, 100mV/us 95 + enum: [5000, 13750, 27500, 55000, 100000] 96 + 97 + additionalProperties: false 98 + 99 + # see maxim,max77620.yaml for an example
+47
Documentation/devicetree/bindings/regulator/motorola,cpcap-regulator.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/motorola,cpcap-regulator.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Motorola CPCAP PMIC regulators 8 + 9 + maintainers: 10 + - Svyatoslav Ryhel <clamor95@gmail.com> 11 + 12 + description: 13 + This module is part of the Motorola CPCAP MFD device. For more details 14 + see Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml. The 15 + regulator controller is represented as a sub-node of the PMIC node 16 + on the device tree. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - motorola,cpcap-regulator 22 + - motorola,mapphone-cpcap-regulator 23 + - motorola,mot-cpcap-regulator 24 + - motorola,xoom-cpcap-regulator 25 + 26 + regulators: 27 + type: object 28 + 29 + patternProperties: 30 + "^(SW[1-6]|V(CAM|CSI|DAC|DIG|FUSE|HVIO|SDIO|PLL|RF[12]|RFREF|WLAN[12]|SIM|SIMCARD|VIB|USB|AUDIO))$": 31 + $ref: /schemas/regulator/regulator.yaml# 32 + type: object 33 + 34 + required: 35 + - regulator-name 36 + - regulator-enable-ramp-delay 37 + - regulator-min-microvolt 38 + - regulator-max-microvolt 39 + 40 + unevaluatedProperties: false 41 + 42 + required: 43 + - compatible 44 + 45 + additionalProperties: false 46 + 47 + ...
-22
Documentation/devicetree/bindings/regulator/mp8859.txt
··· 1 - Monolithic Power Systems MP8859 voltage regulator 2 - 3 - Required properties: 4 - - compatible: "mps,mp8859"; 5 - - reg: I2C slave address. 6 - 7 - Optional subnode for regulator: "mp8859_dcdc", using common regulator 8 - bindings given in <Documentation/devicetree/bindings/regulator/regulator.txt>. 9 - 10 - Example: 11 - 12 - mp8859: regulator@66 { 13 - compatible = "mps,mp8859"; 14 - reg = <0x66>; 15 - dc_12v: mp8859_dcdc { 16 - regulator-name = "dc_12v"; 17 - regulator-min-microvolt = <12000000>; 18 - regulator-max-microvolt = <12000000>; 19 - regulator-boot-on; 20 - regulator-always-on; 21 - }; 22 - };
+54
Documentation/devicetree/bindings/regulator/mps,mp8859.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/mps,mp8859.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Monolithic Power Systems MP8859 Voltage Regulator 8 + 9 + maintainers: 10 + - Markus Reichl <reichl@t-online.de> 11 + 12 + description: 13 + The MP8859 is a synchronous, 4-switch, integrated buck-boost converter 14 + capable of regulating the output voltage from 2.8V to 22V wide input voltage 15 + range with high efficiency. 16 + 17 + properties: 18 + compatible: 19 + const: mps,mp8859 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + mp8859_dcdc: 25 + $ref: /schemas/regulator/regulator.yaml# 26 + type: object 27 + description: DCDC regulator subnode 28 + unevaluatedProperties: false 29 + 30 + required: 31 + - compatible 32 + - reg 33 + 34 + additionalProperties: false 35 + 36 + examples: 37 + - | 38 + i2c { 39 + #address-cells = <1>; 40 + #size-cells = <0>; 41 + 42 + regulator@66 { 43 + compatible = "mps,mp8859"; 44 + reg = <0x66>; 45 + 46 + mp8859_dcdc { 47 + regulator-name = "dc_12v"; 48 + regulator-min-microvolt = <12000000>; 49 + regulator-max-microvolt = <12000000>; 50 + regulator-boot-on; 51 + regulator-always-on; 52 + }; 53 + }; 54 + };
+12
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
··· 25 25 reg: 26 26 maxItems: 1 27 27 28 + pvdd1-supply: 29 + description: Supply for regulator vbuck1 30 + pvdd2-supply: 31 + description: Supply for regulator vbuck2 32 + pvdd3-supply: 33 + description: Supply for regulator vbuck3 34 + pvdd4-supply: 35 + description: Supply for regulator vbuck4 36 + 28 37 regulators: 29 38 type: object 30 39 description: List of regulators and its properties ··· 58 49 pmic@6 { 59 50 compatible = "mediatek,mt6315-regulator"; 60 51 reg = <0x6 0>; 52 + pvdd1-supply = <&pp4200_z2>; 53 + pvdd3-supply = <&pp4200_z2>; 61 54 62 55 regulators { 56 + 63 57 vbuck1 { 64 58 regulator-min-microvolt = <300000>; 65 59 regulator-max-microvolt = <1193750>;
+11 -5
Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml
··· 16 16 17 17 properties: 18 18 compatible: 19 - enum: 20 - - qcom,qca6390-pmu 21 - - qcom,wcn6750-pmu 22 - - qcom,wcn6855-pmu 23 - - qcom,wcn7850-pmu 19 + oneOf: 20 + - items: 21 + - enum: 22 + - qcom,wcn6755-pmu 23 + - const: qcom,wcn6750-pmu 24 + 25 + - enum: 26 + - qcom,qca6390-pmu 27 + - qcom,wcn6750-pmu 28 + - qcom,wcn6855-pmu 29 + - qcom,wcn7850-pmu 24 30 25 31 vdd-supply: 26 32 description: VDD supply regulator handle
-222
Documentation/devicetree/bindings/regulator/regulator-max77620.txt
··· 1 - Regulator DT binding for MAX77620 Power management IC from Maxim Semiconductor. 2 - 3 - Device has multiple DCDC(sd[0-3] and LDOs(ldo[0-8]). The input supply 4 - of these regulators are defined under parent device node. 5 - Details of regulator properties are defined as child node under 6 - sub-node "regulators" which is child node of device node. 7 - 8 - Please refer file <Documentation/devicetree/bindings/regulator/regulator.txt> 9 - for common regulator bindings used by client. 10 - 11 - Following are properties of parent node related to regulators. 12 - 13 - Optional properties: 14 - ------------------- 15 - The input supply of regulators are the optional properties on the 16 - parent device node. The input supply of these regulators are provided 17 - through following properties: 18 - in-sd0-supply: Input supply for SD0, INA-SD0 or INB-SD0 pins. 19 - in-sd1-supply: Input supply for SD1. 20 - in-sd2-supply: Input supply for SD2. 21 - in-sd3-supply: Input supply for SD3. 22 - in-ldo0-1-supply: Input supply for LDO0 and LDO1. 23 - in-ldo2-supply: Input supply for LDO2. 24 - in-ldo3-5-supply: Input supply for LDO3 and LDO5 25 - in-ldo4-6-supply: Input supply for LDO4 and LDO6. 26 - in-ldo7-8-supply: Input supply for LDO7 and LDO8. 27 - 28 - Optional sub nodes for regulators under "regulators" subnode: 29 - ------------------------------------------------------------ 30 - The subnodes name is the name of regulator and it must be one of: 31 - sd[0-3], ldo[0-8] 32 - 33 - Each sub-node should contain the constraints and initialization 34 - information for that regulator. The definition for each of these 35 - nodes is defined using the standard binding for regulators found at 36 - <Documentation/devicetree/bindings/regulator/regulator.txt>. 37 - 38 - There are also additional properties for SD/LDOs. These additional properties 39 - are required to configure FPS configuration parameters for SDs and LDOs. 40 - Please refer <devicetree/bindings/mfd/max77620.txt> for more detail of Flexible 41 - Power Sequence (FPS). 42 - Following are additional properties: 43 - 44 - - maxim,active-fps-source: FPS source for the regulators to get 45 - enabled/disabled when system is in 46 - active state. Valid values are: 47 - - MAX77620_FPS_SRC_0, 48 - FPS source is FPS0. 49 - - MAX77620_FPS_SRC_1, 50 - FPS source is FPS1 51 - - MAX77620_FPS_SRC_2 and 52 - FPS source is FPS2 53 - - MAX77620_FPS_SRC_NONE. 54 - Regulator is not controlled 55 - by FPS events and it gets 56 - enabled/disabled by register 57 - access. 58 - Absence of this property will leave 59 - the FPS configuration register for that 60 - regulator to default configuration. 61 - 62 - - maxim,active-fps-power-up-slot: Sequencing event slot number on which 63 - the regulator get enabled when 64 - master FPS input event set to HIGH. 65 - Valid values are 0 to 7. 66 - This is applicable if FPS source is 67 - selected as FPS0, FPS1 or FPS2. 68 - 69 - - maxim,active-fps-power-down-slot: Sequencing event slot number on which 70 - the regulator get disabled when master 71 - FPS input event set to LOW. 72 - Valid values are 0 to 7. 73 - This is applicable if FPS source is 74 - selected as FPS0, FPS1 or FPS2. 75 - 76 - - maxim,suspend-fps-source: This is same as property 77 - "maxim,active-fps-source" but value 78 - get configured when system enters in 79 - to suspend state. 80 - 81 - - maxim,suspend-fps-power-up-slot: This is same as property 82 - "maxim,active-fps-power-up-slot" but 83 - this value get configured into FPS 84 - configuration register when system 85 - enters into suspend. 86 - This is applicable if suspend state 87 - FPS source is selected as FPS0, FPS1 or 88 - 89 - - maxim,suspend-fps-power-down-slot: This is same as property 90 - "maxim,active-fps-power-down-slot" but 91 - this value get configured into FPS 92 - configuration register when system 93 - enters into suspend. 94 - This is applicable if suspend state 95 - FPS source is selected as FPS0, FPS1 or 96 - FPS2. 97 - - maxim,ramp-rate-setting: integer, ramp rate(uV/us) setting to be 98 - configured to the device. 99 - The platform may have different ramp 100 - rate than advertised ramp rate if it has 101 - design variation from Maxim's 102 - recommended. On this case, platform 103 - specific ramp rate is used for ramp time 104 - calculation and this property is used 105 - for device register configurations. 106 - The measured ramp rate of platform is 107 - provided by the regulator-ramp-delay 108 - as described in <devicetree/bindings/ 109 - regulator/regulator.txt>. 110 - Maxim Max77620 supports following ramp 111 - delay: 112 - SD: 13.75mV/us, 27.5mV/us, 55mV/us 113 - LDOs: 5mV/us, 100mV/us 114 - 115 - Note: If the measured ramp delay is same as advertised ramp delay then it is not 116 - required to provide the ramp delay with property "maxim,ramp-rate-setting". The 117 - ramp rate can be provided by the regulator-ramp-delay which will be used for 118 - ramp time calculation for voltage change as well as for device configuration. 119 - 120 - Example: 121 - -------- 122 - #include <dt-bindings/mfd/max77620.h> 123 - ... 124 - max77620@3c { 125 - in-ldo0-1-supply = <&max77620_sd2>; 126 - in-ldo7-8-supply = <&max77620_sd2>; 127 - regulators { 128 - sd0 { 129 - regulator-name = "vdd-core"; 130 - regulator-min-microvolt = <600000>; 131 - regulator-max-microvolt = <1400000>; 132 - regulator-boot-on; 133 - regulator-always-on; 134 - maxim,active-fps-source = <MAX77620_FPS_SRC_1>; 135 - }; 136 - 137 - sd1 { 138 - regulator-name = "vddio-ddr"; 139 - regulator-min-microvolt = <1200000>; 140 - regulator-max-microvolt = <1200000>; 141 - regulator-always-on; 142 - regulator-boot-on; 143 - maxim,active-fps-source = <MAX77620_FPS_SRC_0>; 144 - }; 145 - 146 - sd2 { 147 - regulator-name = "vdd-pre-reg"; 148 - regulator-min-microvolt = <1350000>; 149 - regulator-max-microvolt = <1350000>; 150 - }; 151 - 152 - sd3 { 153 - regulator-name = "vdd-1v8"; 154 - regulator-min-microvolt = <1800000>; 155 - regulator-max-microvolt = <1800000>; 156 - regulator-always-on; 157 - regulator-boot-on; 158 - }; 159 - 160 - ldo0 { 161 - regulator-name = "avdd-sys"; 162 - regulator-min-microvolt = <1200000>; 163 - regulator-max-microvolt = <1200000>; 164 - regulator-always-on; 165 - regulator-boot-on; 166 - }; 167 - 168 - ldo1 { 169 - regulator-name = "vdd-pex"; 170 - regulator-min-microvolt = <1050000>; 171 - regulator-max-microvolt = <1050000>; 172 - }; 173 - 174 - ldo2 { 175 - regulator-name = "vddio-sdmmc3"; 176 - regulator-min-microvolt = <1800000>; 177 - regulator-max-microvolt = <3300000>; 178 - }; 179 - 180 - ldo3 { 181 - regulator-name = "vdd-cam-hv"; 182 - regulator-min-microvolt = <2800000>; 183 - regulator-max-microvolt = <2800000>; 184 - }; 185 - 186 - ldo4 { 187 - regulator-name = "vdd-rtc"; 188 - regulator-min-microvolt = <1250000>; 189 - regulator-max-microvolt = <1250000>; 190 - regulator-always-on; 191 - regulator-boot-on; 192 - }; 193 - 194 - ldo5 { 195 - regulator-name = "avdd-ts-hv"; 196 - regulator-min-microvolt = <3000000>; 197 - regulator-max-microvolt = <3000000>; 198 - }; 199 - 200 - ldo6 { 201 - regulator-name = "vdd-ts"; 202 - regulator-min-microvolt = <1800000>; 203 - regulator-max-microvolt = <1800000>; 204 - regulator-always-on; 205 - regulator-boot-on; 206 - }; 207 - 208 - ldo7 { 209 - regulator-name = "vdd-gen-pll-edp"; 210 - regulator-min-microvolt = <1050000>; 211 - regulator-max-microvolt = <1050000>; 212 - regulator-always-on; 213 - regulator-boot-on; 214 - }; 215 - 216 - ldo8 { 217 - regulator-name = "vdd-hdmi-dp"; 218 - regulator-min-microvolt = <1050000>; 219 - regulator-max-microvolt = <1050000>; 220 - }; 221 - }; 222 - };
+2 -1
drivers/regulator/act8945a-regulator.c
··· 302 302 num_regulators = ARRAY_SIZE(act8945a_regulators); 303 303 } 304 304 305 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 306 + 305 307 config.dev = &pdev->dev; 306 - config.dev->of_node = pdev->dev.parent->of_node; 307 308 config.driver_data = act8945a; 308 309 for (i = 0; i < num_regulators; i++) { 309 310 rdev = devm_regulator_register(&pdev->dev, &regulators[i],
+2 -1
drivers/regulator/bd9571mwv-regulator.c
··· 287 287 288 288 platform_set_drvdata(pdev, bdreg); 289 289 290 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 291 + 290 292 config.dev = &pdev->dev; 291 - config.dev->of_node = pdev->dev.parent->of_node; 292 293 config.driver_data = bdreg; 293 294 config.regmap = bdreg->regmap; 294 295
+11 -9
drivers/regulator/bq257xx-regulator.c
··· 15 15 #include <linux/regulator/of_regulator.h> 16 16 17 17 struct bq257xx_reg_data { 18 - struct bq257xx_device *bq; 19 18 struct regulator_dev *bq257xx_reg; 20 19 struct gpio_desc *otg_en_gpio; 21 20 struct regulator_desc desc; ··· 22 23 23 24 static int bq25703_vbus_get_cur_limit(struct regulator_dev *rdev) 24 25 { 25 - struct bq257xx_reg_data *pdata = rdev_get_drvdata(rdev); 26 + struct regmap *regmap = rdev_get_regmap(rdev); 26 27 int ret; 27 28 unsigned int reg; 28 29 29 - ret = regmap_read(pdata->bq->regmap, BQ25703_OTG_CURRENT, &reg); 30 + ret = regmap_read(regmap, BQ25703_OTG_CURRENT, &reg); 30 31 if (ret) 31 32 return ret; 32 33 return FIELD_GET(BQ25703_OTG_CUR_MASK, reg) * BQ25703_OTG_CUR_STEP_UA; ··· 39 40 static int bq25703_vbus_set_cur_limit(struct regulator_dev *rdev, 40 41 int min_uA, int max_uA) 41 42 { 42 - struct bq257xx_reg_data *pdata = rdev_get_drvdata(rdev); 43 + struct regmap *regmap = rdev_get_regmap(rdev); 43 44 unsigned int reg; 44 45 45 46 if ((min_uA > BQ25703_OTG_CUR_MAX_UA) || (max_uA < 0)) ··· 51 52 if ((reg * BQ25703_OTG_CUR_STEP_UA) < min_uA) 52 53 return -EINVAL; 53 54 54 - return regmap_write(pdata->bq->regmap, BQ25703_OTG_CURRENT, 55 + return regmap_write(regmap, BQ25703_OTG_CURRENT, 55 56 FIELD_PREP(BQ25703_OTG_CUR_MASK, reg)); 56 57 } 57 58 ··· 127 128 of_node_put(subchild); 128 129 129 130 if (IS_ERR(pdata->otg_en_gpio)) { 131 + if (PTR_ERR(pdata->otg_en_gpio) == -ENOENT) { 132 + /* No GPIO, will only use register writes for OTG */ 133 + pdata->otg_en_gpio = NULL; 134 + return; 135 + } 136 + 130 137 dev_err(&pdev->dev, "Error getting enable gpio: %ld\n", 131 138 PTR_ERR(pdata->otg_en_gpio)); 132 139 return; ··· 142 137 static int bq257xx_regulator_probe(struct platform_device *pdev) 143 138 { 144 139 struct device *dev = &pdev->dev; 145 - struct bq257xx_device *bq = dev_get_drvdata(pdev->dev.parent); 146 140 struct bq257xx_reg_data *pdata; 147 141 struct device_node *np = dev->of_node; 148 142 struct regulator_config cfg = {}; 149 143 150 - pdev->dev.of_node = pdev->dev.parent->of_node; 151 - pdev->dev.of_node_reused = true; 144 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 152 145 153 146 pdata = devm_kzalloc(&pdev->dev, sizeof(struct bq257xx_reg_data), GFP_KERNEL); 154 147 if (!pdata) 155 148 return -ENOMEM; 156 149 157 - pdata->bq = bq; 158 150 pdata->desc = bq25703_vbus_desc; 159 151 160 152 platform_set_drvdata(pdev, pdata);
+1 -1
drivers/regulator/core.c
··· 1550 1550 * Existing logic does not warn if over_current_protection is given as 1551 1551 * a constraint but driver does not support that. I think we should 1552 1552 * warn about this type of issues as it is possible someone changes 1553 - * PMIC on board to another type - and the another PMIC's driver does 1553 + * PMIC on board to another type - and the other PMIC's driver does 1554 1554 * not support setting protection. Board composer may happily believe 1555 1555 * the DT limits are respected - especially if the new PMIC HW also 1556 1556 * supports protection but the driver does not. I won't change the logic
+105
drivers/regulator/cpcap-regulator.c
··· 261 261 }; 262 262 263 263 static const unsigned int unknown_val_tbl[] = { 0, }; 264 + static const unsigned int sw_mot_val_tbl[] = { 600000, 612500, 625000, 265 + 637500, 650000, 662500, 266 + 675000, 687500, 700000, 267 + 712500, 725000, 737500, 268 + 750000, 762500, 775000, 269 + 787500, 800000, 812500, 270 + 825000, 837500, 850000, 271 + 862500, 875000, 887500, 272 + 900000, 912500, 925000, 273 + 937500, 950000, 962500, 274 + 975000, 987500, 1000000, 275 + 1012500, 1025000, 1037500, 276 + 1050000, 1062500, 1075000, 277 + 1087500, 1100000, 1112500, 278 + 1125000, 1137500, 1150000, 279 + 1162500, 1175000, 1187500, 280 + 1200000, 1212500, 1225000, 281 + 1237500, 1250000, 1262500, 282 + 1275000, 1287500, 1300000, 283 + 1312500, 1325000, 1337500, 284 + 1350000, 1362500, 1375000, 285 + 1387500, 1400000, 1412500, 286 + 1425000, 1437500, 1450000, 287 + 1462500, 1475000, }; 264 288 static const unsigned int sw2_sw4_val_tbl[] = { 612500, 625000, 637500, 265 289 650000, 662500, 675000, 266 290 687500, 700000, 712500, ··· 308 284 1362500, 1375000, 1387500, 309 285 1400000, 1412500, 1425000, 310 286 1437500, 1450000, 1462500, }; 287 + static const unsigned int sw3_val_tbl[] = { 1350000, 1800000, 1850000, 1875000, }; 311 288 static const unsigned int sw5_val_tbl[] = { 0, 5050000, }; 312 289 static const unsigned int vcam_val_tbl[] = { 2600000, 2700000, 2800000, 313 290 2900000, }; ··· 427 402 { /* sentinel */ }, 428 403 }; 429 404 405 + static const struct cpcap_regulator mot_regulators[] = { 406 + CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2, 407 + CPCAP_BIT_SW1_SEL, sw_mot_val_tbl, 408 + 0x6f00, 0x7f, 0x6800, 0, 0), 409 + CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2, 410 + CPCAP_BIT_SW2_SEL, sw_mot_val_tbl, 411 + 0x6f00, 0x7f, 0x4804, 0, 0), 412 + CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2, 413 + CPCAP_BIT_SW3_SEL, sw3_val_tbl, 414 + 0x578, 0x3, 0x043c, 0, 0), 415 + CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2, 416 + CPCAP_BIT_SW4_SEL, sw_mot_val_tbl, 417 + 0x6f00, 0x7f, 0x4909, 0, 0), 418 + CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2, 419 + CPCAP_BIT_SW5_SEL, sw5_val_tbl, 420 + 0x28, 0, 0x20, 0, 0), 421 + CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2, 422 + CPCAP_BIT_SW6_SEL, unknown_val_tbl, 423 + 0, 0, 0, 0, 0), 424 + CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2, 425 + CPCAP_BIT_VCAM_SEL, vcam_val_tbl, 426 + 0x87, 0x30, 0x7, 0, 420), 427 + CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3, 428 + CPCAP_BIT_VCSI_SEL, vcsi_val_tbl, 429 + 0x47, 0x10, 0x7, 0, 350), 430 + CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3, 431 + CPCAP_BIT_VDAC_SEL, vdac_val_tbl, 432 + 0x87, 0x30, 0x0, 0, 420), 433 + CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2, 434 + CPCAP_BIT_VDIG_SEL, vdig_val_tbl, 435 + 0x87, 0x30, 0x0, 0, 420), 436 + CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3, 437 + CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl, 438 + 0xa0, 0xf, 0x0, 0, 420), 439 + CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3, 440 + CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl, 441 + 0x17, 0, 0x2, 0, 0), 442 + CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2, 443 + CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl, 444 + 0x87, 0x38, 0x2, 0, 420), 445 + CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3, 446 + CPCAP_BIT_VPLL_SEL, vpll_val_tbl, 447 + 0x47, 0x18, 0x1, 0, 420), 448 + CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3, 449 + CPCAP_BIT_VRF1_SEL, vrf1_val_tbl, 450 + 0xac, 0x2, 0, 0, 10), 451 + CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3, 452 + CPCAP_BIT_VRF2_SEL, vrf2_val_tbl, 453 + 0x23, 0x8, 0, 0, 10), 454 + CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3, 455 + CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl, 456 + 0x23, 0x8, 0, 0, 420), 457 + CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3, 458 + CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl, 459 + 0x47, 0x10, 0x5, 0, 420), 460 + CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3, 461 + CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl, 462 + 0x20c, 0xc0, 0xd, 0, 420), 463 + CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3, 464 + 0xffff, vsim_val_tbl, 465 + 0x23, 0x8, 0, 0, 420), 466 + CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3, 467 + 0xffff, vsimcard_val_tbl, 468 + 0x1e80, 0x8, 0x1e00, 0, 420), 469 + CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3, 470 + CPCAP_BIT_VVIB_SEL, vvib_val_tbl, 471 + 0x1, 0xc, 0x1, 0, 500), 472 + CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3, 473 + CPCAP_BIT_VUSB_SEL, vusb_val_tbl, 474 + 0x11c, 0x40, 0xc, 0, 0), 475 + CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4, 476 + CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl, 477 + 0x16, 0x1, 0x5, 0, 0), 478 + { /* sentinel */ } 479 + }; 480 + 430 481 static const struct cpcap_regulator xoom_regulators[] = { 431 482 CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2, 432 483 CPCAP_BIT_SW1_SEL, unknown_val_tbl, ··· 586 485 { 587 486 .compatible = "motorola,mapphone-cpcap-regulator", 588 487 .data = omap4_regulators, 488 + }, 489 + { 490 + .compatible = "motorola,mot-cpcap-regulator", 491 + .data = mot_regulators, 589 492 }, 590 493 { 591 494 .compatible = "motorola,xoom-cpcap-regulator",
+1
drivers/regulator/cros-ec-regulator.c
··· 183 183 desc->owner = THIS_MODULE; 184 184 desc->type = REGULATOR_VOLTAGE; 185 185 desc->ops = &cros_ec_regulator_voltage_ops; 186 + desc->supply_name = "vin"; 186 187 187 188 ret = cros_ec_regulator_init_info(dev, drvdata); 188 189 if (ret < 0)
+2 -7
drivers/regulator/da9063-regulator.c
··· 67 67 68 68 struct da9063_regulators_pdata { 69 69 unsigned int n_regulators; 70 - struct da9063_regulator_data *regulator_data; 70 + struct da9063_regulator_data regulator_data[] __counted_by(n_regulators); 71 71 }; 72 72 73 73 /* Regulator capabilities and registers description */ ··· 857 857 return ERR_PTR(-EINVAL); 858 858 } 859 859 860 - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 860 + pdata = devm_kzalloc(&pdev->dev, struct_size(pdata, regulator_data, num), GFP_KERNEL); 861 861 if (!pdata) 862 862 return ERR_PTR(-ENOMEM); 863 863 864 - pdata->regulator_data = devm_kcalloc(&pdev->dev, 865 - num, sizeof(*pdata->regulator_data), 866 - GFP_KERNEL); 867 - if (!pdata->regulator_data) 868 - return ERR_PTR(-ENOMEM); 869 864 pdata->n_regulators = num; 870 865 871 866 n = 0;
+36 -7
drivers/regulator/da9121-regulator.c
··· 400 400 GPIOD_OUT_HIGH | 401 401 GPIOD_FLAGS_BIT_NONEXCLUSIVE, 402 402 "da9121-enable"); 403 - if (!IS_ERR(ena_gpiod)) 403 + if (!IS_ERR(ena_gpiod)) { 404 + if (of_property_read_bool(chip->dev->of_node, "dlg,no-gpio-control")) { 405 + gpiod_put(ena_gpiod); 406 + dev_err(chip->dev, "dlg,no-gpio-control conflicts with enable-gpios\n"); 407 + return -EINVAL; 408 + } 404 409 config->ena_gpiod = ena_gpiod; 410 + } 405 411 406 412 if (variant_parameters[chip->variant_id].num_bucks == 2) { 407 413 uint32_t ripple_cancel; ··· 870 864 .n_yes_ranges = ARRAY_SIZE(da9121_volatile_ranges), 871 865 }; 872 866 867 + /* 868 + * When GPIO functions DVC/RELOAD/EN are not used, the registers in the range 869 + * DA9121_REG_BUCK_BUCK1_0 to DA9121_REG_BUCK_BUCK1_6 need not be volatile 870 + * because register writes to these registers can only be performed via I2C. 871 + */ 872 + static const struct regmap_range da9121_volatile_ranges_no_gpio_ctrl[] = { 873 + regmap_reg_range(DA9121_REG_SYS_STATUS_0, DA9121_REG_SYS_EVENT_2), 874 + regmap_reg_range(DA9121_REG_SYS_GPIO0_0, DA9121_REG_SYS_GPIO2_1), 875 + }; 876 + 877 + static const struct regmap_access_table da9121_volatile_table_no_gpio_ctrl = { 878 + .yes_ranges = da9121_volatile_ranges_no_gpio_ctrl, 879 + .n_yes_ranges = ARRAY_SIZE(da9121_volatile_ranges_no_gpio_ctrl), 880 + }; 881 + 873 882 /* DA9121 regmap config for 1 channel variants */ 874 883 static const struct regmap_config da9121_1ch_regmap_config = { 875 884 .reg_bits = 8, ··· 1015 994 struct da9121 *chip) 1016 995 { 1017 996 const struct regmap_config *regmap; 997 + struct regmap_config regmap_config_1ch = da9121_1ch_regmap_config; 998 + struct regmap_config regmap_config_2ch = da9121_2ch_regmap_config; 999 + 1018 1000 int ret = 0; 1019 1001 1020 1002 chip->dev = &i2c->dev; 1003 + 1004 + if (of_property_read_bool(i2c->dev.of_node, "dlg,no-gpio-control")) { 1005 + regmap_config_1ch.volatile_table = &da9121_volatile_table_no_gpio_ctrl; 1006 + regmap_config_2ch.volatile_table = &da9121_volatile_table_no_gpio_ctrl; 1007 + } 1021 1008 1022 1009 /* Use configured subtype to select the regulator descriptor index and 1023 1010 * register map, common to both consumer and automotive grade variants ··· 1034 1005 case DA9121_SUBTYPE_DA9121: 1035 1006 case DA9121_SUBTYPE_DA9130: 1036 1007 chip->variant_id = DA9121_TYPE_DA9121_DA9130; 1037 - regmap = &da9121_1ch_regmap_config; 1008 + regmap = &regmap_config_1ch; 1038 1009 break; 1039 1010 case DA9121_SUBTYPE_DA9217: 1040 1011 chip->variant_id = DA9121_TYPE_DA9217; 1041 - regmap = &da9121_1ch_regmap_config; 1012 + regmap = &regmap_config_1ch; 1042 1013 break; 1043 1014 case DA9121_SUBTYPE_DA9122: 1044 1015 case DA9121_SUBTYPE_DA9131: 1045 1016 chip->variant_id = DA9121_TYPE_DA9122_DA9131; 1046 - regmap = &da9121_2ch_regmap_config; 1017 + regmap = &regmap_config_2ch; 1047 1018 break; 1048 1019 case DA9121_SUBTYPE_DA9220: 1049 1020 case DA9121_SUBTYPE_DA9132: 1050 1021 chip->variant_id = DA9121_TYPE_DA9220_DA9132; 1051 - regmap = &da9121_2ch_regmap_config; 1022 + regmap = &regmap_config_2ch; 1052 1023 break; 1053 1024 case DA9121_SUBTYPE_DA9141: 1054 1025 chip->variant_id = DA9121_TYPE_DA9141; 1055 - regmap = &da9121_1ch_regmap_config; 1026 + regmap = &regmap_config_1ch; 1056 1027 break; 1057 1028 case DA9121_SUBTYPE_DA9142: 1058 1029 chip->variant_id = DA9121_TYPE_DA9142; 1059 - regmap = &da9121_2ch_regmap_config; 1030 + regmap = &regmap_config_2ch; 1060 1031 break; 1061 1032 default: 1062 1033 return -EINVAL;
+3 -3
drivers/regulator/devres.c
··· 20 20 } 21 21 22 22 static struct regulator *_devm_regulator_get(struct device *dev, const char *id, 23 - int get_type) 23 + enum regulator_get_type get_type) 24 24 { 25 25 struct regulator **ptr, *regulator; 26 26 ··· 78 78 } 79 79 80 80 static int _devm_regulator_get_enable(struct device *dev, const char *id, 81 - int get_type) 81 + enum regulator_get_type get_type) 82 82 { 83 83 struct regulator *r; 84 84 int ret; ··· 751 751 752 752 #if IS_ENABLED(CONFIG_OF) 753 753 static struct regulator *_devm_of_regulator_get(struct device *dev, struct device_node *node, 754 - const char *id, int get_type) 754 + const char *id, enum regulator_get_type get_type) 755 755 { 756 756 struct regulator **ptr, *regulator; 757 757
-4
drivers/regulator/fixed.c
··· 20 20 #include <linux/platform_device.h> 21 21 #include <linux/pm_domain.h> 22 22 #include <linux/pm_opp.h> 23 - #include <linux/reboot.h> 24 23 #include <linux/regulator/driver.h> 25 24 #include <linux/regulator/fixed.h> 26 25 #include <linux/gpio/consumer.h> ··· 28 29 #include <linux/regulator/of_regulator.h> 29 30 #include <linux/regulator/machine.h> 30 31 #include <linux/clk.h> 31 - 32 - /* Default time in millisecond to wait for emergency shutdown */ 33 - #define FV_DEF_EMERG_SHUTDWN_TMO 10 34 32 35 33 struct fixed_voltage_data { 36 34 struct regulator_desc desc;
+1 -1
drivers/regulator/fp9931.c
··· 446 446 return dev_err_probe(&client->dev, PTR_ERR(data->regmap), 447 447 "failed to allocate regmap!\n"); 448 448 449 - data->vin_reg = devm_regulator_get_optional(&client->dev, "vin"); 449 + data->vin_reg = devm_regulator_get(&client->dev, "vin"); 450 450 if (IS_ERR(data->vin_reg)) 451 451 return dev_err_probe(&client->dev, PTR_ERR(data->vin_reg), 452 452 "failed to get vin regulator\n");
+1 -1
drivers/regulator/max20411-regulator.c
··· 133 133 134 134 max20411->rdev = devm_regulator_register(max20411->dev, &max20411->desc, &cfg); 135 135 if (IS_ERR(max20411->rdev)) 136 - dev_err(max20411->dev, "Failed to register regulator\n"); 136 + dev_err(max20411->dev, "Failed to register regulator: %pe\n", max20411->rdev); 137 137 138 138 return PTR_ERR_OR_ZERO(max20411->rdev); 139 139 }
-2
drivers/regulator/max77620-regulator.c
··· 793 793 platform_set_drvdata(pdev, pmic); 794 794 pmic->dev = dev; 795 795 pmic->rmap = max77620_chip->rmap; 796 - if (!dev->of_node) 797 - dev->of_node = pdev->dev.parent->of_node; 798 796 799 797 switch (max77620_chip->chip_id) { 800 798 case MAX77620:
+1 -1
drivers/regulator/max77650-regulator.c
··· 337 337 parent = dev->parent; 338 338 339 339 if (!dev->of_node) 340 - dev->of_node = parent->of_node; 340 + device_set_of_node_from_dev(dev, parent); 341 341 342 342 rdescs = devm_kcalloc(dev, MAX77650_REGULATOR_NUM_REGULATORS, 343 343 sizeof(*rdescs), GFP_KERNEL);
+6 -5
drivers/regulator/mt6315-regulator.c
··· 31 31 struct regmap *regmap; 32 32 }; 33 33 34 - #define MT_BUCK(_name, _bid, _vsel) \ 34 + #define MT_BUCK(_name, _bid, _supply, _vsel) \ 35 35 [_bid] = { \ 36 36 .desc = { \ 37 37 .name = _name, \ 38 + .supply_name = _supply, \ 38 39 .of_match = of_match_ptr(_name), \ 39 40 .regulators_node = "regulators", \ 40 41 .ops = &mt6315_volt_range_ops, \ ··· 191 190 }; 192 191 193 192 static const struct mt6315_regulator_info mt6315_regulators[MT6315_VBUCK_MAX] = { 194 - MT_BUCK("vbuck1", MT6315_VBUCK1, MT6315_BUCK_TOP_ELR0), 195 - MT_BUCK("vbuck2", MT6315_VBUCK2, MT6315_BUCK_TOP_ELR2), 196 - MT_BUCK("vbuck3", MT6315_VBUCK3, MT6315_BUCK_TOP_ELR4), 197 - MT_BUCK("vbuck4", MT6315_VBUCK4, MT6315_BUCK_TOP_ELR6), 193 + MT_BUCK("vbuck1", MT6315_VBUCK1, "pvdd1", MT6315_BUCK_TOP_ELR0), 194 + MT_BUCK("vbuck2", MT6315_VBUCK2, "pvdd2", MT6315_BUCK_TOP_ELR2), 195 + MT_BUCK("vbuck3", MT6315_VBUCK3, "pvdd3", MT6315_BUCK_TOP_ELR4), 196 + MT_BUCK("vbuck4", MT6315_VBUCK4, "pvdd4", MT6315_BUCK_TOP_ELR6), 198 197 }; 199 198 200 199 static const struct regmap_config mt6315_regmap_config = {
+1 -1
drivers/regulator/mt6357-regulator.c
··· 410 410 struct regulator_dev *rdev; 411 411 int i; 412 412 413 - pdev->dev.of_node = pdev->dev.parent->of_node; 413 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 414 414 415 415 for (i = 0; i < MT6357_MAX_REGULATOR; i++) { 416 416 config.dev = &pdev->dev;
+1 -1
drivers/regulator/pf0900-regulator.c
··· 771 771 }, 772 772 }; 773 773 774 - struct pf0900_regulator_irq regu_irqs[] = { 774 + static const struct pf0900_regulator_irq regu_irqs[] = { 775 775 PF0900_REGU_IRQ(PF0900_REG_SW_ILIM_INT, PF0900_SW, REGULATOR_ERROR_OVER_CURRENT_WARN), 776 776 PF0900_REGU_IRQ(PF0900_REG_LDO_ILIM_INT, PF0900_LDO, REGULATOR_ERROR_OVER_CURRENT_WARN), 777 777 PF0900_REGU_IRQ(PF0900_REG_SW_UV_INT, PF0900_SW, REGULATOR_ERROR_UNDER_VOLTAGE_WARN),
-1
drivers/regulator/pf1550-regulator.c
··· 360 360 "failed to get parent regmap\n"); 361 361 362 362 config.dev = pf1550->dev; 363 - config.regmap = pf1550->regmap; 364 363 info->dev = &pdev->dev; 365 364 info->pf1550 = pf1550; 366 365
+4 -1
drivers/regulator/pf9453-regulator.c
··· 732 732 return IRQ_NONE; 733 733 } 734 734 735 + if (!status) 736 + return IRQ_NONE; 737 + 735 738 if (status & IRQ_RSTB) 736 739 dev_warn(pf9453->dev, "IRQ_RSTB interrupt.\n"); 737 740 ··· 812 809 } 813 810 814 811 ret = devm_request_threaded_irq(pf9453->dev, pf9453->irq, NULL, pf9453_irq_handler, 815 - IRQF_ONESHOT, 812 + (IRQF_ONESHOT | IRQF_SHARED), 816 813 "pf9453-irq", pf9453); 817 814 if (ret) 818 815 return dev_err_probe(pf9453->dev, ret, "Failed to request IRQ: %d\n", pf9453->irq);
+1 -2
drivers/regulator/rk808-regulator.c
··· 2114 2114 struct regmap *regmap; 2115 2115 int ret, i, nregulators; 2116 2116 2117 - pdev->dev.of_node = pdev->dev.parent->of_node; 2118 - pdev->dev.of_node_reused = true; 2117 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 2119 2118 2120 2119 regmap = dev_get_regmap(pdev->dev.parent, NULL); 2121 2120 if (!regmap)
+1 -1
drivers/regulator/s2dos05-regulator.c
··· 126 126 s2dos05->regmap = iodev->regmap_pmic; 127 127 s2dos05->dev = dev; 128 128 if (!dev->of_node) 129 - dev->of_node = dev->parent->of_node; 129 + device_set_of_node_from_dev(dev, dev->parent); 130 130 131 131 config.dev = dev; 132 132 config.driver_data = s2dos05;
+14 -11
drivers/regulator/spacemit-p1.c
··· 87 87 } 88 88 89 89 #define P1_BUCK_DESC(_n) \ 90 - P1_REG_DESC(BUCK, buck, _n, "vin", 0x47, BUCK_MASK, 255, p1_buck_ranges) 90 + P1_REG_DESC(BUCK, buck, _n, "vin" #_n, 0x47, BUCK_MASK, 255, p1_buck_ranges) 91 91 92 92 #define P1_ALDO_DESC(_n) \ 93 - P1_REG_DESC(ALDO, aldo, _n, "vin", 0x5b, LDO_MASK, 128, p1_ldo_ranges) 93 + P1_REG_DESC(ALDO, aldo, _n, "aldoin", 0x5b, LDO_MASK, 128, p1_ldo_ranges) 94 94 95 - #define P1_DLDO_DESC(_n) \ 96 - P1_REG_DESC(DLDO, dldo, _n, "buck5", 0x67, LDO_MASK, 128, p1_ldo_ranges) 95 + #define P1_DLDO1_DESC(_n) \ 96 + P1_REG_DESC(DLDO, dldo, _n, "dldoin1", 0x67, LDO_MASK, 128, p1_ldo_ranges) 97 + 98 + #define P1_DLDO2_DESC(_n) \ 99 + P1_REG_DESC(DLDO, dldo, _n, "dldoin2", 0x67, LDO_MASK, 128, p1_ldo_ranges) 97 100 98 101 static const struct regulator_desc p1_regulator_desc[] = { 99 102 P1_BUCK_DESC(1), ··· 111 108 P1_ALDO_DESC(3), 112 109 P1_ALDO_DESC(4), 113 110 114 - P1_DLDO_DESC(1), 115 - P1_DLDO_DESC(2), 116 - P1_DLDO_DESC(3), 117 - P1_DLDO_DESC(4), 118 - P1_DLDO_DESC(5), 119 - P1_DLDO_DESC(6), 120 - P1_DLDO_DESC(7), 111 + P1_DLDO1_DESC(1), 112 + P1_DLDO1_DESC(2), 113 + P1_DLDO1_DESC(3), 114 + P1_DLDO1_DESC(4), 115 + P1_DLDO2_DESC(5), 116 + P1_DLDO2_DESC(6), 117 + P1_DLDO2_DESC(7), 121 118 }; 122 119 123 120 static int p1_regulator_probe(struct platform_device *pdev)