···5566This document lists regulator specific bindings, see the primary binding77document:88- ../mfd/arizona.txt88+ For Wolfson Microelectronic Arizona codecs: ../mfd/arizona.txt99+ For Cirrus Logic Madera codecs: ../mfd/madera.txt9101011Optional properties:1112 - wlf,ldoena : GPIO specifier for the GPIO controlling LDOENA
···12121313description:1414 Any property defined as part of the core regulator binding, defined in1515- regulator.txt, can also be used. However a fixed voltage regulator is1515+ regulator.yaml, can also be used. However a fixed voltage regulator is1616 expected to have the regulator-min-microvolt and regulator-max-microvolt1717 to be the same.1818+1919+allOf:2020+ - $ref: "regulator.yaml#"18211922properties:2023 compatible:
···11-GPIO controlled regulators22-33-Required properties:44-- compatible : Must be "regulator-gpio".55-- regulator-name : Defined in regulator.txt as optional, but required66- here.77-- gpios : Array of one or more GPIO pins used to select the88- regulator voltage/current listed in "states".99-- states : Selection of available voltages/currents provided by1010- this regulator and matching GPIO configurations to1111- achieve them. If there are no states in the "states"1212- array, use a fixed regulator instead.1313-1414-Optional properties:1515-- enable-gpios : GPIO used to enable/disable the regulator.1616- Warning, the GPIO phandle flags are ignored and the1717- GPIO polarity is controlled solely by the presence1818- of "enable-active-high" DT property. This is due to1919- compatibility with old DTs.2020-- enable-active-high : Polarity of "enable-gpio" GPIO is active HIGH.2121- Default is active LOW.2222-- gpios-states : On operating systems, that don't support reading back2323- gpio values in output mode (most notably linux), this2424- array provides the state of GPIO pins set when2525- requesting them from the gpio controller. Systems,2626- that are capable of preserving state when requesting2727- the lines, are free to ignore this property.2828- 0: LOW, 1: HIGH. Default is LOW if nothing else2929- is specified.3030-- startup-delay-us : Startup time in microseconds.3131-- regulator-type : Specifies what is being regulated, must be either3232- "voltage" or "current", defaults to voltage.3333-3434-Any property defined as part of the core regulator binding defined in3535-regulator.txt can also be used.3636-3737-Example:3838-3939- mmciv: gpio-regulator {4040- compatible = "regulator-gpio";4141-4242- regulator-name = "mmci-gpio-supply";4343- regulator-min-microvolt = <1800000>;4444- regulator-max-microvolt = <2600000>;4545- regulator-boot-on;4646-4747- enable-gpios = <&gpio0 23 0x4>;4848- gpios = <&gpio0 24 0x44949- &gpio0 25 0x4>;5050- states = <1800000 0x35151- 2200000 0x25252- 2600000 0x15353- 2900000 0x0>;5454-5555- startup-delay-us = <100000>;5656- enable-active-high;5757- };
···11+# SPDX-License-Identifier: GPL-2.022+%YAML 1.233+---44+$id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: GPIO controlled regulators88+99+maintainers:1010+ - Liam Girdwood <lgirdwood@gmail.com>1111+ - Mark Brown <broonie@kernel.org>1212+1313+description:1414+ Any property defined as part of the core regulator binding, defined in1515+ regulator.txt, can also be used.1616+1717+allOf:1818+ - $ref: "regulator.yaml#"1919+2020+properties:2121+ compatible:2222+ const: regulator-gpio2323+2424+ regulator-name: true2525+2626+ enable-gpios:2727+ description: GPIO to use to enable/disable the regulator.2828+ Warning, the GPIO phandle flags are ignored and the GPIO polarity is2929+ controlled solely by the presence of "enable-active-high" DT property.3030+ This is due to compatibility with old DTs.3131+ maxItems: 13232+3333+ gpios:3434+ description: Array of one or more GPIO pins used to select the regulator3535+ voltage/current listed in "states".3636+ minItems: 13737+ maxItems: 8 # Should be enough...3838+3939+ gpios-states:4040+ description: |4141+ On operating systems, that don't support reading back gpio values in4242+ output mode (most notably linux), this array provides the state of GPIO4343+ pins set when requesting them from the gpio controller. Systems, that are4444+ capable of preserving state when requesting the lines, are free to ignore4545+ this property.4646+ 0: LOW4747+ 1: HIGH4848+ Default is LOW if nothing else is specified.4949+ allOf:5050+ - $ref: /schemas/types.yaml#/definitions/uint32-array5151+ - maxItems: 85252+ items:5353+ enum: [ 0, 1 ]5454+ default: 05555+5656+ states:5757+ description: Selection of available voltages/currents provided by this5858+ regulator and matching GPIO configurations to achieve them. If there are5959+ no states in the "states" array, use a fixed regulator instead.6060+ allOf:6161+ - $ref: /schemas/types.yaml#/definitions/uint32-matrix6262+ - maxItems: 86363+ items:6464+ items:6565+ - description: Voltage in microvolts6666+ - description: GPIO group state value6767+6868+ startup-delay-us:6969+ description: startup time in microseconds7070+7171+ enable-active-high:7272+ description: Polarity of "enable-gpio" GPIO is active HIGH. Default is7373+ active LOW.7474+ type: boolean7575+7676+ gpio-open-drain:7777+ description:7878+ GPIO is open drain type. If this property is missing then default7979+ assumption is false.8080+ type: boolean8181+8282+ regulator-type:8383+ description: Specifies what is being regulated.8484+ allOf:8585+ - $ref: /schemas/types.yaml#/definitions/string8686+ - enum:8787+ - voltage8888+ - current8989+ default: voltage9090+9191+required:9292+ - compatible9393+ - regulator-name9494+ - gpios9595+ - states9696+9797+examples:9898+ - |9999+ gpio-regulator {100100+ compatible = "regulator-gpio";101101+102102+ regulator-name = "mmci-gpio-supply";103103+ regulator-min-microvolt = <1800000>;104104+ regulator-max-microvolt = <2600000>;105105+ regulator-boot-on;106106+107107+ enable-gpios = <&gpio0 23 0x4>;108108+ gpios = <&gpio0 24 0x4109109+ &gpio0 25 0x4>;110110+ states = <1800000 0x3>,111111+ <2200000 0x2>,112112+ <2600000 0x1>,113113+ <2900000 0x0>;114114+115115+ startup-delay-us = <100000>;116116+ enable-active-high;117117+ };118118+...
···44 Usage: required55 Value type: <string>66 Definition: must be one of:77+ "qcom,pm8005-regulators"78 "qcom,pm8841-regulators"89 "qcom,pm8916-regulators"910 "qcom,pm8941-regulators"1011 "qcom,pm8994-regulators"1112 "qcom,pmi8994-regulators"1313+ "qcom,pms405-regulators"12141315- interrupts:1416 Usage: optional···112110 Definition: Reference to regulator supplying the input pin, as113111 described in the data sheet.114112113113+- vdd_l1_l2-supply:114114+- vdd_l3_l8-supply:115115+- vdd_l4-supply:116116+- vdd_l5_l6-supply:117117+- vdd_l10_l11_l12_l13-supply:118118+- vdd_l7-supply:119119+- vdd_l9-supply:120120+- vdd_s1-supply:121121+- vdd_s2-supply:122122+- vdd_s3-supply:123123+- vdd_s4-supply:124124+- vdd_s5-supply125125+ Usage: optional (pms405 only)126126+ Value type: <phandle>127127+ Definition: Reference to regulator supplying the input pin, as128128+ described in the data sheet.129129+115130- qcom,saw-reg:116131 Usage: optional117132 Value type: <phandle>···138119The regulator node houses sub-nodes for each regulator within the device. Each139120sub-node is identified using the node's name, with valid values listed for each140121of the PMICs below.122122+123123+pm8005:124124+ s1, s2, s3, s4141125142126pm8841:143127 s1, s2, s3, s4, s5, s6, s7, s8
···11-Voltage/Current Regulators22-33-Optional properties:44-- regulator-name: A string used as a descriptive name for regulator outputs55-- regulator-min-microvolt: smallest voltage consumers may set66-- regulator-max-microvolt: largest voltage consumers may set77-- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops88-- regulator-min-microamp: smallest current consumers may set99-- regulator-max-microamp: largest current consumers may set1010-- regulator-input-current-limit-microamp: maximum input current regulator allows1111-- regulator-always-on: boolean, regulator should never be disabled1212-- regulator-boot-on: bootloader/firmware enabled regulator1313-- regulator-allow-bypass: allow the regulator to go into bypass mode1414-- regulator-allow-set-load: allow the regulator performance level to be configured1515-- <name>-supply: phandle to the parent supply/regulator node1616-- regulator-ramp-delay: ramp delay for regulator(in uV/us)1717- For hardware which supports disabling ramp rate, it should be explicitly1818- initialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.1919-- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply2020- rail to reach the target voltage, plus/minus whatever tolerance the board2121- design requires. This property describes the total system ramp time2222- required due to the combination of internal ramping of the regulator itself,2323- and board design issues such as trace capacitance and load on the supply.2424-- regulator-settling-time-us: Settling time, in microseconds, for voltage2525- change if regulator have the constant time for any level voltage change.2626- This is useful when regulator have exponential voltage change.2727-- regulator-settling-time-up-us: Settling time, in microseconds, for voltage2828- increase if the regulator needs a constant time to settle after voltage2929- increases of any level. This is useful for regulators with exponential3030- voltage changes.3131-- regulator-settling-time-down-us: Settling time, in microseconds, for voltage3232- decrease if the regulator needs a constant time to settle after voltage3333- decreases of any level. This is useful for regulators with exponential3434- voltage changes.3535-- regulator-soft-start: Enable soft start so that voltage ramps slowly3636-- regulator-state-standby sub-root node for Standby mode3737- : equivalent with standby Linux sleep state, which provides energy savings3838- with a relatively quick transition back time.3939-- regulator-state-mem sub-root node for Suspend-to-RAM mode4040- : suspend to memory, the device goes to sleep, but all data stored in memory,4141- only some external interrupt can wake the device.4242-- regulator-state-disk sub-root node for Suspend-to-DISK mode4343- : suspend to disk, this state operates similarly to Suspend-to-RAM,4444- but includes a final step of writing memory contents to disk.4545-- regulator-state-[mem/disk/standby] node has following common properties:4646- - regulator-on-in-suspend: regulator should be on in suspend state.4747- - regulator-off-in-suspend: regulator should be off in suspend state.4848- - regulator-suspend-min-microvolt: minimum voltage may be set in4949- suspend state.5050- - regulator-suspend-max-microvolt: maximum voltage may be set in5151- suspend state.5252- - regulator-suspend-microvolt: the default voltage which regulator5353- would be set in suspend. This property is now deprecated, instead5454- setting voltage for suspend mode via the API which regulator5555- driver provides is recommended.5656- - regulator-changeable-in-suspend: whether the default voltage and5757- the regulator on/off in suspend can be changed in runtime.5858- - regulator-mode: operating mode in the given suspend state.5959- The set of possible operating modes depends on the capabilities of6060- every hardware so the valid modes are documented on each regulator6161- device tree binding document.6262-- regulator-initial-mode: initial operating mode. The set of possible operating6363- modes depends on the capabilities of every hardware so each device binding6464- documentation explains which values the regulator supports.6565-- regulator-allowed-modes: list of operating modes that software is allowed to6666- configure for the regulator at run-time. Elements may be specified in any6767- order. The set of possible operating modes depends on the capabilities of6868- every hardware so each device binding document explains which values the6969- regulator supports.7070-- regulator-system-load: Load in uA present on regulator that is not captured by7171- any consumer request.7272-- regulator-pull-down: Enable pull down resistor when the regulator is disabled.7373-- regulator-over-current-protection: Enable over current protection.7474-- regulator-active-discharge: tristate, enable/disable active discharge of7575- regulators. The values are:7676- 0: Disable active discharge.7777- 1: Enable active discharge.7878- Absence of this property will leave configuration to default.7979-- regulator-coupled-with: Regulators with which the regulator8080- is coupled. The linkage is 2-way - all coupled regulators should be linked8181- with each other. A regulator should not be coupled with its supplier.8282-- regulator-coupled-max-spread: Array of maximum spread between voltages of8383- coupled regulators in microvolts, each value in the array relates to the8484- corresponding couple specified by the regulator-coupled-with property.8585-- regulator-max-step-microvolt: Maximum difference between current and target8686- voltages that can be changed safely in a single step.8787-8888-Deprecated properties:8989-- regulator-compatible: If a regulator chip contains multiple9090- regulators, and if the chip's binding contains a child node that9191- describes each regulator, then this property indicates which regulator9292- this child node is intended to configure. If this property is missing,9393- the node's name will be used instead.9494-9595-Example:9696-9797- xyzreg: regulator@0 {9898- regulator-min-microvolt = <1000000>;9999- regulator-max-microvolt = <2500000>;100100- regulator-always-on;101101- vin-supply = <&vin>;102102-103103- regulator-state-mem {104104- regulator-on-in-suspend;105105- };106106- };107107-108108-Regulator Consumers:109109-Consumer nodes can reference one or more of its supplies/110110-regulators using the below bindings.111111-112112-- <name>-supply: phandle to the regulator node113113-114114-These are the same bindings that a regulator in the above115115-example used to reference its own supply, in which case116116-its just seen as a special case of a regulator being a117117-consumer itself.118118-119119-Example of a consumer device node (mmc) referencing two120120-regulators (twl_reg1 and twl_reg2),121121-122122- twl_reg1: regulator@0 {123123- ...124124- ...125125- ...126126- };127127-128128- twl_reg2: regulator@1 {129129- ...130130- ...131131- ...132132- };133133-134134- mmc: mmc@0 {135135- ...136136- ...137137- vmmc-supply = <&twl_reg1>;138138- vmmcaux-supply = <&twl_reg2>;139139- };11+This file has moved to regulator.yaml.
···11+# SPDX-License-Identifier: GPL-2.022+%YAML 1.233+---44+$id: http://devicetree.org/schemas/regulator/regulator.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Voltage/Current Regulators88+99+maintainers:1010+ - Liam Girdwood <lgirdwood@gmail.com>1111+ - Mark Brown <broonie@kernel.org>1212+1313+properties:1414+ regulator-name:1515+ description: A string used as a descriptive name for regulator outputs1616+ $ref: "/schemas/types.yaml#/definitions/string"1717+1818+ regulator-min-microvolt:1919+ description: smallest voltage consumers may set2020+2121+ regulator-max-microvolt:2222+ description: largest voltage consumers may set2323+2424+ regulator-microvolt-offset:2525+ description: Offset applied to voltages to compensate for voltage drops2626+2727+ regulator-min-microamp:2828+ description: smallest current consumers may set2929+3030+ regulator-max-microamp:3131+ description: largest current consumers may set3232+3333+ regulator-input-current-limit-microamp:3434+ description: maximum input current regulator allows3535+3636+ regulator-always-on:3737+ description: boolean, regulator should never be disabled3838+ type: boolean3939+4040+ regulator-boot-on:4141+ description: bootloader/firmware enabled regulator4242+ type: boolean4343+4444+ regulator-allow-bypass:4545+ description: allow the regulator to go into bypass mode4646+ type: boolean4747+4848+ regulator-allow-set-load:4949+ description: allow the regulator performance level to be configured5050+ type: boolean5151+5252+ regulator-ramp-delay:5353+ description: ramp delay for regulator(in uV/us) For hardware which supports5454+ disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay5555+ = <0>) for disabling ramp delay.5656+ $ref: "/schemas/types.yaml#/definitions/uint32"5757+5858+ regulator-enable-ramp-delay:5959+ description: The time taken, in microseconds, for the supply rail to6060+ reach the target voltage, plus/minus whatever tolerance the board6161+ design requires. This property describes the total system ramp time6262+ required due to the combination of internal ramping of the regulator6363+ itself, and board design issues such as trace capacitance and load6464+ on the supply.6565+ $ref: "/schemas/types.yaml#/definitions/uint32"6666+6767+ regulator-settling-time-us:6868+ description: Settling time, in microseconds, for voltage change if regulator6969+ have the constant time for any level voltage change. This is useful7070+ when regulator have exponential voltage change.7171+7272+ regulator-settling-time-up-us:7373+ description: Settling time, in microseconds, for voltage increase if7474+ the regulator needs a constant time to settle after voltage increases7575+ of any level. This is useful for regulators with exponential voltage7676+ changes.7777+7878+ regulator-settling-time-down-us:7979+ description: Settling time, in microseconds, for voltage decrease if8080+ the regulator needs a constant time to settle after voltage decreases8181+ of any level. This is useful for regulators with exponential voltage8282+ changes.8383+8484+ regulator-soft-start:8585+ description: Enable soft start so that voltage ramps slowly8686+ type: boolean8787+8888+ regulator-initial-mode:8989+ description: initial operating mode. The set of possible operating modes9090+ depends on the capabilities of every hardware so each device binding9191+ documentation explains which values the regulator supports.9292+ $ref: "/schemas/types.yaml#/definitions/uint32"9393+9494+ regulator-allowed-modes:9595+ description: list of operating modes that software is allowed to configure9696+ for the regulator at run-time. Elements may be specified in any order.9797+ The set of possible operating modes depends on the capabilities of9898+ every hardware so each device binding document explains which values9999+ the regulator supports.100100+ $ref: "/schemas/types.yaml#/definitions/uint32-array"101101+102102+ regulator-system-load:103103+ description: Load in uA present on regulator that is not captured by104104+ any consumer request.105105+ $ref: "/schemas/types.yaml#/definitions/uint32"106106+107107+ regulator-pull-down:108108+ description: Enable pull down resistor when the regulator is disabled.109109+ type: boolean110110+111111+ regulator-over-current-protection:112112+ description: Enable over current protection.113113+ type: boolean114114+115115+ regulator-active-discharge:116116+ description: |117117+ tristate, enable/disable active discharge of regulators. The values are:118118+ 0: Disable active discharge.119119+ 1: Enable active discharge.120120+ Absence of this property will leave configuration to default.121121+ allOf:122122+ - $ref: "/schemas/types.yaml#/definitions/uint32"123123+ - enum: [ 0, 1 ]124124+125125+ regulator-coupled-with:126126+ description: Regulators with which the regulator is coupled. The linkage127127+ is 2-way - all coupled regulators should be linked with each other.128128+ A regulator should not be coupled with its supplier.129129+ $ref: "/schemas/types.yaml#/definitions/phandle-array"130130+131131+ regulator-coupled-max-spread:132132+ description: Array of maximum spread between voltages of coupled regulators133133+ in microvolts, each value in the array relates to the corresponding134134+ couple specified by the regulator-coupled-with property.135135+ $ref: "/schemas/types.yaml#/definitions/uint32"136136+137137+ regulator-max-step-microvolt:138138+ description: Maximum difference between current and target voltages139139+ that can be changed safely in a single step.140140+141141+patternProperties:142142+ ".*-supply$":143143+ description: Input supply phandle(s) for this node144144+145145+ regulator-state-(standby|mem|disk):146146+ type: object147147+ description:148148+ sub-nodes for regulator state in Standby, Suspend-to-RAM, and149149+ Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux150150+ sleep states.151151+152152+ properties:153153+ regulator-on-in-suspend:154154+ description: regulator should be on in suspend state.155155+ type: boolean156156+157157+ regulator-off-in-suspend:158158+ description: regulator should be off in suspend state.159159+ type: boolean160160+161161+ regulator-suspend-min-microvolt:162162+ description: minimum voltage may be set in suspend state.163163+164164+ regulator-suspend-max-microvolt:165165+ description: maximum voltage may be set in suspend state.166166+167167+ regulator-suspend-microvolt:168168+ description: the default voltage which regulator would be set in169169+ suspend. This property is now deprecated, instead setting voltage170170+ for suspend mode via the API which regulator driver provides is171171+ recommended.172172+173173+ regulator-changeable-in-suspend:174174+ description: whether the default voltage and the regulator on/off175175+ in suspend can be changed in runtime.176176+ type: boolean177177+178178+ regulator-mode:179179+ description: operating mode in the given suspend state. The set180180+ of possible operating modes depends on the capabilities of every181181+ hardware so the valid modes are documented on each regulator device182182+ tree binding document.183183+ $ref: "/schemas/types.yaml#/definitions/uint32"184184+185185+ additionalProperties: false186186+187187+examples:188188+ - |189189+ xyzreg: regulator@0 {190190+ regulator-min-microvolt = <1000000>;191191+ regulator-max-microvolt = <2500000>;192192+ regulator-always-on;193193+ vin-supply = <&vin>;194194+195195+ regulator-state-mem {196196+ regulator-on-in-suspend;197197+ };198198+ };199199+200200+...
···11+* Dialog Semiconductor SLG51000 Voltage Regulator22+33+Required properties:44+- compatible : Should be "dlg,slg51000" for SLG5100055+- reg : Specifies the I2C slave address.66+- xxx-supply: Input voltage supply regulator for ldo3 to ldo7.77+ These entries are required if regulators are enabled for a device.88+ An absence of these properties can cause the regulator registration to fail.99+ If some of input supply is powered through battery or always-on supply then1010+ also it is required to have these parameters with proper node handle of always1111+ on power supply.1212+ vin3-supply: Input supply for ldo31313+ vin4-supply: Input supply for ldo41414+ vin5-supply: Input supply for ldo51515+ vin6-supply: Input supply for ldo61616+ vin7-supply: Input supply for ldo71717+1818+Optional properties:1919+- interrupt-parent : Specifies the reference to the interrupt controller.2020+- interrupts : IRQ line information.2121+- dlg,cs-gpios : Specify a valid GPIO for chip select2222+2323+Sub-nodes:2424+- regulators : This node defines the settings for the regulators.2525+ The content of the sub-node is defined by the standard binding2626+ for regulators; see regulator.txt.2727+2828+ The SLG51000 regulators are bound using their names listed below:2929+ ldo13030+ ldo23131+ ldo33232+ ldo43333+ ldo53434+ ldo63535+ ldo73636+3737+Optional properties for regulators:3838+- enable-gpios : Specify a valid GPIO for platform control of the regulator.3939+4040+Example:4141+ pmic: slg51000@75 {4242+ compatible = "dlg,slg51000";4343+ reg = <0x75>;4444+4545+ regulators {4646+ ldo1 {4747+ regulator-name = "ldo1";4848+ regulator-min-microvolt = <2400000>;4949+ regulator-max-microvolt = <3300000>;5050+ };5151+5252+ ldo2 {5353+ regulator-name = "ldo2";5454+ regulator-min-microvolt = <2400000>;5555+ regulator-max-microvolt = <3300000>;5656+ };5757+5858+ ldo3 {5959+ regulator-name = "ldo3";6060+ regulator-min-microvolt = <1200000>;6161+ regulator-max-microvolt = <3750000>;6262+ };6363+6464+ ldo4 {6565+ regulator-name = "ldo4";6666+ regulator-min-microvolt = <1200000>;6767+ regulator-max-microvolt = <3750000>;6868+ };6969+7070+ ldo5 {7171+ regulator-name = "ldo5";7272+ regulator-min-microvolt = <500000>;7373+ regulator-max-microvolt = <1200000>;7474+ };7575+7676+ ldo6 {7777+ regulator-name = "ldo6";7878+ regulator-min-microvolt = <500000>;7979+ regulator-max-microvolt = <1200000>;8080+ };8181+8282+ ldo7 {8383+ regulator-name = "ldo7";8484+ regulator-min-microvolt = <1200000>;8585+ regulator-max-microvolt = <3750000>;8686+ };8787+ };8888+ };
···11+STM32 BOOSTER - Booster for ADC analog input switches22+33+Some STM32 devices embed a 3.3V booster supplied by Vdda, that can be used44+to supply ADC analog input switches.55+66+Required properties:77+- compatible: Should be one of:88+ "st,stm32h7-booster"99+ "st,stm32mp1-booster"1010+- st,syscfg: Phandle to system configuration controller.1111+- vdda-supply: Phandle to the vdda input analog voltage.1212+1313+Example:1414+ booster: regulator-booster {1515+ compatible = "st,stm32mp1-booster";1616+ st,syscfg = <&syscfg>;1717+ vdda-supply = <&vdda>;1818+ };
···1515#include <linux/io.h>1616#include <linux/init.h>1717#include <linux/gpio.h>1818+#include <linux/gpio/machine.h>1819#include <linux/leds.h>1920#include <linux/delay.h>2021#include <linux/mmc/host.h>···399398/* VDDARM is controlled by DVS1 connected to GPK(0) */400399static struct wm831x_buckv_pdata vddarm_pdata = {401400 .dvs_control_src = 1,402402- .dvs_gpio = S3C64XX_GPK(0),403401};404402405403static struct regulator_consumer_supply vddarm_consumers[] = {···594594 },595595596596 .touch = &touch_pdata,597597+};598598+599599+/*600600+ * VDDARM is eventually ending up as a regulator hanging on the MFD cell device601601+ * "wm831x-buckv.1" spawn from drivers/mfd/wm831x-core.c.602602+ *603603+ * From the note on the platform data we can see that this is clearly DVS1604604+ * and assigned as dcdc1 resource to the MFD core which sets .id of the cell605605+ * spawning the DVS1 platform device to 1, then the cell platform device606606+ * name is calculated from 10*instance + id resulting in the device name607607+ * "wm831x-buckv.11"608608+ */609609+static struct gpiod_lookup_table crag_pmic_gpiod_table = {610610+ .dev_id = "wm831x-buckv.11",611611+ .table = {612612+ GPIO_LOOKUP("GPIOK", 0, "dvs", GPIO_ACTIVE_HIGH),613613+ { },614614+ },597615};598616599617static struct i2c_board_info i2c_devs0[] = {···854836 s3c_fb_set_platdata(&crag6410_lcd_pdata);855837 dwc2_hsotg_set_platdata(&crag6410_hsotg_pdata);856838839839+ gpiod_add_lookup_table(&crag_pmic_gpiod_table);857840 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));858841 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));859842
+17
arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
···2727 status = "okay";2828};29293030+&pm8005_lsid1 {3131+ pm8005-regulators {3232+ compatible = "qcom,pm8005-regulators";3333+3434+ vdd_s1-supply = <&vph_pwr>;3535+3636+ pm8005_s1: s1 { /* VDD_GFX supply */3737+ regulator-min-microvolt = <524000>;3838+ regulator-max-microvolt = <1100000>;3939+ regulator-enable-ramp-delay = <500>;4040+4141+ /* hack until we rig up the gpu consumer */4242+ regulator-always-on;4343+ };4444+ };4545+};4646+3047&qusb2phy {3148 status = "okay";3249
+1-5
drivers/gpio/gpiolib.c
···42444244 *42454245 * Returns:42464246 * On successful request the GPIO pin is configured in accordance with42474247- * provided @dflags. If the node does not have the requested GPIO42484248- * property, NULL is returned.42474247+ * provided @dflags.42494248 *42504249 * In case of error an ERR_PTR() is returned.42514250 */···42664267 index, &flags);4267426842684269 if (!desc || IS_ERR(desc)) {42694269- /* If it is not there, just return NULL */42704270- if (PTR_ERR(desc) == -ENOENT)42714271- return NULL;42724270 return desc;42734271 }42744272
···136136 signal AB8500 PMIC137137138138config REGULATOR_ARIZONA_LDO1139139- tristate "Wolfson Arizona class devices LDO1"140140- depends on MFD_ARIZONA139139+ tristate "Cirrus Madera and Wolfson Arizona class devices LDO1"140140+ depends on MFD_ARIZONA || MFD_MADERA141141 depends on SND_SOC142142 help143143- Support for the LDO1 regulators found on Wolfson Arizona class144144- devices.143143+ Support for the LDO1 regulators found on Cirrus Logic Madera codecs144144+ and Wolfson Microelectronic Arizona codecs.145145146146config REGULATOR_ARIZONA_MICSUPP147147- tristate "Wolfson Arizona class devices MICSUPP"148148- depends on MFD_ARIZONA147147+ tristate "Cirrus Madera and Wolfson Arizona class devices MICSUPP"148148+ depends on MFD_ARIZONA || MFD_MADERA149149 depends on SND_SOC150150 help151151- Support for the MICSUPP regulators found on Wolfson Arizona class151151+ Support for the MICSUPP regulators found on Cirrus Logic Madera codecs152152+ and Wolfson Microelectronic Arizona codecs152153 devices.153154154155config REGULATOR_AS3711···259258260259config REGULATOR_DA9063261260 tristate "Dialog Semiconductor DA9063 regulators"262262- depends on MFD_DA9063261261+ depends on MFD_DA9063 && OF263262 help264263 Say y here to support the BUCKs and LDOs regulators found on265264 DA9063 PMICs.···829828830829 This driver can also be built as a module. If so, the module831830 will be called sky81452-regulator.831831+832832+config REGULATOR_SLG51000833833+ tristate "Dialog Semiconductor SLG51000 regulators"834834+ depends on I2C835835+ select REGMAP_I2C836836+ help837837+ Say y here to support for the Dialog Semiconductor SLG51000.838838+ The SLG51000 is seven compact and customizable low dropout839839+ regulators.840840+841841+config REGULATOR_STM32_BOOSTER842842+ tristate "STMicroelectronics STM32 BOOSTER"843843+ depends on ARCH_STM32 || COMPILE_TEST844844+ help845845+ This driver supports internal booster (3V3) embedded in some846846+ STMicroelectronics STM32 chips. It can be used to supply ADC analog847847+ input switches when vdda supply is below 2.7V.848848+849849+ This driver can also be built as a module. If so, the module850850+ will be called stm32-booster.832851833852config REGULATOR_STM32_VREFBUF834853 tristate "STMicroelectronics STM32 VREFBUF"
···11// SPDX-License-Identifier: GPL-2.0-or-later22-/*33- * core.c -- Voltage/Current Regulator framework.44- *55- * Copyright 2007, 2008 Wolfson Microelectronics PLC.66- * Copyright 2008 SlimLogic Ltd.77- *88- * Author: Liam Girdwood <lrg@slimlogic.co.uk>99- */22+//33+// core.c -- Voltage/Current Regulator framework.44+//55+// Copyright 2007, 2008 Wolfson Microelectronics PLC.66+// Copyright 2008 SlimLogic Ltd.77+//88+// Author: Liam Girdwood <lrg@slimlogic.co.uk>1091110#include <linux/kernel.h>1211#include <linux/init.h>···16441645{16451646 if (rdev->constraints && rdev->constraints->enable_time)16461647 return rdev->constraints->enable_time;16471647- if (!rdev->desc->ops->enable_time)16481648- return rdev->desc->enable_time;16491649- return rdev->desc->ops->enable_time(rdev);16481648+ if (rdev->desc->ops->enable_time)16491649+ return rdev->desc->ops->enable_time(rdev);16501650+ return rdev->desc->enable_time;16501651}1651165216521653static struct regulator_supply_alias *regulator_find_supply_alias(···31063107 return ret;31073108}3108310931103110+static int _regulator_set_voltage_sel_step(struct regulator_dev *rdev,31113111+ int uV, int new_selector)31123112+{31133113+ const struct regulator_ops *ops = rdev->desc->ops;31143114+ int diff, old_sel, curr_sel, ret;31153115+31163116+ /* Stepping is only needed if the regulator is enabled. */31173117+ if (!_regulator_is_enabled(rdev))31183118+ goto final_set;31193119+31203120+ if (!ops->get_voltage_sel)31213121+ return -EINVAL;31223122+31233123+ old_sel = ops->get_voltage_sel(rdev);31243124+ if (old_sel < 0)31253125+ return old_sel;31263126+31273127+ diff = new_selector - old_sel;31283128+ if (diff == 0)31293129+ return 0; /* No change needed. */31303130+31313131+ if (diff > 0) {31323132+ /* Stepping up. */31333133+ for (curr_sel = old_sel + rdev->desc->vsel_step;31343134+ curr_sel < new_selector;31353135+ curr_sel += rdev->desc->vsel_step) {31363136+ /*31373137+ * Call the callback directly instead of using31383138+ * _regulator_call_set_voltage_sel() as we don't31393139+ * want to notify anyone yet. Same in the branch31403140+ * below.31413141+ */31423142+ ret = ops->set_voltage_sel(rdev, curr_sel);31433143+ if (ret)31443144+ goto try_revert;31453145+ }31463146+ } else {31473147+ /* Stepping down. */31483148+ for (curr_sel = old_sel - rdev->desc->vsel_step;31493149+ curr_sel > new_selector;31503150+ curr_sel -= rdev->desc->vsel_step) {31513151+ ret = ops->set_voltage_sel(rdev, curr_sel);31523152+ if (ret)31533153+ goto try_revert;31543154+ }31553155+ }31563156+31573157+final_set:31583158+ /* The final selector will trigger the notifiers. */31593159+ return _regulator_call_set_voltage_sel(rdev, uV, new_selector);31603160+31613161+try_revert:31623162+ /*31633163+ * At least try to return to the previous voltage if setting a new31643164+ * one failed.31653165+ */31663166+ (void)ops->set_voltage_sel(rdev, old_sel);31673167+ return ret;31683168+}31693169+31093170static int _regulator_set_voltage_time(struct regulator_dev *rdev,31103171 int old_uV, int new_uV)31113172{···32393180 selector = ret;32403181 if (old_selector == selector)32413182 ret = 0;31833183+ else if (rdev->desc->vsel_step)31843184+ ret = _regulator_set_voltage_sel_step(31853185+ rdev, best_val, selector);32423186 else32433187 ret = _regulator_call_set_voltage_sel(32443188 rdev, best_val, selector);
+1-1
drivers/regulator/cpcap-regulator.c
···9090#define CPCAP_REG_OFF_MODE_SEC BIT(15)91919292/**9393- * SoC specific configuraion for CPCAP regulator. There are at least three9393+ * SoC specific configuration for CPCAP regulator. There are at least three9494 * different SoCs each with their own parameters: omap3, omap4 and tegra2.9595 *9696 * The assign_reg and assign_mask seem to allow toggling between primary
···371371 "dcdc-ext-control-gpios", 0,372372 gflags,373373 "tps65090");374374- if (IS_ERR(rpdata->gpiod))375375- return ERR_CAST(rpdata->gpiod);376376- if (!rpdata->gpiod)374374+ if (PTR_ERR(rpdata->gpiod) == -ENOENT) {377375 dev_err(&pdev->dev,378376 "could not find DCDC external control GPIO\n");377377+ rpdata->gpiod = NULL;378378+ } else if (IS_ERR(rpdata->gpiod))379379+ return ERR_CAST(rpdata->gpiod);379380 }380381381382 if (of_property_read_u32(tps65090_matches[idx].of_node,
+13-16
drivers/regulator/wm831x-dcdc.c
···1515#include <linux/platform_device.h>1616#include <linux/regulator/driver.h>1717#include <linux/regulator/machine.h>1818-#include <linux/gpio.h>1818+#include <linux/gpio/consumer.h>1919#include <linux/slab.h>20202121#include <linux/mfd/wm831x/core.h>···5050 int base;5151 struct wm831x *wm831x;5252 struct regulator_dev *regulator;5353- int dvs_gpio;5353+ struct gpio_desc *dvs_gpiod;5454 int dvs_gpio_state;5555 int on_vsel;5656 int dvs_vsel;···217217 return 0;218218219219 dcdc->dvs_gpio_state = state;220220- gpio_set_value(dcdc->dvs_gpio, state);220220+ gpiod_set_value(dcdc->dvs_gpiod, state);221221222222 /* Should wait for DVS state change to be asserted if we have223223 * a GPIO for it, for now assume the device is configured···237237 int ret;238238239239 /* If this value is already set then do a GPIO update if we can */240240- if (dcdc->dvs_gpio && dcdc->on_vsel == vsel)240240+ if (dcdc->dvs_gpiod && dcdc->on_vsel == vsel)241241 return wm831x_buckv_set_dvs(rdev, 0);242242243243- if (dcdc->dvs_gpio && dcdc->dvs_vsel == vsel)243243+ if (dcdc->dvs_gpiod && dcdc->dvs_vsel == vsel)244244 return wm831x_buckv_set_dvs(rdev, 1);245245246246 /* Always set the ON status to the minimum voltage */···249249 return ret;250250 dcdc->on_vsel = vsel;251251252252- if (!dcdc->dvs_gpio)252252+ if (!dcdc->dvs_gpiod)253253 return ret;254254255255 /* Kick the voltage transition now */···296296{297297 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);298298299299- if (dcdc->dvs_gpio && dcdc->dvs_gpio_state)299299+ if (dcdc->dvs_gpiod && dcdc->dvs_gpio_state)300300 return dcdc->dvs_vsel;301301 else302302 return dcdc->on_vsel;···337337 int ret;338338 u16 ctrl;339339340340- if (!pdata || !pdata->dvs_gpio)340340+ if (!pdata)341341 return;342342343343 /* gpiolib won't let us read the GPIO status so pick the higher···345345 */346346 dcdc->dvs_gpio_state = pdata->dvs_init_state;347347348348- ret = devm_gpio_request_one(&pdev->dev, pdata->dvs_gpio,349349- dcdc->dvs_gpio_state ? GPIOF_INIT_HIGH : 0,350350- "DCDC DVS");351351- if (ret < 0) {352352- dev_err(wm831x->dev, "Failed to get %s DVS GPIO: %d\n",353353- dcdc->name, ret);348348+ dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs",349349+ dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);350350+ if (IS_ERR(dcdc->dvs_gpiod)) {351351+ dev_err(wm831x->dev, "Failed to get %s DVS GPIO: %ld\n",352352+ dcdc->name, PTR_ERR(dcdc->dvs_gpiod));354353 return;355354 }356356-357357- dcdc->dvs_gpio = pdata->dvs_gpio;358355359356 switch (pdata->dvs_control_src) {360357 case 1:
···1111#ifndef __MFD_DA9063_PDATA_H__1212#define __MFD_DA9063_PDATA_H__13131414-#include <linux/regulator/machine.h>1515-1616-/*1717- * Regulator configuration1818- */1919-/* DA9063 and DA9063L regulator IDs */2020-enum {2121- /* BUCKs */2222- DA9063_ID_BCORE1,2323- DA9063_ID_BCORE2,2424- DA9063_ID_BPRO,2525- DA9063_ID_BMEM,2626- DA9063_ID_BIO,2727- DA9063_ID_BPERI,2828-2929- /* BCORE1 and BCORE2 in merged mode */3030- DA9063_ID_BCORES_MERGED,3131- /* BMEM and BIO in merged mode */3232- DA9063_ID_BMEM_BIO_MERGED,3333- /* When two BUCKs are merged, they cannot be reused separately */3434-3535- /* LDOs on both DA9063 and DA9063L */3636- DA9063_ID_LDO3,3737- DA9063_ID_LDO7,3838- DA9063_ID_LDO8,3939- DA9063_ID_LDO9,4040- DA9063_ID_LDO11,4141-4242- /* DA9063-only LDOs */4343- DA9063_ID_LDO1,4444- DA9063_ID_LDO2,4545- DA9063_ID_LDO4,4646- DA9063_ID_LDO5,4747- DA9063_ID_LDO6,4848- DA9063_ID_LDO10,4949-};5050-5151-/* Regulators platform data */5252-struct da9063_regulator_data {5353- int id;5454- struct regulator_init_data *initdata;5555-};5656-5757-struct da9063_regulators_pdata {5858- unsigned n_regulators;5959- struct da9063_regulator_data *regulator_data;6060-};6161-6262-6314/*6415 * RGB LED configuration6516 */
+5
include/linux/mfd/samsung/s2mps11.h
···190190#define S2MPS11_BUCK6_RAMP_EN_SHIFT 0191191#define S2MPS11_PMIC_EN_SHIFT 6192192193193+/*194194+ * Bits for "enable suspend" (On/Off controlled by PWREN)195195+ * are the same as in S2MPS14: S2MPS14_ENABLE_SUSPEND196196+ */197197+193198#endif /* __LINUX_MFD_S2MPS11_H */
-1
include/linux/mfd/wm831x/pdata.h
···4747 * I2C or SPI buses.4848 */4949struct wm831x_buckv_pdata {5050- int dvs_gpio; /** CPU GPIO to use for DVS switching */5150 int dvs_control_src; /** Hardware DVS source to use (1 or 2) */5251 int dvs_init_state; /** DVS state to expect on startup */5352 int dvs_state_gpio; /** CPU GPIO to use for monitoring status */
+6
include/linux/regulator/driver.h
···283283 * @vsel_range_mask: Mask for register bitfield used for range selector284284 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_285285 * @vsel_mask: Mask for register bitfield used for selector286286+ * @vsel_step: Specify the resolution of selector stepping when setting287287+ * voltage. If 0, then no stepping is done (requested selector is288288+ * set directly), if >0 then the regulator API will ramp the289289+ * voltage up/down gradually each time increasing/decreasing the290290+ * selector by the specified step value.286291 * @csel_reg: Register for current limit selector using regmap set_current_limit287292 * @csel_mask: Mask for register bitfield used for current limit selector288293 * @apply_reg: Register for initiate voltage change on the output when···362357 unsigned int vsel_range_mask;363358 unsigned int vsel_reg;364359 unsigned int vsel_mask;360360+ unsigned int vsel_step;365361 unsigned int csel_reg;366362 unsigned int csel_mask;367363 unsigned int apply_reg;
-3
include/linux/regulator/max8952.h
···105105#define MAX8952_NUM_DVS_MODE 4106106107107struct max8952_platform_data {108108- int gpio_vid0;109109- int gpio_vid1;110110-111108 u32 default_mode;112109 u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */113110