Commit d8495579 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull regulator updates from Mark Brown:
 "A fairly quiet release, there were some cleanup and a couple of new
  devices but the biggest change was converting most of the drivers to
  use asynchronous probe. This allows us to ramp up multiple regulators
  in parallel during boot which can have a noticable impact on modern
  systems.

  Summary:

   - Update of drivers to PROBE_PREFER_ASYNCHRONOUS to mitigate issues
     with ramp times slowing down boots.

   - Convert to void remove callbacks.

   - Support for voltage monitoring on DA9063

   - Support for Qualcomm PMC8180 and PMM8654au, Richtek RT4803 and
     RT5739, Rockchip RK860x"

* tag 'regulator-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (46 commits)
  regulator: dt-bindings: qcom,rpmh: Combine PM6150L and PM8150L if-then
  regulator: core: Make regulator_lock_two() logic easier to follow
  regulator: dt-bindings: qcom,rpmh: Correct PM8550 family supplies
  regulator: stm32-pwr: fix of_iomap leak
  dt-bindings: mfd: dlg,da9063: document voltage monitoring
  regulator: da9063: implement setter for voltage monitoring
  regulator: da9063: add voltage monitoring registers
  regulator: fan53555: Add support for RK860X
  regulator: fan53555: Use dev_err_probe
  regulator: fan53555: Improve vsel_mask computation
  regulator: fan53555: Make use of the bit macros
  regulator: fan53555: Remove unused *_SLEW_SHIFT definitions
  regulator: dt-bindings: fcs,fan53555: Add support for RK860X
  regulator: qcom_smd: Add MP5496 S1 regulator
  regulator: qcom_smd: Add s1 sub-node to mp5496 regulator
  regulator: qcom,rpmh: add compatible for pmm8654au RPMH
  regulator: qcom-rpmh: add support for pmm8654au regulators
  regulator: core: Avoid lockdep reports when resolving supplies
  regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
  regulator: dt-bindings: qcom,rpmh: Add compatible for PMC8180
  ...
