Skip to content

Commit

Permalink
drivers: regulator: pca9420: do not expose registers in DT
Browse files Browse the repository at this point in the history
Regulator registers were set for each BUCK/LDO in DT, likely because of
the way the devices were instantiated. When using a generic iterator,
ie, DT_INST_FOREACH_CHILD, there's no way to differentiate the child
being _parsed_. Since instantiation happens now based on child node
names, we are able to know which registers each devices gets assigned at
the driver level. This greatly simplifies Devicetree, and it actually
removes information that is not strictly hardware description from it.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and carlescufi committed Nov 29, 2022
1 parent 9235ab9 commit 1caedf1
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 174 deletions.
28 changes: 0 additions & 28 deletions boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,7 @@ arduino_serial: &flexcomm12 {
voltage-range = <PCA9420_SW1_VOLTAGE_RANGE>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
num-voltages = <42>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_0>;
vsel-mask = <PCA9420_MODECFG_0_SW1_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW1_EN_VAL>;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
Expand All @@ -202,14 +195,7 @@ arduino_serial: &flexcomm12 {
voltage-range = <PCA9420_SW2_VOLTAGE_RANGE>;
num-voltages = <50>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_1>;
vsel-mask = <PCA9420_MODECFG_1_SW2_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW2_EN_VAL>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
Expand All @@ -219,14 +205,7 @@ arduino_serial: &flexcomm12 {
voltage-range = <PCA9420_LDO1_VOLTAGE_RANGE>;
num-voltages = <9>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_2>;
vsel-mask = <PCA9420_MODECFG_2_LDO1_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO1_EN_VAL>;
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
Expand All @@ -236,14 +215,7 @@ arduino_serial: &flexcomm12 {
voltage-range = <PCA9420_LDO2_VOLTAGE_RANGE>;
num-voltages = <51>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_3>;
vsel-mask = <PCA9420_MODECFG_3_LDO2_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO2_EN_VAL>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
Expand Down
28 changes: 0 additions & 28 deletions boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,7 @@ i2s1: &flexcomm3 {
voltage-range = <PCA9420_SW1_VOLTAGE_RANGE>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
num-voltages = <42>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_0>;
vsel-mask = <PCA9420_MODECFG_0_SW1_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW1_EN_VAL>;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
Expand All @@ -272,14 +265,7 @@ i2s1: &flexcomm3 {
voltage-range = <PCA9420_SW2_VOLTAGE_RANGE>;
num-voltages = <50>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_1>;
vsel-mask = <PCA9420_MODECFG_1_SW2_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_SW2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_SW2_EN_VAL>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
Expand All @@ -289,14 +275,7 @@ i2s1: &flexcomm3 {
voltage-range = <PCA9420_LDO1_VOLTAGE_RANGE>;
num-voltages = <9>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_2>;
vsel-mask = <PCA9420_MODECFG_2_LDO1_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO1_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO1_EN_VAL>;
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
Expand All @@ -306,14 +285,7 @@ i2s1: &flexcomm3 {
voltage-range = <PCA9420_LDO2_VOLTAGE_RANGE>;
num-voltages = <51>;
current-levels = <PCA9420_CURRENT_LIMIT_LEVELS>;
ilim-reg = <PCA9420_TOP_CNTL0>;
ilim-mask = <PCA9420_TOP_CNTL0_VIN_ILIM_SEL_MASK>;
num-current-levels = <7>;
vsel-reg = <PCA9420_MODECFG_0_3>;
vsel-mask = <PCA9420_MODECFG_3_LDO2_OUT_MASK>;
enable-reg = <PCA9420_MODECFG_0_2>;
enable-mask = <PCA9420_MODECFG_2_LDO2_EN_MASK>;
enable-val = <PCA9420_MODECFG_2_LDO2_EN_VAL>;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
Expand Down
Loading

0 comments on commit 1caedf1

Please sign in to comment.