Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: d321571d5e4c ("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>

authored by

AngeloGioacchino Del Regno and committed by
Mark Brown
d3cf8a17 7ab681dd

+20 -12
+20 -12
drivers/regulator/mt6360-regulator.c
··· 319 319 } 320 320 } 321 321 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) \ 325 325 { \ 326 326 .desc = { \ 327 327 .name = #_name, \ 328 328 .supply_name = #_sname, \ 329 329 .id = MT6360_REGULATOR_##_name, \ 330 - .of_match = of_match_ptr(#_name), \ 330 + .of_match = of_match_ptr(match), \ 331 331 .regulators_node = of_match_ptr("regulator"), \ 332 332 .of_map_mode = mt6360_regulator_of_map_mode, \ 333 333 .owner = THIS_MODULE, \ ··· 351 351 } 352 352 353 353 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, 355 356 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, 357 359 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, 359 362 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, 361 365 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, 363 368 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, 365 371 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, 367 374 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, 369 377 ldo_vout_ranges3, 128, 100, ldo5_irq_tbls), 370 378 }; 371 379