parents f5468bec ed479907
...@@ -12,6 +12,11 @@ maintainers: ...@@ -12,6 +12,11 @@ maintainers:
description: | description: |
For device-tree bindings of other sub-modules refer to the binding documents For device-tree bindings of other sub-modules refer to the binding documents
under the respective sub-system directories. under the respective sub-system directories.
Using regulator-{uv,ov}-{warn,error,protection}-microvolt requires special
handling: First, when GP_FB2 is used, it must be ensured that there is no
moment where all voltage monitors are disabled. Next, as da9063 only supports
UV *and* OV monitoring, both must be set to the same severity and value
(0: disable, 1: enable).
properties: properties:
compatible: compatible:
...@@ -121,11 +126,19 @@ examples: ...@@ -121,11 +126,19 @@ examples:
regulator-max-microamp = <2000000>; regulator-max-microamp = <2000000>;
regulator-boot-on; regulator-boot-on;
}; };
ldo6 {
/* UNUSED */
regulator-name = "LDO_6";
regulator-uv-protection-microvolt = <0>;
regulator-ov-protection-microvolt = <0>;
};
ldo11 { ldo11 {
regulator-name = "LDO_11"; regulator-name = "LDO_11";
regulator-min-microvolt = <900000>; regulator-min-microvolt = <900000>;
regulator-max-microvolt = <3600000>; regulator-max-microvolt = <900000>;
regulator-boot-on; regulator-uv-protection-microvolt = <1>;
regulator-ov-protection-microvolt = <1>;
regulator-always-on;
}; };
}; };
}; };
......
...@@ -10,7 +10,7 @@ maintainers: ...@@ -10,7 +10,7 @@ maintainers:
- Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> - Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
...@@ -19,43 +19,43 @@ properties: ...@@ -19,43 +19,43 @@ properties:
regulator-name: true regulator-name: true
anatop-reg-offset: anatop-reg-offset:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the anatop MFD register offset. description: u32 value representing the anatop MFD register offset.
anatop-vol-bit-shift: anatop-vol-bit-shift:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the bit shift for the register. description: u32 value representing the bit shift for the register.
anatop-vol-bit-width: anatop-vol-bit-width:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the number of bits used in the register. description: u32 value representing the number of bits used in the register.
anatop-min-bit-val: anatop-min-bit-val:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the minimum value of this register. description: u32 value representing the minimum value of this register.
anatop-min-voltage: anatop-min-voltage:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the minimum voltage of this regulator. description: u32 value representing the minimum voltage of this regulator.
anatop-max-voltage: anatop-max-voltage:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the maximum voltage of this regulator. description: u32 value representing the maximum voltage of this regulator.
anatop-delay-reg-offset: anatop-delay-reg-offset:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the anatop MFD step time register offset. description: u32 value representing the anatop MFD step time register offset.
anatop-delay-bit-shift: anatop-delay-bit-shift:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the bit shift for the step time register. description: u32 value representing the bit shift for the step time register.
anatop-delay-bit-width: anatop-delay-bit-width:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing the number of bits used in the step time register. description: u32 value representing the number of bits used in the step time register.
anatop-enable-bit: anatop-enable-bit:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: /schemas/types.yaml#/definitions/uint32
description: u32 value representing regulator enable bit offset. description: u32 value representing regulator enable bit offset.
vin-supply: vin-supply:
......
...@@ -109,7 +109,7 @@ properties: ...@@ -109,7 +109,7 @@ properties:
description: Specify a valid GPIO for platform control of the regulator description: Specify a valid GPIO for platform control of the regulator
dlg,ripple-cancel: dlg,ripple-cancel:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
enum: [ 0, 1, 2, 3 ] enum: [ 0, 1, 2, 3 ]
description: | description: |
Defined in include/dt-bindings/regulator/dlg,da9121-regulator.h Defined in include/dt-bindings/regulator/dlg,da9121-regulator.h
......
...@@ -14,12 +14,21 @@ allOf: ...@@ -14,12 +14,21 @@ allOf:
properties: properties:
compatible: compatible:
enum: oneOf:
- enum:
- fcs,fan53555 - fcs,fan53555
- fcs,fan53526 - fcs,fan53526
- rockchip,rk8600
- rockchip,rk8602
- silergy,syr827 - silergy,syr827
- silergy,syr828 - silergy,syr828
- tcs,tcs4525 - tcs,tcs4525
- items:
- const: rockchip,rk8601
- const: rockchip,rk8600
- items:
- const: rockchip,rk8603
- const: rockchip,rk8602
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -17,7 +17,7 @@ description: ...@@ -17,7 +17,7 @@ description:
to be the same. to be the same.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
- if: - if:
properties: properties:
compatible: compatible:
......
...@@ -14,7 +14,7 @@ description: ...@@ -14,7 +14,7 @@ description:
regulator.yaml, can also be used. regulator.yaml, can also be used.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -15,7 +15,7 @@ description: ...@@ -15,7 +15,7 @@ description:
regulator.txt, can also be used. regulator.txt, can also be used.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -25,7 +25,7 @@ properties: ...@@ -25,7 +25,7 @@ properties:
patternProperties: patternProperties:
"^regulator-(ldo|sbb[0-2])$": "^regulator-(ldo|sbb[0-2])$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
required: required:
......
...@@ -25,7 +25,7 @@ properties: ...@@ -25,7 +25,7 @@ properties:
patternProperties: patternProperties:
"^regulator-.+$": "^regulator-.+$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
additionalProperties: false additionalProperties: false
......
...@@ -25,7 +25,7 @@ properties: ...@@ -25,7 +25,7 @@ properties:
patternProperties: patternProperties:
"^(ldo[1-5]|buck)$": "^(ldo[1-5]|buck)$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
additionalProperties: false additionalProperties: false
......
...@@ -18,7 +18,7 @@ description: | ...@@ -18,7 +18,7 @@ description: |
patternProperties: patternProperties:
"^buck-v(core2|io18|dvfs11|dvfs12|dvfs13|dvfs14)$": "^buck-v(core2|io18|dvfs11|dvfs12|dvfs13|dvfs14)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -28,7 +28,7 @@ patternProperties: ...@@ -28,7 +28,7 @@ patternProperties:
"^ldo-v(avdd32aud|auxa32)$": "^ldo-v(avdd32aud|auxa32)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -38,7 +38,7 @@ patternProperties: ...@@ -38,7 +38,7 @@ patternProperties:
"^ldo-v(dig18|emc33|ibr|mc|mch|mipi|rtc|sram|usb10)$": "^ldo-v(dig18|emc33|ibr|mc|mch|mipi|rtc|sram|usb10)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -48,7 +48,7 @@ patternProperties: ...@@ -48,7 +48,7 @@ patternProperties:
"^ldo-vcam(a|af|d|io)$": "^ldo-vcam(a|af|d|io)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -58,7 +58,7 @@ patternProperties: ...@@ -58,7 +58,7 @@ patternProperties:
"^ldo-vtcxo[12]$": "^ldo-vtcxo[12]$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -71,7 +71,7 @@ patternProperties: ...@@ -71,7 +71,7 @@ patternProperties:
"^ldo-vgp[1234]$": "^ldo-vgp[1234]$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
......
...@@ -18,7 +18,7 @@ description: | ...@@ -18,7 +18,7 @@ description: |
patternProperties: patternProperties:
"^buck-v(dram|dvfs2|pa|rf18a|rf18b|sbst)$": "^buck-v(dram|dvfs2|pa|rf18a|rf18b|sbst)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -28,7 +28,7 @@ patternProperties: ...@@ -28,7 +28,7 @@ patternProperties:
"^ldo-v(bif28|dig18|sram|usb33)$": "^ldo-v(bif28|dig18|sram|usb33)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
......
...@@ -28,11 +28,11 @@ properties: ...@@ -28,11 +28,11 @@ properties:
patternProperties: patternProperties:
"^buck[1-4]$": "^buck[1-4]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
"^ldo[1-4]$": "^ldo[1-4]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
additionalProperties: false additionalProperties: false
......
...@@ -28,7 +28,7 @@ properties: ...@@ -28,7 +28,7 @@ properties:
mps,fb-voltage-divider: mps,fb-voltage-divider:
description: An array of two integers containing the resistor description: An array of two integers containing the resistor
values R1 and R2 of the feedback voltage divider in kilo ohms. values R1 and R2 of the feedback voltage divider in kilo ohms.
$ref: "/schemas/types.yaml#/definitions/uint32-array" $ref: /schemas/types.yaml#/definitions/uint32-array
maxItems: 2 maxItems: 2
mps,switch-frequency-hz: mps,switch-frequency-hz:
......
...@@ -29,7 +29,7 @@ properties: ...@@ -29,7 +29,7 @@ properties:
properties: properties:
mps,switch-freq: mps,switch-freq:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2, 3] enum: [0, 1, 2, 3]
default: 2 default: 2
description: | description: |
...@@ -51,14 +51,14 @@ properties: ...@@ -51,14 +51,14 @@ properties:
properties: properties:
mps,buck-softstart: mps,buck-softstart:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2, 3] enum: [0, 1, 2, 3]
description: | description: |
defines the soft start time of this buck, must be one of the following defines the soft start time of this buck, must be one of the following
corresponding values 150us, 300us, 610us, 920us corresponding values 150us, 300us, 610us, 920us
mps,buck-phase-delay: mps,buck-phase-delay:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2, 3] enum: [0, 1, 2, 3]
description: | description: |
defines the phase delay of this buck, must be one of the following defines the phase delay of this buck, must be one of the following
......
...@@ -28,7 +28,7 @@ properties: ...@@ -28,7 +28,7 @@ properties:
patternProperties: patternProperties:
"^vbuck[1-4]$": "^vbuck[1-4]$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
properties: properties:
......
...@@ -17,7 +17,7 @@ description: | ...@@ -17,7 +17,7 @@ description: |
patternProperties: patternProperties:
"^buck_v(s1|gpu11|modem|pu|core|s2|pa|proc2|proc1|core_sshub)$": "^buck_v(s1|gpu11|modem|pu|core|s2|pa|proc2|proc1|core_sshub)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -27,7 +27,7 @@ patternProperties: ...@@ -27,7 +27,7 @@ patternProperties:
"^ldo_v(ibr|rf12|usb|camio|efuse|xo22)$": "^ldo_v(ibr|rf12|usb|camio|efuse|xo22)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -37,7 +37,7 @@ patternProperties: ...@@ -37,7 +37,7 @@ patternProperties:
"^ldo_v(rfck|emc|a12|a09|ufs|bbck)$": "^ldo_v(rfck|emc|a12|a09|ufs|bbck)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -47,7 +47,7 @@ patternProperties: ...@@ -47,7 +47,7 @@ patternProperties:
"^ldo_vcn(18|13|33_1_bt|13_1_wifi|33_2_bt|33_2_wifi)$": "^ldo_vcn(18|13|33_1_bt|13_1_wifi|33_2_bt|33_2_wifi)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -57,7 +57,7 @@ patternProperties: ...@@ -57,7 +57,7 @@ patternProperties:
"^ldo_vsram_(proc2|others|md|proc1|others_sshub)$": "^ldo_vsram_(proc2|others|md|proc1|others_sshub)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -67,7 +67,7 @@ patternProperties: ...@@ -67,7 +67,7 @@ patternProperties:
"^ldo_v(fe|bif|io)28$": "^ldo_v(fe|bif|io)28$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -77,7 +77,7 @@ patternProperties: ...@@ -77,7 +77,7 @@ patternProperties:
"^ldo_v(aud|io|aux|rf|m)18$": "^ldo_v(aud|io|aux|rf|m)18$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
...@@ -87,7 +87,7 @@ patternProperties: ...@@ -87,7 +87,7 @@ patternProperties:
"^ldo_vsim[12]$": "^ldo_vsim[12]$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
regulator-name: regulator-name:
......
...@@ -26,11 +26,11 @@ properties: ...@@ -26,11 +26,11 @@ properties:
patternProperties: patternProperties:
"^buck[12]$": "^buck[12]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
"^ldo[123567]$": "^ldo[123567]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
required: required:
......
...@@ -57,7 +57,7 @@ properties: ...@@ -57,7 +57,7 @@ properties:
properties: properties:
nxp,dvs-run-voltage: nxp,dvs-run-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 600000 minimum: 600000
maximum: 2187500 maximum: 2187500
description: description:
...@@ -65,7 +65,7 @@ properties: ...@@ -65,7 +65,7 @@ properties:
dvs(dynamic voltage scaling) property. dvs(dynamic voltage scaling) property.
nxp,dvs-standby-voltage: nxp,dvs-standby-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 600000 minimum: 600000
maximum: 2187500 maximum: 2187500
description: description:
......
...@@ -38,12 +38,6 @@ properties: ...@@ -38,12 +38,6 @@ properties:
description: description:
Properties for single LDO regulator. Properties for single LDO regulator.
properties:
regulator-name:
pattern: "^ldo[1-4]$"
description:
should be "ldo1", ..., "ldo4"
unevaluatedProperties: false unevaluatedProperties: false
"^buck[1-7]$": "^buck[1-7]$":
...@@ -53,13 +47,8 @@ properties: ...@@ -53,13 +47,8 @@ properties:
Properties for single BUCK regulator. Properties for single BUCK regulator.
properties: properties:
regulator-name:
pattern: "^buck[1-7]$"
description:
should be "buck1", ..., "buck7"
nxp,ilim-ma: nxp,ilim-ma:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 2100 minimum: 2100
maximum: 4500 maximum: 4500
deprecated: true deprecated: true
...@@ -75,7 +64,7 @@ properties: ...@@ -75,7 +64,7 @@ properties:
4500 4500
nxp,phase-shift: nxp,phase-shift:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
default: 0 default: 0
enum: [ 0, 45, 90, 135, 180, 225, 270, 315 ] enum: [ 0, 45, 90, 135, 180, 225, 270, 315 ]
description: description:
...@@ -90,12 +79,6 @@ properties: ...@@ -90,12 +79,6 @@ properties:
description: description:
Properties for single VSNVS regulator. Properties for single VSNVS regulator.
properties:
regulator-name:
pattern: "^vsnvs$"
description:
should be "vsnvs"
unevaluatedProperties: false unevaluatedProperties: false
additionalProperties: false additionalProperties: false
......
...@@ -63,19 +63,19 @@ properties: ...@@ -63,19 +63,19 @@ properties:
patternProperties: patternProperties:
"^sw([1-4]|[1-4][a-c]|[1-4][a-c][a-c])$": "^sw([1-4]|[1-4][a-c]|[1-4][a-c][a-c])$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
"^vgen[1-6]$": "^vgen[1-6]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
"^vldo[1-4]$": "^vldo[1-4]$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
"^(vsnvs|vref|vrefddr|swbst|coin|v33|vccsd)$": "^(vsnvs|vref|vrefddr|swbst|coin|v33|vccsd)$":
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
additionalProperties: false additionalProperties: false
......
...@@ -75,9 +75,12 @@ properties: ...@@ -75,9 +75,12 @@ properties:
- qcom,pm8550ve-rpmh-regulators - qcom,pm8550ve-rpmh-regulators
- qcom,pm8550vs-rpmh-regulators - qcom,pm8550vs-rpmh-regulators
- qcom,pm8998-rpmh-regulators - qcom,pm8998-rpmh-regulators
- qcom,pmc8180-rpmh-regulators
- qcom,pmc8180c-rpmh-regulators
- qcom,pmg1110-rpmh-regulators - qcom,pmg1110-rpmh-regulators
- qcom,pmi8998-rpmh-regulators - qcom,pmi8998-rpmh-regulators
- qcom,pmm8155au-rpmh-regulators - qcom,pmm8155au-rpmh-regulators
- qcom,pmm8654au-rpmh-regulators
- qcom,pmr735a-rpmh-regulators - qcom,pmr735a-rpmh-regulators
- qcom,pmx55-rpmh-regulators - qcom,pmx55-rpmh-regulators
- qcom,pmx65-rpmh-regulators - qcom,pmx65-rpmh-regulators
...@@ -105,18 +108,18 @@ properties: ...@@ -105,18 +108,18 @@ properties:
bob: bob:
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
description: BOB regulator node. description: BOB regulator node.
dependencies: dependencies:
regulator-allow-set-load: ["regulator-allowed-modes"] regulator-allow-set-load: [ regulator-allowed-modes ]
patternProperties: patternProperties:
"^(smps|ldo|lvs|bob)[0-9]+$": "^(smps|ldo|lvs|bob)[0-9]+$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
description: smps/ldo regulator nodes(s). description: smps/ldo regulator nodes(s).
dependencies: dependencies:
regulator-allow-set-load: ["regulator-allowed-modes"] regulator-allow-set-load: [ regulator-allowed-modes ]
required: required:
- compatible - compatible
...@@ -144,6 +147,8 @@ allOf: ...@@ -144,6 +147,8 @@ allOf:
compatible: compatible:
enum: enum:
- qcom,pm6150l-rpmh-regulators - qcom,pm6150l-rpmh-regulators
- qcom,pm8150l-rpmh-regulators
- qcom,pmc8180c-rpmh-regulators
then: then:
properties: properties:
vdd-bob-supply: vdd-bob-supply:
...@@ -232,6 +237,7 @@ allOf: ...@@ -232,6 +237,7 @@ allOf:
compatible: compatible:
enum: enum:
- qcom,pm8150-rpmh-regulators - qcom,pm8150-rpmh-regulators
- qcom,pmc8180-rpmh-regulators
- qcom,pmm8155au-rpmh-regulators - qcom,pmm8155au-rpmh-regulators
then: then:
properties: properties:
...@@ -248,18 +254,17 @@ allOf: ...@@ -248,18 +254,17 @@ allOf:
properties: properties:
compatible: compatible:
enum: enum:
- qcom,pm8150l-rpmh-regulators - qcom,pmm8654au-rpmh-regulators
then: then:
properties: properties:
vdd-bob-supply: vdd-l1-supply: true
description: BOB regulator parent supply phandle.
vdd-l1-l8-supply: true
vdd-l2-l3-supply: true vdd-l2-l3-supply: true
vdd-l4-l5-l6-supply: true vdd-l4-supply: true
vdd-l7-l11-supply: true vdd-l5-supply: true
vdd-l9-l10-supply: true vdd-l6-l7-supply: true
vdd-l8-l9-supply: true
patternProperties: patternProperties:
"^vdd-s[1-8]-supply$": true "^vdd-s[1-9]-supply$": true
- if: - if:
properties: properties:
...@@ -308,19 +313,29 @@ allOf: ...@@ -308,19 +313,29 @@ allOf:
compatible: compatible:
enum: enum:
- qcom,pm8550-rpmh-regulators - qcom,pm8550-rpmh-regulators
- qcom,pm8550ve-rpmh-regulators
- qcom,pm8550vs-rpmh-regulators
then: then:
properties: properties:
vdd-l1-l4-l10-supply: true
vdd-l2-l13-l14-supply: true vdd-l2-l13-l14-supply: true
vdd-l5-l16-supply: true vdd-l5-l16-supply: true
vdd-l6-l7-supply: true vdd-l6-l7-supply: true
vdd-l8-l9-supply: true vdd-l8-l9-supply: true
patternProperties: patternProperties:
"^vdd-l([1-4]|1[0-7])-supply$": true "^vdd-l(3|1[1-7])-supply$": true
"^vdd-s[1-6]-supply$": true "^vdd-s[1-6]-supply$": true
"^vdd-bob[1-2]-supply$": true "^vdd-bob[1-2]-supply$": true
- if:
properties:
compatible:
enum:
- qcom,pm8550ve-rpmh-regulators
- qcom,pm8550vs-rpmh-regulators
then:
patternProperties:
"^vdd-l[1-3]-supply$": true
"^vdd-s[1-6]-supply$": true
- if: - if:
properties: properties:
compatible: compatible:
......
...@@ -22,7 +22,7 @@ description: ...@@ -22,7 +22,7 @@ description:
Each sub-node is identified using the node's name, with valid values listed Each sub-node is identified using the node's name, with valid values listed
for each of the pmics below. for each of the pmics below.
For mp5496, s2 For mp5496, s1, s2
For pm2250, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, For pm2250, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22 l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22
......
...@@ -15,7 +15,7 @@ description: | ...@@ -15,7 +15,7 @@ description: |
and control the backlight. and control the backlight.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -13,7 +13,7 @@ maintainers: ...@@ -13,7 +13,7 @@ maintainers:
properties: properties:
regulator-name: regulator-name:
description: A string used as a descriptive name for regulator outputs description: A string used as a descriptive name for regulator outputs
$ref: "/schemas/types.yaml#/definitions/string" $ref: /schemas/types.yaml#/definitions/string
regulator-min-microvolt: regulator-min-microvolt:
description: smallest voltage consumers may set description: smallest voltage consumers may set
...@@ -23,7 +23,7 @@ properties: ...@@ -23,7 +23,7 @@ properties:
regulator-microvolt-offset: regulator-microvolt-offset:
description: Offset applied to voltages to compensate for voltage drops description: Offset applied to voltages to compensate for voltage drops
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
regulator-min-microamp: regulator-min-microamp:
description: smallest current consumers may set description: smallest current consumers may set
...@@ -59,7 +59,7 @@ properties: ...@@ -59,7 +59,7 @@ properties:
description: ramp delay for regulator(in uV/us) For hardware which supports description: ramp delay for regulator(in uV/us) For hardware which supports
disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay
= <0>) for disabling ramp delay. = <0>) for disabling ramp delay.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
regulator-enable-ramp-delay: regulator-enable-ramp-delay:
description: The time taken, in microseconds, for the supply rail to description: The time taken, in microseconds, for the supply rail to
...@@ -68,7 +68,7 @@ properties: ...@@ -68,7 +68,7 @@ properties:
required due to the combination of internal ramping of the regulator required due to the combination of internal ramping of the regulator
itself, and board design issues such as trace capacitance and load itself, and board design issues such as trace capacitance and load
on the supply. on the supply.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
regulator-settling-time-us: regulator-settling-time-us:
description: Settling time, in microseconds, for voltage change if regulator description: Settling time, in microseconds, for voltage change if regulator
...@@ -95,7 +95,7 @@ properties: ...@@ -95,7 +95,7 @@ properties:
description: initial operating mode. The set of possible operating modes description: initial operating mode. The set of possible operating modes
depends on the capabilities of every hardware so each device binding depends on the capabilities of every hardware so each device binding
documentation explains which values the regulator supports. documentation explains which values the regulator supports.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
regulator-allowed-modes: regulator-allowed-modes:
description: list of operating modes that software is allowed to configure description: list of operating modes that software is allowed to configure
...@@ -103,12 +103,12 @@ properties: ...@@ -103,12 +103,12 @@ properties:
The set of possible operating modes depends on the capabilities of The set of possible operating modes depends on the capabilities of
every hardware so each device binding document explains which values every hardware so each device binding document explains which values
the regulator supports. the regulator supports.
$ref: "/schemas/types.yaml#/definitions/uint32-array" $ref: /schemas/types.yaml#/definitions/uint32-array
regulator-system-load: regulator-system-load:
description: Load in uA present on regulator that is not captured by description: Load in uA present on regulator that is not captured by
any consumer request. any consumer request.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
regulator-pull-down: regulator-pull-down:
description: Enable pull down resistor when the regulator is disabled. description: Enable pull down resistor when the regulator is disabled.
...@@ -206,14 +206,14 @@ properties: ...@@ -206,14 +206,14 @@ properties:
0: Disable active discharge. 0: Disable active discharge.
1: Enable active discharge. 1: Enable active discharge.
Absence of this property will leave configuration to default. Absence of this property will leave configuration to default.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1] enum: [0, 1]
regulator-coupled-with: regulator-coupled-with:
description: Regulators with which the regulator is coupled. The linkage description: Regulators with which the regulator is coupled. The linkage
is 2-way - all coupled regulators should be linked with each other. is 2-way - all coupled regulators should be linked with each other.
A regulator should not be coupled with its supplier. A regulator should not be coupled with its supplier.
$ref: "/schemas/types.yaml#/definitions/phandle-array" $ref: /schemas/types.yaml#/definitions/phandle-array
items: items:
maxItems: 1 maxItems: 1
...@@ -221,7 +221,7 @@ properties: ...@@ -221,7 +221,7 @@ properties:
description: Array of maximum spread between voltages of coupled regulators description: Array of maximum spread between voltages of coupled regulators
in microvolts, each value in the array relates to the corresponding in microvolts, each value in the array relates to the corresponding
couple specified by the regulator-coupled-with property. couple specified by the regulator-coupled-with property.
$ref: "/schemas/types.yaml#/definitions/uint32-array" $ref: /schemas/types.yaml#/definitions/uint32-array
regulator-max-step-microvolt: regulator-max-step-microvolt:
description: Maximum difference between current and target voltages description: Maximum difference between current and target voltages
...@@ -269,7 +269,7 @@ patternProperties: ...@@ -269,7 +269,7 @@ patternProperties:
of possible operating modes depends on the capabilities of every of possible operating modes depends on the capabilities of every
hardware so the valid modes are documented on each regulator device hardware so the valid modes are documented on each regulator device
tree binding document. tree binding document.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
additionalProperties: false additionalProperties: false
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/richtek,rt4803.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT4803 Boost Regulator
maintainers:
- ChiYuan Huang <cy_huang@richtek.com>
description: |
RT4803 is a boost regulator that's designed to provide the minimum output
voltage, even if the input voltage is lower than the required voltage. It
supports boost and auto bypass mode that depends on the difference between the
input and output voltage. If the input is lower than the output, mode will
transform to boost mode. Otherwise, turn on bypass switch to enter bypass mode.
Datasheet is available at
https://www.richtek.com/assets/product_file/RT4803/DS4803-03.pdf
https://www.richtek.com/assets/product_file/RT4803A/DS4803A-06.pdf
allOf:
- $ref: regulator.yaml#
properties:
compatible:
enum:
- richtek,rt4803
reg:
maxItems: 1
richtek,vsel-active-high:
type: boolean
description: Specify the VSEL register group is using when system is active
regulator-allowed-modes:
description: |
Available operating mode
1: Auto PFM/PWM
2: Force PWM
items:
enum: [1, 2]
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
regulator@75 {
compatible = "richtek,rt4803";
reg = <0x75>;
richtek,vsel-active-high;
regulator-name = "rt4803-regulator";
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <4400000>;
regulator-allowed-modes = <1 2>;
regulator-always-on;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/richtek,rt5739.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT5739 Step-Down Buck Converter
maintainers:
- ChiYuan Huang <cy_huang@richtek.com>
description: |
The RT5739 is a step-down switching buck converter that can deliver the
programmable output voltage from 300mV to 1300mV with wide input voltage
supply of 2.5V to 5.5V. It can provide up to 3.5A continuous current
capability at over 80% high efficiency.
allOf:
- $ref: regulator.yaml#
properties:
compatible:
enum:
- richtek,rt5739
reg:
maxItems: 1
enable-gpios:
maxItems: 1
richtek,vsel-active-high:
description: |
If property is present, use the 'VSEL1' register group for buck control.
Else, use the 'VSEL0' register group. This depends on external hardware
'VSEL' pin connection.
type: boolean
regulator-allowed-modes:
description: |
buck allowed operating mode
0: Auto PFM/PWM mode
1: Forced PWM mode
items:
enum: [0, 1]
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
regulator@50 {
compatible = "richtek,rt5739";
reg = <0x50>;
enable-gpios = <&gpio26 1 GPIO_ACTIVE_HIGH>;
richtek,vsel-active-high;
regulator-name = "richtek,rt5739-buck";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <1300000>;
regulator-allowed-modes = <0 1>;
regulator-boot-on;
};
};
...@@ -32,7 +32,7 @@ properties: ...@@ -32,7 +32,7 @@ properties:
maxItems: 1 maxItems: 1
richtek,oc-level-select: richtek,oc-level-select:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2, 3] enum: [0, 1, 2, 3]
description: | description: |
Over current level selection. Each respective value means the current Over current level selection. Each respective value means the current
...@@ -40,7 +40,7 @@ properties: ...@@ -40,7 +40,7 @@ properties:
in chip default. in chip default.
richtek,ot-level-select: richtek,ot-level-select:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2] enum: [0, 1, 2]
description: | description: |
Over temperature level selection. Each respective value means the degree Over temperature level selection. Each respective value means the degree
...@@ -48,7 +48,7 @@ properties: ...@@ -48,7 +48,7 @@ properties:
default. default.
richtek,pgdly-time-select: richtek,pgdly-time-select:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2, 3] enum: [0, 1, 2, 3]
description: | description: |
Power good signal delay time selection. Each respective value means the Power good signal delay time selection. Each respective value means the
...@@ -57,7 +57,7 @@ properties: ...@@ -57,7 +57,7 @@ properties:
richtek,switch-freq-select: richtek,switch-freq-select:
$ref: "/schemas/types.yaml#/definitions/uint8" $ref: /schemas/types.yaml#/definitions/uint8
enum: [0, 1, 2] enum: [0, 1, 2]
description: | description: |
Buck switch frequency selection. Each respective value means 400KHz, Buck switch frequency selection. Each respective value means 400KHz,
......
...@@ -120,7 +120,7 @@ properties: ...@@ -120,7 +120,7 @@ properties:
lsw: lsw:
description: load switch current regulator description. description: load switch current regulator description.
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
required: required:
- compatible - compatible
......
...@@ -56,7 +56,7 @@ patternProperties: ...@@ -56,7 +56,7 @@ patternProperties:
PMIC "RUN" state voltage in uV when PMIC HW states are used. See PMIC "RUN" state voltage in uV when PMIC HW states are used. See
comments below for bucks/LDOs which support this. 0 means comments below for bucks/LDOs which support this. 0 means
regulator should be disabled at RUN state. regulator should be disabled at RUN state.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -67,7 +67,7 @@ patternProperties: ...@@ -67,7 +67,7 @@ patternProperties:
keeps regulator enabled. BD71815 does not change voltage level keeps regulator enabled. BD71815 does not change voltage level
when PMIC transitions to SNVS.SNVS voltage depends on the previous when PMIC transitions to SNVS.SNVS voltage depends on the previous
state (from which the PMIC transitioned to SNVS). state (from which the PMIC transitioned to SNVS).
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -76,7 +76,7 @@ patternProperties: ...@@ -76,7 +76,7 @@ patternProperties:
PMIC "SUSPEND" state voltage in uV when PMIC HW states are used. See PMIC "SUSPEND" state voltage in uV when PMIC HW states are used. See
comments below for bucks/LDOs which support this. 0 means comments below for bucks/LDOs which support this. 0 means
regulator should be disabled at SUSPEND state. regulator should be disabled at SUSPEND state.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -85,7 +85,7 @@ patternProperties: ...@@ -85,7 +85,7 @@ patternProperties:
PMIC "LPSR" state voltage in uV when PMIC HW states are used. See PMIC "LPSR" state voltage in uV when PMIC HW states are used. See
comments below for bucks/LDOs which support this. 0 means comments below for bucks/LDOs which support this. 0 means
regulator should be disabled at LPSR state. regulator should be disabled at LPSR state.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
......
...@@ -52,7 +52,7 @@ patternProperties: ...@@ -52,7 +52,7 @@ patternProperties:
description: description:
PMIC default "RUN" state voltage in uV. See below table for PMIC default "RUN" state voltage in uV. See below table for
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -60,7 +60,7 @@ patternProperties: ...@@ -60,7 +60,7 @@ patternProperties:
description: description:
PMIC default "IDLE" state voltage in uV. See below table for PMIC default "IDLE" state voltage in uV. See below table for
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -68,7 +68,7 @@ patternProperties: ...@@ -68,7 +68,7 @@ patternProperties:
description: description:
PMIC default "SUSPEND" state voltage in uV. See below table for PMIC default "SUSPEND" state voltage in uV. See below table for
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
...@@ -76,7 +76,7 @@ patternProperties: ...@@ -76,7 +76,7 @@ patternProperties:
description: description:
PMIC default "LPSR" state voltage in uV. See below table for PMIC default "LPSR" state voltage in uV. See below table for
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3300000 maximum: 3300000
......
...@@ -55,7 +55,7 @@ patternProperties: ...@@ -55,7 +55,7 @@ patternProperties:
should be "buck1", ..., "buck8" should be "buck1", ..., "buck8"
rohm,dvs-run-voltage: rohm,dvs-run-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
...@@ -63,7 +63,7 @@ patternProperties: ...@@ -63,7 +63,7 @@ patternProperties:
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
rohm,dvs-idle-voltage: rohm,dvs-idle-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
...@@ -71,7 +71,7 @@ patternProperties: ...@@ -71,7 +71,7 @@ patternProperties:
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
rohm,dvs-suspend-voltage: rohm,dvs-suspend-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
......
...@@ -54,7 +54,7 @@ patternProperties: ...@@ -54,7 +54,7 @@ patternProperties:
should be "buck1", ..., "buck6" should be "buck1", ..., "buck6"
rohm,dvs-run-voltage: rohm,dvs-run-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
...@@ -62,7 +62,7 @@ patternProperties: ...@@ -62,7 +62,7 @@ patternProperties:
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
rohm,dvs-idle-voltage: rohm,dvs-idle-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
...@@ -70,7 +70,7 @@ patternProperties: ...@@ -70,7 +70,7 @@ patternProperties:
bucks which support this. 0 means disabled. bucks which support this. 0 means disabled.
rohm,dvs-suspend-voltage: rohm,dvs-suspend-voltage:
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1300000 maximum: 1300000
description: description:
......
...@@ -25,7 +25,7 @@ patternProperties: ...@@ -25,7 +25,7 @@ patternProperties:
type: object type: object
description: description:
Properties for single regulator. Properties for single regulator.
$ref: "regulator.yaml#" $ref: regulator.yaml#
properties: properties:
rohm,ocw-fet-ron-micro-ohms: rohm,ocw-fet-ron-micro-ohms:
......
...@@ -42,7 +42,7 @@ properties: ...@@ -42,7 +42,7 @@ properties:
reset-names: true reset-names: true
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
- if: - if:
properties: properties:
compatible: compatible:
......
...@@ -14,7 +14,7 @@ description: | ...@@ -14,7 +14,7 @@ description: |
to supply ADC analog input switches. to supply ADC analog input switches.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
...@@ -23,7 +23,7 @@ properties: ...@@ -23,7 +23,7 @@ properties:
- st,stm32mp1-booster - st,stm32mp1-booster
st,syscfg: st,syscfg:
$ref: "/schemas/types.yaml#/definitions/phandle" $ref: /schemas/types.yaml#/definitions/phandle
description: phandle to system configuration controller. description: phandle to system configuration controller.
vdda-supply: vdda-supply:
......
...@@ -15,7 +15,7 @@ maintainers: ...@@ -15,7 +15,7 @@ maintainers:
- Fabrice Gasnier <fabrice.gasnier@foss.st.com> - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -26,7 +26,7 @@ patternProperties: ...@@ -26,7 +26,7 @@ patternProperties:
"^(reg11|reg18|usb33)$": "^(reg11|reg18|usb33)$":
type: object type: object
$ref: "regulator.yaml#" $ref: regulator.yaml#
required: required:
- compatible - compatible
......
...@@ -19,7 +19,7 @@ description: | ...@@ -19,7 +19,7 @@ description: |
https://www.ti.com/lit/gpn/tps62360 https://www.ti.com/lit/gpn/tps62360
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -15,7 +15,7 @@ description: | ...@@ -15,7 +15,7 @@ description: |
controller is also embedded. controller is also embedded.
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: regulator.yaml#
properties: properties:
compatible: compatible:
......
...@@ -21,19 +21,19 @@ properties: ...@@ -21,19 +21,19 @@ properties:
wlf,ldoena: wlf,ldoena:
description: description:
GPIO specifier for the GPIO controlling LDOENA. GPIO specifier for the GPIO controlling LDOENA.
$ref: "/schemas/types.yaml#/definitions/phandle-array" $ref: /schemas/types.yaml#/definitions/phandle-array
maxItems: 1 maxItems: 1
ldo1: ldo1:
description: description:
Initial data for the LDO1 regulator. Initial data for the LDO1 regulator.
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
micvdd: micvdd:
description: description:
Initial data for the MICVDD regulator. Initial data for the MICVDD regulator.
$ref: "regulator.yaml#" $ref: regulator.yaml#
type: object type: object
additionalProperties: true additionalProperties: true
...@@ -101,6 +101,7 @@ MODULE_DEVICE_TABLE(i2c, pg86x_i2c_id); ...@@ -101,6 +101,7 @@ MODULE_DEVICE_TABLE(i2c, pg86x_i2c_id);
static struct i2c_driver pg86x_regulator_driver = { static struct i2c_driver pg86x_regulator_driver = {
.driver = { .driver = {
.name = "88pg86x", .name = "88pg86x",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(pg86x_dt_ids), .of_match_table = of_match_ptr(pg86x_dt_ids),
}, },
.probe_new = pg86x_i2c_probe, .probe_new = pg86x_i2c_probe,
......
...@@ -274,6 +274,7 @@ static int pm800_regulator_probe(struct platform_device *pdev) ...@@ -274,6 +274,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
static struct platform_driver pm800_regulator_driver = { static struct platform_driver pm800_regulator_driver = {
.driver = { .driver = {
.name = "88pm80x-regulator", .name = "88pm80x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = pm800_regulator_probe, .probe = pm800_regulator_probe,
}; };
......
...@@ -383,6 +383,7 @@ MODULE_DEVICE_TABLE(platform, pm8607_regulator_driver_ids); ...@@ -383,6 +383,7 @@ MODULE_DEVICE_TABLE(platform, pm8607_regulator_driver_ids);
static struct platform_driver pm8607_regulator_driver = { static struct platform_driver pm8607_regulator_driver = {
.driver = { .driver = {
.name = "88pm860x-regulator", .name = "88pm860x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = pm8607_regulator_probe, .probe = pm8607_regulator_probe,
.id_table = pm8607_regulator_driver_ids, .id_table = pm8607_regulator_driver_ids,
......
...@@ -1082,6 +1082,16 @@ config REGULATOR_RT4801 ...@@ -1082,6 +1082,16 @@ config REGULATOR_RT4801
This adds support for voltage regulators in Richtek RT4801 Display Bias IC. This adds support for voltage regulators in Richtek RT4801 Display Bias IC.
The device supports two regulators (DSVP/DSVN). The device supports two regulators (DSVP/DSVN).
config REGULATOR_RT4803
tristate "Richtek RT4803 boost regualtor"
depends on I2C
select REGMAP_I2C
help
This adds support for RT4803 boost converter that integrates the
bypass switch. If the input voltage is low than the required voltage,
RT4803 will enter boost mode. Otherwise, enable internal bypass
switch to enter bypass mode.
config REGULATOR_RT4831 config REGULATOR_RT4831
tristate "Richtek RT4831 DSV Regulators" tristate "Richtek RT4831 DSV Regulators"
depends on MFD_RT4831 depends on MFD_RT4831
...@@ -1120,6 +1130,19 @@ config REGULATOR_RT5190A ...@@ -1120,6 +1130,19 @@ config REGULATOR_RT5190A
buck converters, 1 LDO, mute AC OFF depop function, with the general buck converters, 1 LDO, mute AC OFF depop function, with the general
I2C control interface. I2C control interface.
config REGULATOR_RT5739
tristate "Richtek RT5739 Regulator"
depends on I2C
select REGMAP_I2C
help
This adds support for voltage regulator in Richtek RT5739.
It's a step-down switching voltage regulator. Using a proprietary
architecture with synchronous rectification, it is capable of
delivering 3.5A continuously at over 80% efficiency.
This driver can also be built as a module. If so, the module
will be called rt5739.
config REGULATOR_RT5759 config REGULATOR_RT5759
tristate "Richtek RT5759 Regulator" tristate "Richtek RT5759 Regulator"
depends on I2C depends on I2C
......
...@@ -130,10 +130,12 @@ obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o ...@@ -130,10 +130,12 @@ obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o
obj-$(CONFIG_REGULATOR_RN5T618) += rn5t618-regulator.o obj-$(CONFIG_REGULATOR_RN5T618) += rn5t618-regulator.o
obj-$(CONFIG_REGULATOR_ROHM) += rohm-regulator.o obj-$(CONFIG_REGULATOR_ROHM) += rohm-regulator.o
obj-$(CONFIG_REGULATOR_RT4801) += rt4801-regulator.o obj-$(CONFIG_REGULATOR_RT4801) += rt4801-regulator.o
obj-$(CONFIG_REGULATOR_RT4803) += rt4803.o
obj-$(CONFIG_REGULATOR_RT4831) += rt4831-regulator.o obj-$(CONFIG_REGULATOR_RT4831) += rt4831-regulator.o
obj-$(CONFIG_REGULATOR_RT5033) += rt5033-regulator.o obj-$(CONFIG_REGULATOR_RT5033) += rt5033-regulator.o
obj-$(CONFIG_REGULATOR_RT5120) += rt5120-regulator.o obj-$(CONFIG_REGULATOR_RT5120) += rt5120-regulator.o
obj-$(CONFIG_REGULATOR_RT5190A) += rt5190a-regulator.o obj-$(CONFIG_REGULATOR_RT5190A) += rt5190a-regulator.o
obj-$(CONFIG_REGULATOR_RT5739) += rt5739.o
obj-$(CONFIG_REGULATOR_RT5759) += rt5759-regulator.o obj-$(CONFIG_REGULATOR_RT5759) += rt5759-regulator.o
obj-$(CONFIG_REGULATOR_RT6160) += rt6160-regulator.o obj-$(CONFIG_REGULATOR_RT6160) += rt6160-regulator.o
obj-$(CONFIG_REGULATOR_RT6190) += rt6190-regulator.o obj-$(CONFIG_REGULATOR_RT6190) += rt6190-regulator.o
......
...@@ -178,6 +178,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev) ...@@ -178,6 +178,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
static struct platform_driver aat2870_regulator_driver = { static struct platform_driver aat2870_regulator_driver = {
.driver = { .driver = {
.name = "aat2870-regulator", .name = "aat2870-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = aat2870_regulator_probe, .probe = aat2870_regulator_probe,
}; };
......
...@@ -446,6 +446,7 @@ static struct platform_driver ab8500_ext_regulator_driver = { ...@@ -446,6 +446,7 @@ static struct platform_driver ab8500_ext_regulator_driver = {
.probe = ab8500_ext_regulator_probe, .probe = ab8500_ext_regulator_probe,
.driver = { .driver = {
.name = "ab8500-ext-regulator", .name = "ab8500-ext-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -1737,6 +1737,7 @@ static struct platform_driver ab8500_regulator_driver = { ...@@ -1737,6 +1737,7 @@ static struct platform_driver ab8500_regulator_driver = {
.probe = ab8500_regulator_probe, .probe = ab8500_regulator_probe,
.driver = { .driver = {
.name = "ab8500-regulator", .name = "ab8500-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -789,6 +789,7 @@ MODULE_DEVICE_TABLE(i2c, act8865_ids); ...@@ -789,6 +789,7 @@ MODULE_DEVICE_TABLE(i2c, act8865_ids);
static struct i2c_driver act8865_pmic_driver = { static struct i2c_driver act8865_pmic_driver = {
.driver = { .driver = {
.name = "act8865", .name = "act8865",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = act8865_pmic_probe, .probe_new = act8865_pmic_probe,
.id_table = act8865_ids, .id_table = act8865_ids,
......
...@@ -348,6 +348,7 @@ static void act8945a_pmic_shutdown(struct platform_device *pdev) ...@@ -348,6 +348,7 @@ static void act8945a_pmic_shutdown(struct platform_device *pdev)
static struct platform_driver act8945a_pmic_driver = { static struct platform_driver act8945a_pmic_driver = {
.driver = { .driver = {
.name = "act8945a-regulator", .name = "act8945a-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.pm = &act8945a_pm, .pm = &act8945a_pm,
}, },
.probe = act8945a_pmic_probe, .probe = act8945a_pmic_probe,
......
...@@ -257,6 +257,7 @@ static struct i2c_driver ad5398_driver = { ...@@ -257,6 +257,7 @@ static struct i2c_driver ad5398_driver = {
.probe_new = ad5398_probe, .probe_new = ad5398_probe,
.driver = { .driver = {
.name = "ad5398", .name = "ad5398",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.id_table = ad5398_id, .id_table = ad5398_id,
}; };
......
...@@ -328,6 +328,7 @@ MODULE_DEVICE_TABLE(of, of_anatop_regulator_match_tbl); ...@@ -328,6 +328,7 @@ MODULE_DEVICE_TABLE(of, of_anatop_regulator_match_tbl);
static struct platform_driver anatop_regulator_driver = { static struct platform_driver anatop_regulator_driver = {
.driver = { .driver = {
.name = "anatop_regulator", .name = "anatop_regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_anatop_regulator_match_tbl, .of_match_table = of_anatop_regulator_match_tbl,
}, },
.probe = anatop_regulator_probe, .probe = anatop_regulator_probe,
......
...@@ -380,6 +380,7 @@ static struct platform_driver arizona_ldo1_driver = { ...@@ -380,6 +380,7 @@ static struct platform_driver arizona_ldo1_driver = {
.remove = arizona_ldo1_remove, .remove = arizona_ldo1_remove,
.driver = { .driver = {
.name = "arizona-ldo1", .name = "arizona-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
}, },
}; };
...@@ -388,6 +389,7 @@ static struct platform_driver madera_ldo1_driver = { ...@@ -388,6 +389,7 @@ static struct platform_driver madera_ldo1_driver = {
.remove = arizona_ldo1_remove, .remove = arizona_ldo1_remove,
.driver = { .driver = {
.name = "madera-ldo1", .name = "madera-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
}, },
}; };
......
...@@ -365,6 +365,7 @@ static struct platform_driver arizona_micsupp_driver = { ...@@ -365,6 +365,7 @@ static struct platform_driver arizona_micsupp_driver = {
.probe = arizona_micsupp_probe, .probe = arizona_micsupp_probe,
.driver = { .driver = {
.name = "arizona-micsupp", .name = "arizona-micsupp",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
}, },
}; };
...@@ -372,6 +373,7 @@ static struct platform_driver madera_micsupp_driver = { ...@@ -372,6 +373,7 @@ static struct platform_driver madera_micsupp_driver = {
.probe = madera_micsupp_probe, .probe = madera_micsupp_probe,
.driver = { .driver = {
.name = "madera-micsupp", .name = "madera-micsupp",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
}, },
}; };
......
...@@ -243,6 +243,7 @@ static int as3711_regulator_probe(struct platform_device *pdev) ...@@ -243,6 +243,7 @@ static int as3711_regulator_probe(struct platform_device *pdev)
static struct platform_driver as3711_regulator_driver = { static struct platform_driver as3711_regulator_driver = {
.driver = { .driver = {
.name = "as3711-regulator", .name = "as3711-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = as3711_regulator_probe, .probe = as3711_regulator_probe,
}; };
......
...@@ -831,6 +831,7 @@ MODULE_DEVICE_TABLE(of, of_as3722_regulator_match); ...@@ -831,6 +831,7 @@ MODULE_DEVICE_TABLE(of, of_as3722_regulator_match);
static struct platform_driver as3722_regulator_driver = { static struct platform_driver as3722_regulator_driver = {
.driver = { .driver = {
.name = "as3722-regulator", .name = "as3722-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_as3722_regulator_match, .of_match_table = of_as3722_regulator_match,
}, },
.probe = as3722_regulator_probe, .probe = as3722_regulator_probe,
......
...@@ -530,6 +530,7 @@ static struct platform_driver atc260x_regulator_driver = { ...@@ -530,6 +530,7 @@ static struct platform_driver atc260x_regulator_driver = {
.probe = atc260x_regulator_probe, .probe = atc260x_regulator_probe,
.driver = { .driver = {
.name = "atc260x-regulator", .name = "atc260x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -1364,6 +1364,7 @@ static struct platform_driver axp20x_regulator_driver = { ...@@ -1364,6 +1364,7 @@ static struct platform_driver axp20x_regulator_driver = {
.probe = axp20x_regulator_probe, .probe = axp20x_regulator_probe,
.driver = { .driver = {
.name = "axp20x-regulator", .name = "axp20x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -354,6 +354,7 @@ static int bcm590xx_probe(struct platform_device *pdev) ...@@ -354,6 +354,7 @@ static int bcm590xx_probe(struct platform_device *pdev)
static struct platform_driver bcm590xx_regulator_driver = { static struct platform_driver bcm590xx_regulator_driver = {
.driver = { .driver = {
.name = "bcm590xx-vregs", .name = "bcm590xx-vregs",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = bcm590xx_probe, .probe = bcm590xx_probe,
}; };
......
...@@ -201,10 +201,10 @@ static int buck12_set_hw_dvs_levels(struct device_node *np, ...@@ -201,10 +201,10 @@ static int buck12_set_hw_dvs_levels(struct device_node *np,
data = container_of(desc, struct bd71815_regulator, desc); data = container_of(desc, struct bd71815_regulator, desc);
if (of_find_property(np, "rohm,dvs-run-voltage", NULL) || if (of_property_present(np, "rohm,dvs-run-voltage") ||
of_find_property(np, "rohm,dvs-suspend-voltage", NULL) || of_property_present(np, "rohm,dvs-suspend-voltage") ||
of_find_property(np, "rohm,dvs-lpsr-voltage", NULL) || of_property_present(np, "rohm,dvs-lpsr-voltage") ||
of_find_property(np, "rohm,dvs-snvs-voltage", NULL)) { of_property_present(np, "rohm,dvs-snvs-voltage")) {
ret = regmap_read(cfg->regmap, desc->vsel_reg, &val); ret = regmap_read(cfg->regmap, desc->vsel_reg, &val);
if (ret) if (ret)
return ret; return ret;
...@@ -619,6 +619,7 @@ MODULE_DEVICE_TABLE(platform, bd7181x_pmic_id); ...@@ -619,6 +619,7 @@ MODULE_DEVICE_TABLE(platform, bd7181x_pmic_id);
static struct platform_driver bd7181x_regulator = { static struct platform_driver bd7181x_regulator = {
.driver = { .driver = {
.name = "bd7181x-pmic", .name = "bd7181x-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = bd7181x_probe, .probe = bd7181x_probe,
.id_table = bd7181x_pmic_id, .id_table = bd7181x_pmic_id,
......
...@@ -771,7 +771,8 @@ static int bd71828_probe(struct platform_device *pdev) ...@@ -771,7 +771,8 @@ static int bd71828_probe(struct platform_device *pdev)
static struct platform_driver bd71828_regulator = { static struct platform_driver bd71828_regulator = {
.driver = { .driver = {
.name = "bd71828-pmic" .name = "bd71828-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = bd71828_probe, .probe = bd71828_probe,
}; };
......
...@@ -1829,6 +1829,7 @@ MODULE_DEVICE_TABLE(platform, bd718x7_pmic_id); ...@@ -1829,6 +1829,7 @@ MODULE_DEVICE_TABLE(platform, bd718x7_pmic_id);
static struct platform_driver bd718xx_regulator = { static struct platform_driver bd718xx_regulator = {
.driver = { .driver = {
.name = "bd718xx-pmic", .name = "bd718xx-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = bd718xx_probe, .probe = bd718xx_probe,
.id_table = bd718x7_pmic_id, .id_table = bd718x7_pmic_id,
......
...@@ -353,6 +353,7 @@ MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table); ...@@ -353,6 +353,7 @@ MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);
static struct platform_driver bd9571mwv_regulator_driver = { static struct platform_driver bd9571mwv_regulator_driver = {
.driver = { .driver = {
.name = "bd9571mwv-regulator", .name = "bd9571mwv-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.pm = DEV_PM_OPS, .pm = DEV_PM_OPS,
}, },
.probe = bd9571mwv_regulator_probe, .probe = bd9571mwv_regulator_probe,
......
...@@ -1126,6 +1126,7 @@ MODULE_DEVICE_TABLE(platform, bd957x_pmic_id); ...@@ -1126,6 +1126,7 @@ MODULE_DEVICE_TABLE(platform, bd957x_pmic_id);
static struct platform_driver bd957x_regulator = { static struct platform_driver bd957x_regulator = {
.driver = { .driver = {
.name = "bd957x-pmic", .name = "bd957x-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = bd957x_probe, .probe = bd957x_probe,
.id_table = bd957x_pmic_id, .id_table = bd957x_pmic_id,
......
...@@ -207,6 +207,71 @@ static void regulator_unlock(struct regulator_dev *rdev) ...@@ -207,6 +207,71 @@ static void regulator_unlock(struct regulator_dev *rdev)
mutex_unlock(&regulator_nesting_mutex); mutex_unlock(&regulator_nesting_mutex);
} }
/**
* regulator_lock_two - lock two regulators
* @rdev1: first regulator
* @rdev2: second regulator
* @ww_ctx: w/w mutex acquire context
*
* Locks both rdevs using the regulator_ww_class.
*/
static void regulator_lock_two(struct regulator_dev *rdev1,
struct regulator_dev *rdev2,
struct ww_acquire_ctx *ww_ctx)
{
struct regulator_dev *held, *contended;
int ret;
ww_acquire_init(ww_ctx, &regulator_ww_class);
/* Try to just grab both of them */
ret = regulator_lock_nested(rdev1, ww_ctx);
WARN_ON(ret);
ret = regulator_lock_nested(rdev2, ww_ctx);
if (ret != -EDEADLOCK) {
WARN_ON(ret);
goto exit;
}
held = rdev1;
contended = rdev2;
while (true) {
regulator_unlock(held);
ww_mutex_lock_slow(&contended->mutex, ww_ctx);
contended->ref_cnt++;
contended->mutex_owner = current;
swap(held, contended);
ret = regulator_lock_nested(contended, ww_ctx);
if (ret != -EDEADLOCK) {
WARN_ON(ret);
break;
}
}
exit:
ww_acquire_done(ww_ctx);
}
/**
* regulator_unlock_two - unlock two regulators
* @rdev1: first regulator
* @rdev2: second regulator
* @ww_ctx: w/w mutex acquire context
*
* The inverse of regulator_lock_two().
*/
static void regulator_unlock_two(struct regulator_dev *rdev1,
struct regulator_dev *rdev2,
struct ww_acquire_ctx *ww_ctx)
{
regulator_unlock(rdev2);
regulator_unlock(rdev1);
ww_acquire_fini(ww_ctx);
}
static bool regulator_supply_is_couple(struct regulator_dev *rdev) static bool regulator_supply_is_couple(struct regulator_dev *rdev)
{ {
struct regulator_dev *c_rdev; struct regulator_dev *c_rdev;
...@@ -334,6 +399,7 @@ static void regulator_lock_dependent(struct regulator_dev *rdev, ...@@ -334,6 +399,7 @@ static void regulator_lock_dependent(struct regulator_dev *rdev,
ww_mutex_lock_slow(&new_contended_rdev->mutex, ww_ctx); ww_mutex_lock_slow(&new_contended_rdev->mutex, ww_ctx);
old_contended_rdev = new_contended_rdev; old_contended_rdev = new_contended_rdev;
old_contended_rdev->ref_cnt++; old_contended_rdev->ref_cnt++;
old_contended_rdev->mutex_owner = current;
} }
err = regulator_lock_recursive(rdev, err = regulator_lock_recursive(rdev,
...@@ -1583,9 +1649,6 @@ static int set_machine_constraints(struct regulator_dev *rdev) ...@@ -1583,9 +1649,6 @@ static int set_machine_constraints(struct regulator_dev *rdev)
rdev->constraints->always_on = true; rdev->constraints->always_on = true;
} }
if (rdev->desc->off_on_delay)
rdev->last_off = ktime_get_boottime();
/* If the constraints say the regulator should be on at this point /* If the constraints say the regulator should be on at this point
* and we have control then make sure it is enabled. * and we have control then make sure it is enabled.
*/ */
...@@ -1619,6 +1682,8 @@ static int set_machine_constraints(struct regulator_dev *rdev) ...@@ -1619,6 +1682,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)
if (rdev->constraints->always_on) if (rdev->constraints->always_on)
rdev->use_count++; rdev->use_count++;
} else if (rdev->desc->off_on_delay) {
rdev->last_off = ktime_get();
} }
print_constraints(rdev); print_constraints(rdev);
...@@ -1627,8 +1692,8 @@ static int set_machine_constraints(struct regulator_dev *rdev) ...@@ -1627,8 +1692,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)
/** /**
* set_supply - set regulator supply regulator * set_supply - set regulator supply regulator
* @rdev: regulator name * @rdev: regulator (locked)
* @supply_rdev: supply regulator name * @supply_rdev: supply regulator (locked))
* *
* Called by platform initialisation code to set the supply regulator for this * Called by platform initialisation code to set the supply regulator for this
* regulator. This ensures that a regulators supply will also be enabled by the * regulator. This ensures that a regulators supply will also be enabled by the
...@@ -1800,6 +1865,8 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, ...@@ -1800,6 +1865,8 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
struct regulator *regulator; struct regulator *regulator;
int err = 0; int err = 0;
lockdep_assert_held_once(&rdev->mutex.base);
if (dev) { if (dev) {
char buf[REG_STR_SIZE]; char buf[REG_STR_SIZE];
int size; int size;
...@@ -1827,9 +1894,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, ...@@ -1827,9 +1894,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
regulator->rdev = rdev; regulator->rdev = rdev;
regulator->supply_name = supply_name; regulator->supply_name = supply_name;
regulator_lock(rdev);
list_add(&regulator->list, &rdev->consumer_list); list_add(&regulator->list, &rdev->consumer_list);
regulator_unlock(rdev);
if (dev) { if (dev) {
regulator->dev = dev; regulator->dev = dev;
...@@ -1995,6 +2060,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) ...@@ -1995,6 +2060,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
{ {
struct regulator_dev *r; struct regulator_dev *r;
struct device *dev = rdev->dev.parent; struct device *dev = rdev->dev.parent;
struct ww_acquire_ctx ww_ctx;
int ret = 0; int ret = 0;
/* No supply to resolve? */ /* No supply to resolve? */
...@@ -2061,23 +2127,23 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) ...@@ -2061,23 +2127,23 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
* between rdev->supply null check and setting rdev->supply in * between rdev->supply null check and setting rdev->supply in
* set_supply() from concurrent tasks. * set_supply() from concurrent tasks.
*/ */
regulator_lock(rdev); regulator_lock_two(rdev, r, &ww_ctx);
/* Supply just resolved by a concurrent task? */ /* Supply just resolved by a concurrent task? */
if (rdev->supply) { if (rdev->supply) {
regulator_unlock(rdev); regulator_unlock_two(rdev, r, &ww_ctx);
put_device(&r->dev); put_device(&r->dev);
goto out; goto out;
} }
ret = set_supply(rdev, r); ret = set_supply(rdev, r);
if (ret < 0) { if (ret < 0) {
regulator_unlock(rdev); regulator_unlock_two(rdev, r, &ww_ctx);
put_device(&r->dev); put_device(&r->dev);
goto out; goto out;
} }
regulator_unlock(rdev); regulator_unlock_two(rdev, r, &ww_ctx);
/* /*
* In set_machine_constraints() we may have turned this regulator on * In set_machine_constraints() we may have turned this regulator on
...@@ -2190,7 +2256,9 @@ struct regulator *_regulator_get(struct device *dev, const char *id, ...@@ -2190,7 +2256,9 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
return regulator; return regulator;
} }
regulator_lock(rdev);
regulator = create_regulator(rdev, dev, id); regulator = create_regulator(rdev, dev, id);
regulator_unlock(rdev);
if (regulator == NULL) { if (regulator == NULL) {
regulator = ERR_PTR(-ENOMEM); regulator = ERR_PTR(-ENOMEM);
module_put(rdev->owner); module_put(rdev->owner);
...@@ -2668,7 +2736,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev) ...@@ -2668,7 +2736,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
trace_regulator_enable(rdev_get_name(rdev)); trace_regulator_enable(rdev_get_name(rdev));
if (rdev->desc->off_on_delay && rdev->last_off) { if (rdev->desc->off_on_delay) {
/* if needed, keep a distance of off_on_delay from last time /* if needed, keep a distance of off_on_delay from last time
* this regulator was disabled. * this regulator was disabled.
*/ */
...@@ -6049,6 +6117,7 @@ static void regulator_summary_lock(struct ww_acquire_ctx *ww_ctx) ...@@ -6049,6 +6117,7 @@ static void regulator_summary_lock(struct ww_acquire_ctx *ww_ctx)
ww_mutex_lock_slow(&new_contended_rdev->mutex, ww_ctx); ww_mutex_lock_slow(&new_contended_rdev->mutex, ww_ctx);
old_contended_rdev = new_contended_rdev; old_contended_rdev = new_contended_rdev;
old_contended_rdev->ref_cnt++; old_contended_rdev->ref_cnt++;
old_contended_rdev->mutex_owner = current;
} }
err = regulator_summary_lock_all(ww_ctx, err = regulator_summary_lock_all(ww_ctx,
......
...@@ -553,6 +553,7 @@ static struct platform_driver cpcap_regulator_driver = { ...@@ -553,6 +553,7 @@ static struct platform_driver cpcap_regulator_driver = {
.probe = cpcap_regulator_probe, .probe = cpcap_regulator_probe,
.driver = { .driver = {
.name = "cpcap-regulator", .name = "cpcap-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(cpcap_regulator_id_table), .of_match_table = of_match_ptr(cpcap_regulator_id_table),
}, },
}; };
......
...@@ -215,6 +215,7 @@ static struct platform_driver cros_ec_regulator_driver = { ...@@ -215,6 +215,7 @@ static struct platform_driver cros_ec_regulator_driver = {
.probe = cros_ec_regulator_probe, .probe = cros_ec_regulator_probe,
.driver = { .driver = {
.name = "cros-ec-regulator", .name = "cros-ec-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = regulator_cros_ec_of_match, .of_match_table = regulator_cros_ec_of_match,
}, },
}; };
......
...@@ -471,6 +471,7 @@ static int da903x_regulator_probe(struct platform_device *pdev) ...@@ -471,6 +471,7 @@ static int da903x_regulator_probe(struct platform_device *pdev)
static struct platform_driver da903x_regulator_driver = { static struct platform_driver da903x_regulator_driver = {
.driver = { .driver = {
.name = "da903x-regulator", .name = "da903x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = da903x_regulator_probe, .probe = da903x_regulator_probe,
}; };
......
...@@ -438,6 +438,7 @@ static struct platform_driver da9052_regulator_driver = { ...@@ -438,6 +438,7 @@ static struct platform_driver da9052_regulator_driver = {
.probe = da9052_regulator_probe, .probe = da9052_regulator_probe,
.driver = { .driver = {
.name = "da9052-regulator", .name = "da9052-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -576,6 +576,7 @@ static struct platform_driver da9055_regulator_driver = { ...@@ -576,6 +576,7 @@ static struct platform_driver da9055_regulator_driver = {
.probe = da9055_regulator_probe, .probe = da9055_regulator_probe,
.driver = { .driver = {
.name = "da9055-regulator", .name = "da9055-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -1033,6 +1033,7 @@ static int da9062_regulator_probe(struct platform_device *pdev) ...@@ -1033,6 +1033,7 @@ static int da9062_regulator_probe(struct platform_device *pdev)
static struct platform_driver da9062_regulator_driver = { static struct platform_driver da9062_regulator_driver = {
.driver = { .driver = {
.name = "da9062-regulators", .name = "da9062-regulators",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = da9062_regulator_probe, .probe = da9062_regulator_probe,
}; };
......
...@@ -83,6 +83,9 @@ struct da9063_regulator_info { ...@@ -83,6 +83,9 @@ struct da9063_regulator_info {
/* DA9063 event detection bit */ /* DA9063 event detection bit */
struct reg_field oc_event; struct reg_field oc_event;
/* DA9063 voltage monitor bit */
struct reg_field vmon;
}; };
/* Macros for LDO */ /* Macros for LDO */
...@@ -148,6 +151,7 @@ struct da9063_regulator { ...@@ -148,6 +151,7 @@ struct da9063_regulator {
struct regmap_field *suspend; struct regmap_field *suspend;
struct regmap_field *sleep; struct regmap_field *sleep;
struct regmap_field *suspend_sleep; struct regmap_field *suspend_sleep;
struct regmap_field *vmon;
}; };
/* Encapsulates all information for the regulators driver */ /* Encapsulates all information for the regulators driver */
...@@ -203,6 +207,24 @@ static const unsigned int da9063_bmem_bio_merged_limits[] = { ...@@ -203,6 +207,24 @@ static const unsigned int da9063_bmem_bio_merged_limits[] = {
4600000, 4800000, 5000000, 5200000, 5400000, 5600000, 5800000, 6000000 4600000, 4800000, 5000000, 5200000, 5400000, 5600000, 5800000, 6000000
}; };
static int da9063_set_xvp(struct regulator_dev *rdev, int lim_uV, int severity, bool enable)
{
struct da9063_regulator *regl = rdev_get_drvdata(rdev);
struct device *dev = regl->hw->dev;
dev_dbg(dev, "%s: lim: %d, sev: %d, en: %d\n", regl->desc.name, lim_uV, severity, enable);
/*
* only support enable and disable.
* the da9063 offers a GPIO (GP_FB2) which is unasserted if an XV happens.
* therefore ignore severity here, as there might be handlers in hardware.
*/
if (lim_uV)
return -EINVAL;
return regmap_field_write(regl->vmon, enable ? 1 : 0);
}
static int da9063_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) static int da9063_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
{ {
struct da9063_regulator *regl = rdev_get_drvdata(rdev); struct da9063_regulator *regl = rdev_get_drvdata(rdev);
...@@ -556,6 +578,8 @@ static const struct regulator_ops da9063_buck_ops = { ...@@ -556,6 +578,8 @@ static const struct regulator_ops da9063_buck_ops = {
.set_suspend_enable = da9063_suspend_enable, .set_suspend_enable = da9063_suspend_enable,
.set_suspend_disable = da9063_suspend_disable, .set_suspend_disable = da9063_suspend_disable,
.set_suspend_mode = da9063_buck_set_suspend_mode, .set_suspend_mode = da9063_buck_set_suspend_mode,
.set_over_voltage_protection = da9063_set_xvp,
.set_under_voltage_protection = da9063_set_xvp,
}; };
static const struct regulator_ops da9063_ldo_ops = { static const struct regulator_ops da9063_ldo_ops = {
...@@ -572,6 +596,8 @@ static const struct regulator_ops da9063_ldo_ops = { ...@@ -572,6 +596,8 @@ static const struct regulator_ops da9063_ldo_ops = {
.set_suspend_enable = da9063_suspend_enable, .set_suspend_enable = da9063_suspend_enable,
.set_suspend_disable = da9063_suspend_disable, .set_suspend_disable = da9063_suspend_disable,
.set_suspend_mode = da9063_ldo_set_suspend_mode, .set_suspend_mode = da9063_ldo_set_suspend_mode,
.set_over_voltage_protection = da9063_set_xvp,
.set_under_voltage_protection = da9063_set_xvp,
}; };
/* Info of regulators for DA9063 */ /* Info of regulators for DA9063 */
...@@ -581,36 +607,42 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { ...@@ -581,36 +607,42 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
da9063_buck_a_limits, da9063_buck_a_limits,
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK), DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BCORE1), DA9063_BUCK_COMMON_FIELDS(BCORE1),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BCORE1_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BCORE2, 300, 10, 1570, DA9063_BUCK(DA9063, BCORE2, 300, 10, 1570,
da9063_buck_a_limits, da9063_buck_a_limits,
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE2_ILIM_MASK), DA9063_REG_BUCK_ILIM_C, DA9063_BCORE2_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BCORE2), DA9063_BUCK_COMMON_FIELDS(BCORE2),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BCORE2_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BPRO, 530, 10, 1800, DA9063_BUCK(DA9063, BPRO, 530, 10, 1800,
da9063_buck_a_limits, da9063_buck_a_limits,
DA9063_REG_BUCK_ILIM_B, DA9063_BPRO_ILIM_MASK), DA9063_REG_BUCK_ILIM_B, DA9063_BPRO_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BPRO), DA9063_BUCK_COMMON_FIELDS(BPRO),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BPRO_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BMEM, 800, 20, 3340, DA9063_BUCK(DA9063, BMEM, 800, 20, 3340,
da9063_buck_b_limits, da9063_buck_b_limits,
DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK), DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BMEM), DA9063_BUCK_COMMON_FIELDS(BMEM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BMEM_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BIO, 800, 20, 3340, DA9063_BUCK(DA9063, BIO, 800, 20, 3340,
da9063_buck_b_limits, da9063_buck_b_limits,
DA9063_REG_BUCK_ILIM_A, DA9063_BIO_ILIM_MASK), DA9063_REG_BUCK_ILIM_A, DA9063_BIO_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BIO), DA9063_BUCK_COMMON_FIELDS(BIO),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BIO_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BPERI, 800, 20, 3340, DA9063_BUCK(DA9063, BPERI, 800, 20, 3340,
da9063_buck_b_limits, da9063_buck_b_limits,
DA9063_REG_BUCK_ILIM_B, DA9063_BPERI_ILIM_MASK), DA9063_REG_BUCK_ILIM_B, DA9063_BPERI_ILIM_MASK),
DA9063_BUCK_COMMON_FIELDS(BPERI), DA9063_BUCK_COMMON_FIELDS(BPERI),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BPERI_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BCORES_MERGED, 300, 10, 1570, DA9063_BUCK(DA9063, BCORES_MERGED, 300, 10, 1570,
...@@ -618,6 +650,7 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { ...@@ -618,6 +650,7 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK), DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK),
/* BCORES_MERGED uses the same register fields as BCORE1 */ /* BCORES_MERGED uses the same register fields as BCORE1 */
DA9063_BUCK_COMMON_FIELDS(BCORE1), DA9063_BUCK_COMMON_FIELDS(BCORE1),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BCORE1_MON_EN),
}, },
{ {
DA9063_BUCK(DA9063, BMEM_BIO_MERGED, 800, 20, 3340, DA9063_BUCK(DA9063, BMEM_BIO_MERGED, 800, 20, 3340,
...@@ -625,47 +658,59 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { ...@@ -625,47 +658,59 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK), DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK),
/* BMEM_BIO_MERGED uses the same register fields as BMEM */ /* BMEM_BIO_MERGED uses the same register fields as BMEM */
DA9063_BUCK_COMMON_FIELDS(BMEM), DA9063_BUCK_COMMON_FIELDS(BMEM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_4, DA9063_BMEM_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO3, 900, 20, 3440), DA9063_LDO(DA9063, LDO3, 900, 20, 3440),
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO3_LIM), .oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO3_LIM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO3_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO7, 900, 50, 3600), DA9063_LDO(DA9063, LDO7, 900, 50, 3600),
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO7_LIM), .oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO7_LIM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO7_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO8, 900, 50, 3600), DA9063_LDO(DA9063, LDO8, 900, 50, 3600),
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO8_LIM), .oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO8_LIM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO8_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO9, 950, 50, 3600), DA9063_LDO(DA9063, LDO9, 950, 50, 3600),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_3, DA9063_LDO9_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO11, 900, 50, 3600), DA9063_LDO(DA9063, LDO11, 900, 50, 3600),
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO11_LIM), .oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO11_LIM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_3, DA9063_LDO11_MON_EN),
}, },
/* The following LDOs are present only on DA9063, not on DA9063L */ /* The following LDOs are present only on DA9063, not on DA9063L */
{ {
DA9063_LDO(DA9063, LDO1, 600, 20, 1860), DA9063_LDO(DA9063, LDO1, 600, 20, 1860),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO1_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO2, 600, 20, 1860), DA9063_LDO(DA9063, LDO2, 600, 20, 1860),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO2_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO4, 900, 20, 3440), DA9063_LDO(DA9063, LDO4, 900, 20, 3440),
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO4_LIM), .oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO4_LIM),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO4_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO5, 900, 50, 3600), DA9063_LDO(DA9063, LDO5, 900, 50, 3600),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO5_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO6, 900, 50, 3600), DA9063_LDO(DA9063, LDO6, 900, 50, 3600),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_2, DA9063_LDO6_MON_EN),
}, },
{ {
DA9063_LDO(DA9063, LDO10, 900, 50, 3600), DA9063_LDO(DA9063, LDO10, 900, 50, 3600),
.vmon = BFIELD(DA9063_BB_REG_MON_REG_3, DA9063_LDO10_MON_EN),
}, },
}; };
...@@ -726,6 +771,41 @@ static const struct regulator_init_data *da9063_get_regulator_initdata( ...@@ -726,6 +771,41 @@ static const struct regulator_init_data *da9063_get_regulator_initdata(
return NULL; return NULL;
} }
static int da9063_check_xvp_constraints(struct regulator_config *config)
{
struct da9063_regulator *regl = config->driver_data;
const struct regulation_constraints *constr = &config->init_data->constraints;
const struct notification_limit *uv_l = &constr->under_voltage_limits;
const struct notification_limit *ov_l = &constr->over_voltage_limits;
/* make sure that only one severity is used to clarify if unchanged, enabled or disabled */
if ((!!uv_l->prot + !!uv_l->err + !!uv_l->warn) > 1) {
dev_err(config->dev, "%s: at most one voltage monitoring severity allowed!\n",
regl->desc.name);
return -EINVAL;
}
/* make sure that UV and OV monitoring is set to the same severity and value */
if (uv_l->prot != ov_l->prot) {
dev_err(config->dev,
"%s: protection-microvolt: value must be equal for uv and ov!\n",
regl->desc.name);
return -EINVAL;
}
if (uv_l->err != ov_l->err) {
dev_err(config->dev, "%s: error-microvolt: value must be equal for uv and ov!\n",
regl->desc.name);
return -EINVAL;
}
if (uv_l->warn != ov_l->warn) {
dev_err(config->dev, "%s: warn-microvolt: value must be equal for uv and ov!\n",
regl->desc.name);
return -EINVAL;
}
return 0;
}
static struct of_regulator_match da9063_matches[] = { static struct of_regulator_match da9063_matches[] = {
[DA9063_ID_BCORE1] = { .name = "bcore1" }, [DA9063_ID_BCORE1] = { .name = "bcore1" },
[DA9063_ID_BCORE2] = { .name = "bcore2" }, [DA9063_ID_BCORE2] = { .name = "bcore2" },
...@@ -932,6 +1012,12 @@ static int da9063_regulator_probe(struct platform_device *pdev) ...@@ -932,6 +1012,12 @@ static int da9063_regulator_probe(struct platform_device *pdev)
if (IS_ERR(regl->suspend_sleep)) if (IS_ERR(regl->suspend_sleep))
return PTR_ERR(regl->suspend_sleep); return PTR_ERR(regl->suspend_sleep);
} }
if (regl->info->vmon.reg) {
regl->vmon = devm_regmap_field_alloc(&pdev->dev,
da9063->regmap, regl->info->vmon);
if (IS_ERR(regl->vmon))
return PTR_ERR(regl->vmon);
}
/* Register regulator */ /* Register regulator */
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
...@@ -941,6 +1027,11 @@ static int da9063_regulator_probe(struct platform_device *pdev) ...@@ -941,6 +1027,11 @@ static int da9063_regulator_probe(struct platform_device *pdev)
if (da9063_reg_matches) if (da9063_reg_matches)
config.of_node = da9063_reg_matches[id].of_node; config.of_node = da9063_reg_matches[id].of_node;
config.regmap = da9063->regmap; config.regmap = da9063->regmap;
ret = da9063_check_xvp_constraints(&config);
if (ret)
return ret;
regl->rdev = devm_regulator_register(&pdev->dev, &regl->desc, regl->rdev = devm_regulator_register(&pdev->dev, &regl->desc,
&config); &config);
if (IS_ERR(regl->rdev)) { if (IS_ERR(regl->rdev)) {
...@@ -971,6 +1062,7 @@ static int da9063_regulator_probe(struct platform_device *pdev) ...@@ -971,6 +1062,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
static struct platform_driver da9063_regulator_driver = { static struct platform_driver da9063_regulator_driver = {
.driver = { .driver = {
.name = DA9063_DRVNAME_REGULATORS, .name = DA9063_DRVNAME_REGULATORS,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = da9063_regulator_probe, .probe = da9063_regulator_probe,
}; };
......
...@@ -1194,6 +1194,7 @@ MODULE_DEVICE_TABLE(i2c, da9121_i2c_id); ...@@ -1194,6 +1194,7 @@ MODULE_DEVICE_TABLE(i2c, da9121_i2c_id);
static struct i2c_driver da9121_regulator_driver = { static struct i2c_driver da9121_regulator_driver = {
.driver = { .driver = {
.name = "da9121", .name = "da9121",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9121_dt_ids), .of_match_table = of_match_ptr(da9121_dt_ids),
}, },
.probe_new = da9121_i2c_probe, .probe_new = da9121_i2c_probe,
......
...@@ -221,6 +221,7 @@ MODULE_DEVICE_TABLE(i2c, da9210_i2c_id); ...@@ -221,6 +221,7 @@ MODULE_DEVICE_TABLE(i2c, da9210_i2c_id);
static struct i2c_driver da9210_regulator_driver = { static struct i2c_driver da9210_regulator_driver = {
.driver = { .driver = {
.name = "da9210", .name = "da9210",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9210_dt_ids), .of_match_table = of_match_ptr(da9210_dt_ids),
}, },
.probe_new = da9210_i2c_probe, .probe_new = da9210_i2c_probe,
......
...@@ -552,6 +552,7 @@ MODULE_DEVICE_TABLE(of, da9211_dt_ids); ...@@ -552,6 +552,7 @@ MODULE_DEVICE_TABLE(of, da9211_dt_ids);
static struct i2c_driver da9211_regulator_driver = { static struct i2c_driver da9211_regulator_driver = {
.driver = { .driver = {
.name = "da9211", .name = "da9211",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9211_dt_ids), .of_match_table = of_match_ptr(da9211_dt_ids),
}, },
.probe_new = da9211_i2c_probe, .probe_new = da9211_i2c_probe,
......
...@@ -479,6 +479,7 @@ static int db8500_regulator_remove(struct platform_device *pdev) ...@@ -479,6 +479,7 @@ static int db8500_regulator_remove(struct platform_device *pdev)
static struct platform_driver db8500_regulator_driver = { static struct platform_driver db8500_regulator_driver = {
.driver = { .driver = {
.name = "db8500-prcmu-regulators", .name = "db8500-prcmu-regulators",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = db8500_regulator_probe, .probe = db8500_regulator_probe,
.remove = db8500_regulator_remove, .remove = db8500_regulator_remove,
......
...@@ -60,6 +60,7 @@ static struct platform_driver dummy_regulator_driver = { ...@@ -60,6 +60,7 @@ static struct platform_driver dummy_regulator_driver = {
.probe = dummy_regulator_probe, .probe = dummy_regulator_probe,
.driver = { .driver = {
.name = "reg-dummy", .name = "reg-dummy",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
This diff is collapsed.
...@@ -172,6 +172,7 @@ MODULE_DEVICE_TABLE(i2c, fan53880_i2c_id); ...@@ -172,6 +172,7 @@ MODULE_DEVICE_TABLE(i2c, fan53880_i2c_id);
static struct i2c_driver fan53880_regulator_driver = { static struct i2c_driver fan53880_regulator_driver = {
.driver = { .driver = {
.name = "fan53880", .name = "fan53880",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = fan53880_dt_ids, .of_match_table = fan53880_dt_ids,
}, },
.probe_new = fan53880_i2c_probe, .probe_new = fan53880_i2c_probe,
......
...@@ -151,7 +151,7 @@ of_get_fixed_voltage_config(struct device *dev, ...@@ -151,7 +151,7 @@ of_get_fixed_voltage_config(struct device *dev,
of_property_read_u32(np, "startup-delay-us", &config->startup_delay); of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
of_property_read_u32(np, "off-on-delay-us", &config->off_on_delay); of_property_read_u32(np, "off-on-delay-us", &config->off_on_delay);
if (of_find_property(np, "vin-supply", NULL)) if (of_property_present(np, "vin-supply"))
config->input_supply = "vin"; config->input_supply = "vin";
return config; return config;
...@@ -334,6 +334,7 @@ static struct platform_driver regulator_fixed_voltage_driver = { ...@@ -334,6 +334,7 @@ static struct platform_driver regulator_fixed_voltage_driver = {
.probe = reg_fixed_voltage_probe, .probe = reg_fixed_voltage_probe,
.driver = { .driver = {
.name = "reg-fixed-voltage", .name = "reg-fixed-voltage",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(fixed_of_match), .of_match_table = of_match_ptr(fixed_of_match),
}, },
}; };
......
...@@ -220,7 +220,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np, ...@@ -220,7 +220,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
regtype); regtype);
} }
if (of_find_property(np, "vin-supply", NULL)) if (of_property_present(np, "vin-supply"))
config->input_supply = "vin"; config->input_supply = "vin";
return config; return config;
...@@ -368,6 +368,7 @@ static struct platform_driver gpio_regulator_driver = { ...@@ -368,6 +368,7 @@ static struct platform_driver gpio_regulator_driver = {
.probe = gpio_regulator_probe, .probe = gpio_regulator_probe,
.driver = { .driver = {
.name = "gpio-regulator", .name = "gpio-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(regulator_gpio_of_match), .of_match_table = of_match_ptr(regulator_gpio_of_match),
}, },
}; };
......
...@@ -579,6 +579,7 @@ static struct platform_driver hi6421_regulator_driver = { ...@@ -579,6 +579,7 @@ static struct platform_driver hi6421_regulator_driver = {
.id_table = hi6421_regulator_table, .id_table = hi6421_regulator_table,
.driver = { .driver = {
.name = "hi6421-regulator", .name = "hi6421-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = hi6421_regulator_probe, .probe = hi6421_regulator_probe,
}; };
......
...@@ -200,6 +200,7 @@ static struct platform_driver hi6421v530_regulator_driver = { ...@@ -200,6 +200,7 @@ static struct platform_driver hi6421v530_regulator_driver = {
.id_table = hi6421v530_regulator_table, .id_table = hi6421v530_regulator_table,
.driver = { .driver = {
.name = "hi6421v530-regulator", .name = "hi6421v530-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = hi6421v530_regulator_probe, .probe = hi6421v530_regulator_probe,
}; };
......
...@@ -284,6 +284,7 @@ static struct platform_driver hi6421_spmi_regulator_driver = { ...@@ -284,6 +284,7 @@ static struct platform_driver hi6421_spmi_regulator_driver = {
.id_table = hi6421_spmi_regulator_table, .id_table = hi6421_spmi_regulator_table,
.driver = { .driver = {
.name = "hi6421v600-regulator", .name = "hi6421v600-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = hi6421_spmi_regulator_probe, .probe = hi6421_spmi_regulator_probe,
}; };
......
...@@ -206,6 +206,7 @@ static struct platform_driver hi655x_regulator_driver = { ...@@ -206,6 +206,7 @@ static struct platform_driver hi655x_regulator_driver = {
.id_table = hi655x_regulator_table, .id_table = hi655x_regulator_table,
.driver = { .driver = {
.name = "hi655x-regulator", .name = "hi655x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = hi655x_regulator_probe, .probe = hi655x_regulator_probe,
}; };
......
...@@ -147,6 +147,7 @@ MODULE_DEVICE_TABLE(i2c, isl6271a_id); ...@@ -147,6 +147,7 @@ MODULE_DEVICE_TABLE(i2c, isl6271a_id);
static struct i2c_driver isl6271a_i2c_driver = { static struct i2c_driver isl6271a_i2c_driver = {
.driver = { .driver = {
.name = "isl6271a", .name = "isl6271a",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = isl6271a_probe, .probe_new = isl6271a_probe,
.id_table = isl6271a_id, .id_table = isl6271a_id,
......
...@@ -195,6 +195,7 @@ MODULE_DEVICE_TABLE(i2c, isl9305_i2c_id); ...@@ -195,6 +195,7 @@ MODULE_DEVICE_TABLE(i2c, isl9305_i2c_id);
static struct i2c_driver isl9305_regulator_driver = { static struct i2c_driver isl9305_regulator_driver = {
.driver = { .driver = {
.name = "isl9305", .name = "isl9305",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(isl9305_dt_ids), .of_match_table = of_match_ptr(isl9305_dt_ids),
}, },
.probe_new = isl9305_i2c_probe, .probe_new = isl9305_i2c_probe,
......
...@@ -355,6 +355,7 @@ static struct platform_driver lm363x_regulator_driver = { ...@@ -355,6 +355,7 @@ static struct platform_driver lm363x_regulator_driver = {
.probe = lm363x_regulator_probe, .probe = lm363x_regulator_probe,
.driver = { .driver = {
.name = "lm363x-regulator", .name = "lm363x-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -272,6 +272,7 @@ static int lochnagar_regulator_probe(struct platform_device *pdev) ...@@ -272,6 +272,7 @@ static int lochnagar_regulator_probe(struct platform_device *pdev)
static struct platform_driver lochnagar_regulator_driver = { static struct platform_driver lochnagar_regulator_driver = {
.driver = { .driver = {
.name = "lochnagar-regulator", .name = "lochnagar-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(lochnagar_of_match), .of_match_table = of_match_ptr(lochnagar_of_match),
}, },
......
...@@ -447,6 +447,7 @@ MODULE_DEVICE_TABLE(i2c, lp3971_i2c_id); ...@@ -447,6 +447,7 @@ MODULE_DEVICE_TABLE(i2c, lp3971_i2c_id);
static struct i2c_driver lp3971_i2c_driver = { static struct i2c_driver lp3971_i2c_driver = {
.driver = { .driver = {
.name = "LP3971", .name = "LP3971",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp3971_i2c_probe, .probe_new = lp3971_i2c_probe,
.id_table = lp3971_i2c_id, .id_table = lp3971_i2c_id,
......
...@@ -545,6 +545,7 @@ MODULE_DEVICE_TABLE(i2c, lp3972_i2c_id); ...@@ -545,6 +545,7 @@ MODULE_DEVICE_TABLE(i2c, lp3972_i2c_id);
static struct i2c_driver lp3972_i2c_driver = { static struct i2c_driver lp3972_i2c_driver = {
.driver = { .driver = {
.name = "lp3972", .name = "lp3972",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp3972_i2c_probe, .probe_new = lp3972_i2c_probe,
.id_table = lp3972_i2c_id, .id_table = lp3972_i2c_id,
......
...@@ -832,8 +832,7 @@ static struct lp872x_platform_data ...@@ -832,8 +832,7 @@ static struct lp872x_platform_data
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
of_property_read_u8(np, "ti,general-config", &pdata->general_config); of_property_read_u8(np, "ti,general-config", &pdata->general_config);
if (of_find_property(np, "ti,update-config", NULL)) pdata->update_config = of_property_read_bool(np, "ti,update-config");
pdata->update_config = true;
pdata->dvs = devm_kzalloc(dev, sizeof(struct lp872x_dvs), GFP_KERNEL); pdata->dvs = devm_kzalloc(dev, sizeof(struct lp872x_dvs), GFP_KERNEL);
if (!pdata->dvs) if (!pdata->dvs)
...@@ -928,7 +927,7 @@ static int lp872x_probe(struct i2c_client *cl) ...@@ -928,7 +927,7 @@ static int lp872x_probe(struct i2c_client *cl)
return lp872x_regulator_register(lp); return lp872x_regulator_register(lp);
} }
static const struct of_device_id lp872x_dt_ids[] = { static const struct of_device_id lp872x_dt_ids[] __maybe_unused = {
{ .compatible = "ti,lp8720", }, { .compatible = "ti,lp8720", },
{ .compatible = "ti,lp8725", }, { .compatible = "ti,lp8725", },
{ } { }
...@@ -945,6 +944,7 @@ MODULE_DEVICE_TABLE(i2c, lp872x_ids); ...@@ -945,6 +944,7 @@ MODULE_DEVICE_TABLE(i2c, lp872x_ids);
static struct i2c_driver lp872x_driver = { static struct i2c_driver lp872x_driver = {
.driver = { .driver = {
.name = "lp872x", .name = "lp872x",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(lp872x_dt_ids), .of_match_table = of_match_ptr(lp872x_dt_ids),
}, },
.probe_new = lp872x_probe, .probe_new = lp872x_probe,
......
...@@ -187,6 +187,7 @@ MODULE_DEVICE_TABLE(platform, lp873x_regulator_id_table); ...@@ -187,6 +187,7 @@ MODULE_DEVICE_TABLE(platform, lp873x_regulator_id_table);
static struct platform_driver lp873x_regulator_driver = { static struct platform_driver lp873x_regulator_driver = {
.driver = { .driver = {
.name = "lp873x-pmic", .name = "lp873x-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = lp873x_regulator_probe, .probe = lp873x_regulator_probe,
.id_table = lp873x_regulator_id_table, .id_table = lp873x_regulator_id_table,
......
...@@ -440,6 +440,7 @@ MODULE_DEVICE_TABLE(i2c, lp8755_id); ...@@ -440,6 +440,7 @@ MODULE_DEVICE_TABLE(i2c, lp8755_id);
static struct i2c_driver lp8755_i2c_driver = { static struct i2c_driver lp8755_i2c_driver = {
.driver = { .driver = {
.name = LP8755_NAME, .name = LP8755_NAME,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp8755_probe, .probe_new = lp8755_probe,
.remove = lp8755_remove, .remove = lp8755_remove,
......
...@@ -237,6 +237,7 @@ MODULE_DEVICE_TABLE(platform, lp87565_regulator_id_table); ...@@ -237,6 +237,7 @@ MODULE_DEVICE_TABLE(platform, lp87565_regulator_id_table);
static struct platform_driver lp87565_regulator_driver = { static struct platform_driver lp87565_regulator_driver = {
.driver = { .driver = {
.name = "lp87565-pmic", .name = "lp87565-pmic",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe = lp87565_regulator_probe, .probe = lp87565_regulator_probe,
.id_table = lp87565_regulator_id_table, .id_table = lp87565_regulator_id_table,
......
...@@ -531,6 +531,7 @@ static struct platform_driver lp8788_buck_driver = { ...@@ -531,6 +531,7 @@ static struct platform_driver lp8788_buck_driver = {
.probe = lp8788_buck_probe, .probe = lp8788_buck_probe,
.driver = { .driver = {
.name = LP8788_DEV_BUCK, .name = LP8788_DEV_BUCK,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -564,6 +564,7 @@ static struct platform_driver lp8788_dldo_driver = { ...@@ -564,6 +564,7 @@ static struct platform_driver lp8788_dldo_driver = {
.probe = lp8788_dldo_probe, .probe = lp8788_dldo_probe,
.driver = { .driver = {
.name = LP8788_DEV_DLDO, .name = LP8788_DEV_DLDO,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
...@@ -611,6 +612,7 @@ static struct platform_driver lp8788_aldo_driver = { ...@@ -611,6 +612,7 @@ static struct platform_driver lp8788_aldo_driver = {
.probe = lp8788_aldo_probe, .probe = lp8788_aldo_probe,
.driver = { .driver = {
.name = LP8788_DEV_ALDO, .name = LP8788_DEV_ALDO,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
}; };
......
...@@ -474,6 +474,7 @@ MODULE_DEVICE_TABLE(of, ltc3589_of_match); ...@@ -474,6 +474,7 @@ MODULE_DEVICE_TABLE(of, ltc3589_of_match);
static struct i2c_driver ltc3589_driver = { static struct i2c_driver ltc3589_driver = {
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(ltc3589_of_match), .of_match_table = of_match_ptr(ltc3589_of_match),
}, },
.probe_new = ltc3589_probe, .probe_new = ltc3589_probe,
......
...@@ -371,6 +371,7 @@ MODULE_DEVICE_TABLE(of, ltc3676_of_match); ...@@ -371,6 +371,7 @@ MODULE_DEVICE_TABLE(of, ltc3676_of_match);
static struct i2c_driver ltc3676_driver = { static struct i2c_driver ltc3676_driver = {
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(ltc3676_of_match), .of_match_table = of_match_ptr(ltc3676_of_match),
}, },
.probe_new = ltc3676_regulator_probe, .probe_new = ltc3676_regulator_probe,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment