regulator: mc13xxx: Use lowercase regulator names to match the DT
PATCH 1/2 regulator: mc13xxx: Use lowercase regulator names to match the DT
Since c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Vivien reported the mc13892-regulator complaining about not being able to find regulators.
This is because prior to that commit we used of_node_cmp() to compare the regulator array passed from mc13892_regulators down to mc13xxx_parse_regulators_dt() and they are all defined in uppercase letters by the MC13892_*_DEFINE* macros, whereas they are defined as lowercase in the DTS.
Fix this by using a lowercase regulator name to match the DT node name.
--- drivers/regulator/mc13783-regulator.c | 78 +++++++++++++-------------- drivers/regulator/mc13892-regulator.c | 64 +++++++++++----------- drivers/regulator/mc13xxx.h | 20 +++---- 3 files changed, 81 insertions(+), 81 deletions(-)
drivers/regulator/mc13783-regulator.c +39 -39
@@ -228,67 +228,67 @@ static const unsigned int mc13783_pwgtdrv_val[] = {static struct regulator_ops mc13783_gpo_regulator_ops; -#define MC13783_DEFINE (prefix, name, reg, vsel_reg, voltages) \ - MC13xxx_DEFINE(MC13783_REG_, name, reg, vsel_reg, voltages, \ +#define MC13783_DEFINE (prefix, name, node, reg, vsel_reg, voltages) \ + MC13xxx_DEFINE(MC13783_REG_, name, node, reg, vsel_reg, voltages, \ mc13xxx_regulator_ops) -#define MC13783_FIXED_DEFINE (prefix, name, reg, voltages) \ - MC13xxx_FIXED_DEFINE(MC13783_REG_, name, reg, voltages, \ +#define MC13783_FIXED_DEFINE (prefix, name, node, reg, voltages) \ + MC13xxx_FIXED_DEFINE(MC13783_REG_, name, node, reg, voltages, \ mc13xxx_fixed_regulator_ops) -#define MC13783_GPO_DEFINE (prefix, name, reg, voltages) \ - MC13xxx_GPO_DEFINE(MC13783_REG_, name, reg, voltages, \ +#define MC13783_GPO_DEFINE (prefix, name, node, reg, voltages) \ + MC13xxx_GPO_DEFINE(MC13783_REG_, name, node, reg, voltages, \ mc13783_gpo_regulator_ops) -#define MC13783_DEFINE_SW (_name, _reg, _vsel_reg, _voltages) \ - MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) -#define MC13783_DEFINE_REGU (_name, _reg, _vsel_reg, _voltages) \ - MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) +#define MC13783_DEFINE_SW (_name, _node, _reg, _vsel_reg, _voltages) \ + MC13783_DEFINE(REG, _name, _node, _reg, _vsel_reg, _voltages) +#define MC13783_DEFINE_REGU (_name, _node, _reg, _vsel_reg, _voltages) \ + MC13783_DEFINE(REG, _name, _node, _reg, _vsel_reg, _voltages)static struct mc13xxx_regulator mc13783_regulators[] = { -MC13783_DEFINE_SW (SW1A ,SWITCHERS0 ,SWITCHERS0 , mc13783_sw1x_val), -MC13783_DEFINE_SW (SW1B ,SWITCHERS1 ,SWITCHERS1 , mc13783_sw1x_val), -MC13783_DEFINE_SW (SW2A ,SWITCHERS2 ,SWITCHERS2 , mc13783_sw2x_val), -MC13783_DEFINE_SW (SW2B ,SWITCHERS3 ,SWITCHERS3 , mc13783_sw2x_val), -MC13783_DEFINE_SW (SW3 ,SWITCHERS5 ,SWITCHERS5 , mc13783_sw3_val), - -MC13783_FIXED_DEFINE (REG ,VAUDIO ,REGULATORMODE0 , mc13783_vaudio_val), -MC13783_FIXED_DEFINE (REG ,VIOHI ,REGULATORMODE0 , mc13783_viohi_val), -MC13783_DEFINE_REGU (VIOLO ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_SW (SW1A , sw1a,SWITCHERS0 ,SWITCHERS0 , mc13783_sw1x_val), +MC13783_DEFINE_SW (SW1B , sw1b,SWITCHERS1 ,SWITCHERS1 , mc13783_sw1x_val), +MC13783_DEFINE_SW (SW2A , sw2a,SWITCHERS2 ,SWITCHERS2 , mc13783_sw2x_val), +MC13783_DEFINE_SW (SW2B , sw2b,SWITCHERS3 ,SWITCHERS3 , mc13783_sw2x_val), +MC13783_DEFINE_SW (SW3 , sw3,SWITCHERS5 ,SWITCHERS5 , mc13783_sw3_val), + +MC13783_FIXED_DEFINE (REG ,VAUDIO , vaudio,REGULATORMODE0 , mc13783_vaudio_val), +MC13783_FIXED_DEFINE (REG ,VIOHI , viohi,REGULATORMODE0 , mc13783_viohi_val), +MC13783_DEFINE_REGU (VIOLO , violo,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_violo_val), -MC13783_DEFINE_REGU (VDIG ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VDIG , vdig,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_vdig_val), -MC13783_DEFINE_REGU (VGEN ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VGEN , vgen,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_vgen_val), -MC13783_DEFINE_REGU (VRFDIG ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VRFDIG , vrfdig,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_vrfdig_val), -MC13783_DEFINE_REGU (VRFREF ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VRFREF , vrfref,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_vrfref_val), -MC13783_DEFINE_REGU (VRFCP ,REGULATORMODE0 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VRFCP , vrfcp,REGULATORMODE0 ,REGULATORSETTING0 , mc13783_vrfcp_val), -MC13783_DEFINE_REGU (VSIM ,REGULATORMODE1 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VSIM , vsim,REGULATORMODE1 ,REGULATORSETTING0 , mc13783_vsim_val), -MC13783_DEFINE_REGU (VESIM ,REGULATORMODE1 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VESIM , vesim,REGULATORMODE1 ,REGULATORSETTING0 , mc13783_vesim_val), -MC13783_DEFINE_REGU (VCAM ,REGULATORMODE1 ,REGULATORSETTING0 , +MC13783_DEFINE_REGU (VCAM , vcam,REGULATORMODE1 ,REGULATORSETTING0 , mc13783_vcam_val), -MC13783_FIXED_DEFINE (REG ,VRFBG ,REGULATORMODE1 , mc13783_vrfbg_val), -MC13783_DEFINE_REGU (VVIB ,REGULATORMODE1 ,REGULATORSETTING1 , +MC13783_FIXED_DEFINE (REG ,VRFBG , vrfbg,REGULATORMODE1 , mc13783_vrfbg_val), +MC13783_DEFINE_REGU (VVIB , vvib,REGULATORMODE1 ,REGULATORSETTING1 , mc13783_vvib_val), -MC13783_DEFINE_REGU (VRF1 ,REGULATORMODE1 ,REGULATORSETTING1 , +MC13783_DEFINE_REGU (VRF1 , vrf1,REGULATORMODE1 ,REGULATORSETTING1 , mc13783_vrf_val), -MC13783_DEFINE_REGU (VRF2 ,REGULATORMODE1 ,REGULATORSETTING1 , +MC13783_DEFINE_REGU (VRF2 , vrf2,REGULATORMODE1 ,REGULATORSETTING1 , mc13783_vrf_val), -MC13783_DEFINE_REGU (VMMC1 ,REGULATORMODE1 ,REGULATORSETTING1 , +MC13783_DEFINE_REGU (VMMC1 , vmmc1,REGULATORMODE1 ,REGULATORSETTING1 , mc13783_vmmc_val), -MC13783_DEFINE_REGU (VMMC2 ,REGULATORMODE1 ,REGULATORSETTING1 , +MC13783_DEFINE_REGU (VMMC2 , vmmc2,REGULATORMODE1 ,REGULATORSETTING1 , mc13783_vmmc_val), -MC13783_GPO_DEFINE (REG ,GPO1 ,POWERMISC , mc13783_gpo_val), -MC13783_GPO_DEFINE (REG ,GPO2 ,POWERMISC , mc13783_gpo_val), -MC13783_GPO_DEFINE (REG ,GPO3 ,POWERMISC , mc13783_gpo_val), -MC13783_GPO_DEFINE (REG ,GPO4 ,POWERMISC , mc13783_gpo_val), -MC13783_GPO_DEFINE (REG ,PWGT1SPI ,POWERMISC , mc13783_pwgtdrv_val), -MC13783_GPO_DEFINE (REG ,PWGT2SPI ,POWERMISC , mc13783_pwgtdrv_val), +MC13783_GPO_DEFINE (REG ,GPO1 , gpo1,POWERMISC , mc13783_gpo_val), +MC13783_GPO_DEFINE (REG ,GPO2 , gpo1,POWERMISC , mc13783_gpo_val), +MC13783_GPO_DEFINE (REG ,GPO3 , gpo1,POWERMISC , mc13783_gpo_val), +MC13783_GPO_DEFINE (REG ,GPO4 , gpo1,POWERMISC , mc13783_gpo_val), +MC13783_GPO_DEFINE (REG ,PWGT1SPI , pwgt1spi,POWERMISC , mc13783_pwgtdrv_val), +MC13783_GPO_DEFINE (REG ,PWGT2SPI , pwgt2spi,POWERMISC , mc13783_pwgtdrv_val), }; static int mc13783_powermisc_rmw(struct mc13xxx_regulator_priv *priv, u32 mask,
drivers/regulator/mc13892-regulator.c +32 -32
89 lines not on this page · raw message
drivers/regulator/mc13xxx.h +10 -10
@@ -56,10 +56,10 @@ static inline struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(extern struct regulator_ops mc13xxx_regulator_ops;extern struct regulator_ops mc13xxx_fixed_regulator_ops; -#define MC13xxx_DEFINE (prefix, _name, _reg, _vsel_reg, _voltages, _ops) \ +#define MC13xxx_DEFINE (prefix, _name, _node, _reg, _vsel_reg, _voltages, _ops) \ [prefix ## _name] = { \ .desc = { \ - .name = #_name, \ + .name = #_node, \ .n_voltages = ARRAY_SIZE(_voltages), \ .volt_table = _voltages, \ .ops = &_ops, \
@@ -74,10 +74,10 @@ extern struct regulator_ops mc13xxx_fixed_regulator_ops; .vsel_mask = prefix ## _vsel_reg ## _ ## _name ## VSEL_M,\ } -#define MC13xxx_FIXED_DEFINE (prefix, _name, _reg, _voltages, _ops) \ +#define MC13xxx_FIXED_DEFINE (prefix, _name, _node, _reg, _voltages, _ops) \ [prefix ## _name] = { \ .desc = { \ - .name = #_name, \ + .name = #_node, \ .n_voltages = ARRAY_SIZE(_voltages), \ .volt_table = _voltages, \ .ops = &_ops, \
@@ -89,10 +89,10 @@ extern struct regulator_ops mc13xxx_fixed_regulator_ops; .enable_bit = prefix ## _reg ## _ ## _name ## EN, \ } -#define MC13xxx_GPO_DEFINE (prefix, _name, _reg, _voltages, _ops) \ +#define MC13xxx_GPO_DEFINE (prefix, _name, _node, _reg, _voltages, _ops) \ [prefix ## _name] = { \ .desc = { \ - .name = #_name, \ + .name = #_node, \ .n_voltages = ARRAY_SIZE(_voltages), \ .volt_table = _voltages, \ .ops = &_ops, \
@@ -104,9 +104,9 @@ extern struct regulator_ops mc13xxx_fixed_regulator_ops; .enable_bit = prefix ## _reg ## _ ## _name ## EN, \ } -#define MC13xxx_DEFINE_SW (_name, _reg, _vsel_reg, _voltages, ops) \ - MC13xxx_DEFINE(SW, _name, _reg, _vsel_reg, _voltages, ops) -#define MC13xxx_DEFINE_REGU (_name, _reg, _vsel_reg, _voltages, ops) \ - MC13xxx_DEFINE(REGU, _name, _reg, _vsel_reg, _voltages, ops) +#define MC13xxx_DEFINE_SW (_name, _node, _reg, _vsel_reg, _voltages, ops) \ + MC13xxx_DEFINE(SW, _name, _node, _reg, _vsel_reg, _voltages, ops) +#define MC13xxx_DEFINE_REGU (_name, _node, _reg, _vsel_reg, _voltages, ops) \ + MC13xxx_DEFINE(REGU, _name, _node, _reg, _vsel_reg, _voltages, ops)#endif
Signature · 1 line
2.19.1
PATCH 2/2 regulator: da9052: Use lowercase regulator names to match the DT
Since c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons"), regulator node name comparisons are case sensitive. The DA9052 driver uses uppercase, but the DT has lowercase.
Fix this by using a lowercase regulator name to match the DT node name.
--- drivers/regulator/da9052-regulator.c | 64 ++++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-)
drivers/regulator/da9052-regulator.c +32 -32
@@ -290,10 +290,10 @@ static const struct regulator_ops da9052_ldo_ops = { .disable = regulator_disable_regmap, }; -#define DA9052_LDO (_id, step, min, max, sbits, ebits, abits) \ +#define DA9052_LDO (_id, _name, step, min, max, sbits, ebits, abits) \ {\ .reg_desc = {\ - .name = #_id,\ + .name = #_name,\ .ops = &da9052_ldo_ops,\ .type = REGULATOR_VOLTAGE,\ .id = DA9052_ID_##_id,\
@@ -310,10 +310,10 @@ static const struct regulator_ops da9052_ldo_ops = { .activate_bit = (abits),\ } -#define DA9052_DCDC (_id, step, min, max, sbits, ebits, abits) \ +#define DA9052_DCDC (_id, _name, step, min, max, sbits, ebits, abits) \ {\ .reg_desc = {\ - .name = #_id,\ + .name = #_name,\ .ops = &da9052_dcdc_ops,\ .type = REGULATOR_VOLTAGE,\ .id = DA9052_ID_##_id,\
@@ -331,37 +331,37 @@ static const struct regulator_ops da9052_ldo_ops = { }static struct da9052_regulator_info da9052_regulator_info[] = { -DA9052_DCDC (BUCK1 ,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBCOREGO ), -DA9052_DCDC (BUCK2 ,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBPROGO ), -DA9052_DCDC (BUCK3 ,25 ,950 ,2525 ,6 ,6 ,DA9052_SUPPLY_VBMEMGO ), -DA9052_DCDC (BUCK4 ,50 ,1800 ,3600 ,5 ,6 ,0 ), -DA9052_LDO (LDO1 ,50 ,600 ,1800 ,5 ,6 ,0 ), -DA9052_LDO (LDO2 ,25 ,600 ,1800 ,6 ,6 ,DA9052_SUPPLY_VLDO2GO ), -DA9052_LDO (LDO3 ,25 ,1725 ,3300 ,6 ,6 ,DA9052_SUPPLY_VLDO3GO ), -DA9052_LDO (LDO4 ,25 ,1725 ,3300 ,6 ,6 ,0 ), -DA9052_LDO (LDO5 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO6 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO7 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO8 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO9 ,50 ,1250 ,3650 ,6 ,6 ,0 ), -DA9052_LDO (LDO10 ,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_DCDC (BUCK1 , buck1,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBCOREGO ), +DA9052_DCDC (BUCK2 , buck2,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBPROGO ), +DA9052_DCDC (BUCK3 , buck3,25 ,950 ,2525 ,6 ,6 ,DA9052_SUPPLY_VBMEMGO ), +DA9052_DCDC (BUCK4 , buck4,50 ,1800 ,3600 ,5 ,6 ,0 ), +DA9052_LDO (LDO1 , ldo1,50 ,600 ,1800 ,5 ,6 ,0 ), +DA9052_LDO (LDO2 , ldo2,25 ,600 ,1800 ,6 ,6 ,DA9052_SUPPLY_VLDO2GO ), +DA9052_LDO (LDO3 , ldo3,25 ,1725 ,3300 ,6 ,6 ,DA9052_SUPPLY_VLDO3GO ), +DA9052_LDO (LDO4 , ldo4,25 ,1725 ,3300 ,6 ,6 ,0 ), +DA9052_LDO (LDO5 , ldo5,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO6 , ldo6,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO7 , ldo7,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO8 , ldo8,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO9 , ldo9,50 ,1250 ,3650 ,6 ,6 ,0 ), +DA9052_LDO (LDO10 , ldo10,50 ,1200 ,3600 ,6 ,6 ,0 ), };static struct da9052_regulator_info da9053_regulator_info[] = { -DA9052_DCDC (BUCK1 ,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBCOREGO ), -DA9052_DCDC (BUCK2 ,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBPROGO ), -DA9052_DCDC (BUCK3 ,25 ,950 ,2525 ,6 ,6 ,DA9052_SUPPLY_VBMEMGO ), -DA9052_DCDC (BUCK4 ,25 ,950 ,2525 ,6 ,6 ,0 ), -DA9052_LDO (LDO1 ,50 ,600 ,1800 ,5 ,6 ,0 ), -DA9052_LDO (LDO2 ,25 ,600 ,1800 ,6 ,6 ,DA9052_SUPPLY_VLDO2GO ), -DA9052_LDO (LDO3 ,25 ,1725 ,3300 ,6 ,6 ,DA9052_SUPPLY_VLDO3GO ), -DA9052_LDO (LDO4 ,25 ,1725 ,3300 ,6 ,6 ,0 ), -DA9052_LDO (LDO5 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO6 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO7 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO8 ,50 ,1200 ,3600 ,6 ,6 ,0 ), -DA9052_LDO (LDO9 ,50 ,1250 ,3650 ,6 ,6 ,0 ), -DA9052_LDO (LDO10 ,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_DCDC (BUCK1 , buck1,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBCOREGO ), +DA9052_DCDC (BUCK2 , buck2,25 ,500 ,2075 ,6 ,6 ,DA9052_SUPPLY_VBPROGO ), +DA9052_DCDC (BUCK3 , buck3,25 ,950 ,2525 ,6 ,6 ,DA9052_SUPPLY_VBMEMGO ), +DA9052_DCDC (BUCK4 , buck4,25 ,950 ,2525 ,6 ,6 ,0 ), +DA9052_LDO (LDO1 , ldo1,50 ,600 ,1800 ,5 ,6 ,0 ), +DA9052_LDO (LDO2 , ldo2,25 ,600 ,1800 ,6 ,6 ,DA9052_SUPPLY_VLDO2GO ), +DA9052_LDO (LDO3 , ldo3,25 ,1725 ,3300 ,6 ,6 ,DA9052_SUPPLY_VLDO3GO ), +DA9052_LDO (LDO4 , ldo4,25 ,1725 ,3300 ,6 ,6 ,0 ), +DA9052_LDO (LDO5 , ldo5,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO6 , ldo6,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO7 , ldo7,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO8 , ldo8,50 ,1200 ,3600 ,6 ,6 ,0 ), +DA9052_LDO (LDO9 , ldo9,50 ,1250 ,3650 ,6 ,6 ,0 ), +DA9052_LDO (LDO10 , ldo10,50 ,1200 ,3600 ,6 ,6 ,0 ), }; static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id,
Signature · 1 line
2.19.1
Hi Rob,
Quoted 10 lines · Rob Herring
Since
c32569e358ad("regulator: Useof_node_name_eqfor node name comparisons") Vivien reported the mc13892-regulator complaining about not being able to find regulators.This is because prior to that commit we used
of_node_cmp()to compare the regulator array passed frommc13892_regulatorsdown tomc13xxx_parse_regulators_dt()and they are all defined in uppercase letters by the MC13892_*_DEFINE* macros, whereas they are defined as lowercase in the DTS.
Quoted 8 lines
Fix this by using a lowercase regulator name to match the DT node name.
Fixes c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons")Reported-by Vivien Didelot <[email protected]>Reported-by Florian Fainelli <[email protected]>Cc Liam Girdwood <[email protected]>Cc Mark Brown <[email protected]>Signed-off-by Rob Herring <[email protected]>
This fixes the boot with arch/arm/boot/dts/imx51-zii-rdu1.dts,
Thanks,
Vivien
Quoted 10 lines · Rob Herring
Since
c32569e358ad("regulator: Useof_node_name_eqfor node name comparisons") Vivien reported the mc13892-regulator complaining about not being able to find regulators.This is because prior to that commit we used
of_node_cmp()to compare the regulator array passed frommc13892_regulatorsdown tomc13xxx_parse_regulators_dt()and they are all defined in uppercase letters by the MC13892_*_DEFINE* macros, whereas they are defined as lowercase in the DTS.
Quoted 8 lines
Fix this by using a lowercase regulator name to match the DT node name.
Fixes c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons")Reported-by Vivien Didelot <[email protected]>Reported-by Florian Fainelli <[email protected]>Cc Liam Girdwood <[email protected]>Cc Mark Brown <[email protected]>Signed-off-by Rob Herring <[email protected]>
Thanks, when I looked at it last night, it seems to me that you also need to patch the following drivers:
drivers/regulator/88pm8607.cdrivers/regulator/da9052-regulator.cdrivers/regulator/max8997-regulator.cdrivers/regulator/s5m8767.c
since they all define their array of regulators using uppercase, and then later match that using the same logic that drivers/regulator/mc13xxx-regulator-core.c does.
Signature · 1 line
Florian