Skip to content

Commit

Permalink
drivers: regulator: pca9420: use standard regulator-min|max-microvolt
Browse files Browse the repository at this point in the history
regulator.yaml provides now standard properties for minimum/maximum
voltage.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and carlescufi committed Nov 29, 2022
1 parent a175e68 commit f89405c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
16 changes: 8 additions & 8 deletions boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ arduino_serial: &flexcomm12 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW1_EN_VAL>;
min-uV = <500000>;
max-uV = <1800000>;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
};

Expand All @@ -210,8 +210,8 @@ arduino_serial: &flexcomm12 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW2_EN_VAL>;
min-uV = <1500000>;
max-uV = <3300000>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};

Expand All @@ -227,8 +227,8 @@ arduino_serial: &flexcomm12 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO1_EN_VAL>;
min-uV = <1700000>;
max-uV = <1900000>;
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
};

Expand All @@ -244,8 +244,8 @@ arduino_serial: &flexcomm12 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO2_EN_VAL>;
min-uV = <1500000>;
max-uV = <3300000>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};

Expand Down
16 changes: 8 additions & 8 deletions boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ i2s1: &flexcomm3 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW1_EN_VAL>;
min-uV = <500000>;
max-uV = <1800000>;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
};

Expand All @@ -280,8 +280,8 @@ i2s1: &flexcomm3 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW2_EN_VAL>;
min-uV = <1500000>;
max-uV = <3300000>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};

Expand All @@ -297,8 +297,8 @@ i2s1: &flexcomm3 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO1_EN_VAL>;
min-uV = <1700000>;
max-uV = <1900000>;
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
};

Expand All @@ -314,8 +314,8 @@ i2s1: &flexcomm3 {
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO2_EN_VAL>;
min-uV = <1500000>;
max-uV = <3300000>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/regulator_pca9420.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ static const struct regulator_driver_api api = {
.enable_reg = DT_PROP(node_id, enable_reg), \
.enable_mask = DT_PROP(node_id, enable_mask), \
.enable_val = DT_PROP(node_id, enable_val), \
.min_uv = DT_PROP(node_id, min_uv), \
.max_uv = DT_PROP(node_id, max_uv), \
.min_uv = DT_PROP(node_id, regulator_min_microvolt), \
.max_uv = DT_PROP(node_id, regulator_max_microvolt), \
.ilim_reg = DT_PROP_OR(node_id, ilim_reg, 0), \
.ilim_mask = DT_PROP_OR(node_id, ilim_mask, 0), \
.enable_inverted = DT_PROP(node_id, enable_inverted), \
Expand Down
19 changes: 9 additions & 10 deletions dts/bindings/regulator/nxp,pca9420.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,17 @@ child-binding:
- name: regulator.yaml
property-allowlist:
- regulator-boot-on
- regulator-min-microvolt
- regulator-max-microvolt

description: Voltage output of PMIC controller regulator
properties:
regulator-min-microvolt:
required: true

regulator-max-microvolt:
required: true

voltage-range:
type: array
required: true
Expand Down Expand Up @@ -78,16 +87,6 @@ child-binding:
description: |
value to apply enable-mask to, and write to enable-reg in order
to enable the regulator output.
min-uV:
type: int
required: true
description: |
Minimum voltage in microvolts that this regulator supports
max-uV:
type: int
required: true
description: |
Maximum voltage in microvolts that this regulator supports
enable-inverted:
type: boolean
description: |
Expand Down

0 comments on commit f89405c

Please sign in to comment.