mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mfd: axp20x: export axp20x-regulator child for AXP152
@ 2022-09-28  8:50 Ahmad Fatoum
  2022-10-04  7:47 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2022-09-28  8:50 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

While the upstream Linux driver doesn't support regulator configuration
for the AXP152, we may need this in barebox for initial regulator setup.
Thus have the MFD driver register the appropriate child device as done
for the other drivers. While at it, pass along the axp20x driver data
object. This is needed, so the regulator driver can query the variant;
so far it was only possible to retrieve the parent regmap and redo the
revision readout.

Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mfd/axp20x.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index da1e8ce35a7d..0a53eaea7cfa 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -141,6 +141,9 @@ static const struct mfd_cell axp152_cells[] = {
 	{
 		.name		= "axp20x-pek",
 	},
+	{
+		.name		= "axp20x-regulator",
+	},
 };
 
 static const struct mfd_cell axp288_cells[] = {
@@ -337,6 +340,8 @@ int axp20x_device_probe(struct axp20x_dev *axp20x)
 				     AXP806_REG_ADDR_EXT_ADDR_SLAVE_MODE);
 	}
 
+	axp20x->dev->priv = axp20x;
+
 	ret = mfd_add_devices(axp20x->dev, axp20x->cells, axp20x->nr_cells);
 	if (ret)
 		return dev_err_probe(axp20x->dev, ret, "failed to add MFD devices\n");
-- 
2.30.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-04  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  8:50 [PATCH] mfd: axp20x: export axp20x-regulator child for AXP152 Ahmad Fatoum
2022-10-04  7:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox