]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.8/regulator-mt6360-de-capitalize-devicetree-regulator-.patch
0b1a02c66ea1aa887e867516bd981aad909c5a9b
[thirdparty/kernel/stable-queue.git] / queue-6.8 / regulator-mt6360-de-capitalize-devicetree-regulator-.patch
1 From 723b0df2eb0c461b61eb7ee6c22587ad09517b1e Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 9 Apr 2024 16:44:38 +0200
4 Subject: regulator: mt6360: De-capitalize devicetree regulator subnodes
5
6 From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
7
8 [ Upstream commit d3cf8a17498dd9104c04ad28eeac3ef3339f9f9f ]
9
10 The MT6360 regulator binding, the example in the MT6360 mfd binding, and
11 the devicetree users of those bindings are rightfully declaring MT6360
12 regulator subnodes with non-capital names, and luckily without using the
13 deprecated regulator-compatible property.
14
15 With this driver declaring capitalized BUCKx/LDOx as of_match string for
16 the node names, obviously no regulator gets probed: fix that by changing
17 the MT6360_REGULATOR_DESC macro to add a "match" parameter which gets
18 assigned to the of_match.
19
20 Fixes: d321571d5e4c ("regulator: mt6360: Add support for MT6360 regulator")
21 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
22 Link: https://msgid.link/r/20240409144438.410060-1-angelogioacchino.delregno@collabora.com
23 Signed-off-by: Mark Brown <broonie@kernel.org>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 drivers/regulator/mt6360-regulator.c | 32 +++++++++++++++++-----------
27 1 file changed, 20 insertions(+), 12 deletions(-)
28
29 diff --git a/drivers/regulator/mt6360-regulator.c b/drivers/regulator/mt6360-regulator.c
30 index ad6587a378d09..24cc9fc94e900 100644
31 --- a/drivers/regulator/mt6360-regulator.c
32 +++ b/drivers/regulator/mt6360-regulator.c
33 @@ -319,15 +319,15 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
34 }
35 }
36
37 -#define MT6360_REGULATOR_DESC(_name, _sname, ereg, emask, vreg, vmask, \
38 - mreg, mmask, streg, stmask, vranges, \
39 - vcnts, offon_delay, irq_tbls) \
40 +#define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg, \
41 + vmask, mreg, mmask, streg, stmask, \
42 + vranges, vcnts, offon_delay, irq_tbls) \
43 { \
44 .desc = { \
45 .name = #_name, \
46 .supply_name = #_sname, \
47 .id = MT6360_REGULATOR_##_name, \
48 - .of_match = of_match_ptr(#_name), \
49 + .of_match = of_match_ptr(match), \
50 .regulators_node = of_match_ptr("regulator"), \
51 .of_map_mode = mt6360_regulator_of_map_mode, \
52 .owner = THIS_MODULE, \
53 @@ -351,21 +351,29 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
54 }
55
56 static const struct mt6360_regulator_desc mt6360_regulator_descs[] = {
57 - MT6360_REGULATOR_DESC(BUCK1, BUCK1_VIN, 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
58 + MT6360_REGULATOR_DESC("buck1", BUCK1, BUCK1_VIN,
59 + 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
60 buck_vout_ranges, 256, 0, buck1_irq_tbls),
61 - MT6360_REGULATOR_DESC(BUCK2, BUCK2_VIN, 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
62 + MT6360_REGULATOR_DESC("buck2", BUCK2, BUCK2_VIN,
63 + 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
64 buck_vout_ranges, 256, 0, buck2_irq_tbls),
65 - MT6360_REGULATOR_DESC(LDO6, LDO_VIN3, 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
66 + MT6360_REGULATOR_DESC("ldo6", LDO6, LDO_VIN3,
67 + 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
68 ldo_vout_ranges1, 256, 0, ldo6_irq_tbls),
69 - MT6360_REGULATOR_DESC(LDO7, LDO_VIN3, 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
70 + MT6360_REGULATOR_DESC("ldo7", LDO7, LDO_VIN3,
71 + 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
72 ldo_vout_ranges1, 256, 0, ldo7_irq_tbls),
73 - MT6360_REGULATOR_DESC(LDO1, LDO_VIN1, 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
74 + MT6360_REGULATOR_DESC("ldo1", LDO1, LDO_VIN1,
75 + 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
76 ldo_vout_ranges2, 256, 0, ldo1_irq_tbls),
77 - MT6360_REGULATOR_DESC(LDO2, LDO_VIN1, 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
78 + MT6360_REGULATOR_DESC("ldo2", LDO2, LDO_VIN1,
79 + 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
80 ldo_vout_ranges2, 256, 0, ldo2_irq_tbls),
81 - MT6360_REGULATOR_DESC(LDO3, LDO_VIN1, 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
82 + MT6360_REGULATOR_DESC("ldo3", LDO3, LDO_VIN1,
83 + 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
84 ldo_vout_ranges2, 256, 100, ldo3_irq_tbls),
85 - MT6360_REGULATOR_DESC(LDO5, LDO_VIN2, 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
86 + MT6360_REGULATOR_DESC("ldo5", LDO5, LDO_VIN2,
87 + 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
88 ldo_vout_ranges3, 128, 100, ldo5_irq_tbls),
89 };
90
91 --
92 2.43.0
93