]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blobdiff - queue-6.8/regulator-mt6360-de-capitalize-devicetree-regulator-.patch
Fixes for 6.8
[thirdparty/kernel/stable-queue.git] / queue-6.8 / regulator-mt6360-de-capitalize-devicetree-regulator-.patch
diff --git a/queue-6.8/regulator-mt6360-de-capitalize-devicetree-regulator-.patch b/queue-6.8/regulator-mt6360-de-capitalize-devicetree-regulator-.patch
new file mode 100644 (file)
index 0000000..0b1a02c
--- /dev/null
@@ -0,0 +1,93 @@
+From 723b0df2eb0c461b61eb7ee6c22587ad09517b1e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 9 Apr 2024 16:44:38 +0200
+Subject: regulator: mt6360: De-capitalize devicetree regulator subnodes
+
+From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+
+[ Upstream commit d3cf8a17498dd9104c04ad28eeac3ef3339f9f9f ]
+
+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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/regulator/mt6360-regulator.c | 32 +++++++++++++++++-----------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/regulator/mt6360-regulator.c b/drivers/regulator/mt6360-regulator.c
+index ad6587a378d09..24cc9fc94e900 100644
+--- a/drivers/regulator/mt6360-regulator.c
++++ b/drivers/regulator/mt6360-regulator.c
+@@ -319,15 +319,15 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
+       }
+ }
+-#define MT6360_REGULATOR_DESC(_name, _sname, ereg, emask, vreg,       vmask,  \
+-                            mreg, mmask, streg, stmask, vranges,      \
+-                            vcnts, offon_delay, irq_tbls)             \
++#define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg,        \
++                            vmask, mreg, mmask, streg, stmask,        \
++                            vranges, vcnts, offon_delay, irq_tbls)    \
+ {                                                                     \
+       .desc = {                                                       \
+               .name = #_name,                                         \
+               .supply_name = #_sname,                                 \
+               .id =  MT6360_REGULATOR_##_name,                        \
+-              .of_match = of_match_ptr(#_name),                       \
++              .of_match = of_match_ptr(match),                        \
+               .regulators_node = of_match_ptr("regulator"),           \
+               .of_map_mode = mt6360_regulator_of_map_mode,            \
+               .owner = THIS_MODULE,                                   \
+@@ -351,21 +351,29 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
+ }
+ static const struct mt6360_regulator_desc mt6360_regulator_descs[] =  {
+-      MT6360_REGULATOR_DESC(BUCK1, BUCK1_VIN, 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
++      MT6360_REGULATOR_DESC("buck1", BUCK1, BUCK1_VIN,
++                            0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
+                             buck_vout_ranges, 256, 0, buck1_irq_tbls),
+-      MT6360_REGULATOR_DESC(BUCK2, BUCK2_VIN, 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
++      MT6360_REGULATOR_DESC("buck2", BUCK2, BUCK2_VIN,
++                            0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
+                             buck_vout_ranges, 256, 0, buck2_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO6, LDO_VIN3, 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
++      MT6360_REGULATOR_DESC("ldo6", LDO6, LDO_VIN3,
++                            0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
+                             ldo_vout_ranges1, 256, 0, ldo6_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO7, LDO_VIN3, 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
++      MT6360_REGULATOR_DESC("ldo7", LDO7, LDO_VIN3,
++                            0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
+                             ldo_vout_ranges1, 256, 0, ldo7_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO1, LDO_VIN1, 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
++      MT6360_REGULATOR_DESC("ldo1", LDO1, LDO_VIN1,
++                            0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
+                             ldo_vout_ranges2, 256, 0, ldo1_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO2, LDO_VIN1, 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
++      MT6360_REGULATOR_DESC("ldo2", LDO2, LDO_VIN1,
++                            0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
+                             ldo_vout_ranges2, 256, 0, ldo2_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO3, LDO_VIN1, 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
++      MT6360_REGULATOR_DESC("ldo3", LDO3, LDO_VIN1,
++                            0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
+                             ldo_vout_ranges2, 256, 100, ldo3_irq_tbls),
+-      MT6360_REGULATOR_DESC(LDO5, LDO_VIN2, 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
++      MT6360_REGULATOR_DESC("ldo5", LDO5, LDO_VIN2,
++                            0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
+                             ldo_vout_ranges3, 128, 100, ldo5_irq_tbls),
+ };
+-- 
+2.43.0
+