Skip to content

Commit d3cf8a1

Browse files
AngeloGioacchino Del Regnobroonie
authored andcommitted
regulator: mt6360: De-capitalize devicetree regulator subnodes
The MT6360 regulator binding, the example in the MT6360 mfd binding, and the devicetree users of those bindings are rightfully declaring MT6360 regulator subnodes with non-capital names, and luckily without using the deprecated regulator-compatible property. With this driver declaring capitalized BUCKx/LDOx as of_match string for the node names, obviously no regulator gets probed: fix that by changing the MT6360_REGULATOR_DESC macro to add a "match" parameter which gets assigned to the of_match. Fixes: d321571 ("regulator: mt6360: Add support for MT6360 regulator") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://msgid.link/r/20240409144438.410060-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7ab681d commit d3cf8a1

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

drivers/regulator/mt6360-regulator.c

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
319319
}
320320
}
321321

322-
#define MT6360_REGULATOR_DESC(_name, _sname, ereg, emask, vreg, vmask, \
323-
mreg, mmask, streg, stmask, vranges, \
324-
vcnts, offon_delay, irq_tbls) \
322+
#define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg, \
323+
vmask, mreg, mmask, streg, stmask, \
324+
vranges, vcnts, offon_delay, irq_tbls) \
325325
{ \
326326
.desc = { \
327327
.name = #_name, \
328328
.supply_name = #_sname, \
329329
.id = MT6360_REGULATOR_##_name, \
330-
.of_match = of_match_ptr(#_name), \
330+
.of_match = of_match_ptr(match), \
331331
.regulators_node = of_match_ptr("regulator"), \
332332
.of_map_mode = mt6360_regulator_of_map_mode, \
333333
.owner = THIS_MODULE, \
@@ -351,21 +351,29 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
351351
}
352352

353353
static const struct mt6360_regulator_desc mt6360_regulator_descs[] = {
354-
MT6360_REGULATOR_DESC(BUCK1, BUCK1_VIN, 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
354+
MT6360_REGULATOR_DESC("buck1", BUCK1, BUCK1_VIN,
355+
0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
355356
buck_vout_ranges, 256, 0, buck1_irq_tbls),
356-
MT6360_REGULATOR_DESC(BUCK2, BUCK2_VIN, 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
357+
MT6360_REGULATOR_DESC("buck2", BUCK2, BUCK2_VIN,
358+
0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
357359
buck_vout_ranges, 256, 0, buck2_irq_tbls),
358-
MT6360_REGULATOR_DESC(LDO6, LDO_VIN3, 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
360+
MT6360_REGULATOR_DESC("ldo6", LDO6, LDO_VIN3,
361+
0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
359362
ldo_vout_ranges1, 256, 0, ldo6_irq_tbls),
360-
MT6360_REGULATOR_DESC(LDO7, LDO_VIN3, 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
363+
MT6360_REGULATOR_DESC("ldo7", LDO7, LDO_VIN3,
364+
0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
361365
ldo_vout_ranges1, 256, 0, ldo7_irq_tbls),
362-
MT6360_REGULATOR_DESC(LDO1, LDO_VIN1, 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
366+
MT6360_REGULATOR_DESC("ldo1", LDO1, LDO_VIN1,
367+
0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
363368
ldo_vout_ranges2, 256, 0, ldo1_irq_tbls),
364-
MT6360_REGULATOR_DESC(LDO2, LDO_VIN1, 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
369+
MT6360_REGULATOR_DESC("ldo2", LDO2, LDO_VIN1,
370+
0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
365371
ldo_vout_ranges2, 256, 0, ldo2_irq_tbls),
366-
MT6360_REGULATOR_DESC(LDO3, LDO_VIN1, 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
372+
MT6360_REGULATOR_DESC("ldo3", LDO3, LDO_VIN1,
373+
0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
367374
ldo_vout_ranges2, 256, 100, ldo3_irq_tbls),
368-
MT6360_REGULATOR_DESC(LDO5, LDO_VIN2, 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
375+
MT6360_REGULATOR_DESC("ldo5", LDO5, LDO_VIN2,
376+
0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
369377
ldo_vout_ranges3, 128, 100, ldo5_irq_tbls),
370378
};
371379

0 commit comments

Comments
 (0)