mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] mfd: axp20x: export axp20x-regulator child for AXP152
Date: Wed, 28 Sep 2022 10:50:52 +0200	[thread overview]
Message-ID: <20220928085052.2599436-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2022-09-28  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  8:50 Ahmad Fatoum [this message]
2022-10-04  7:47 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220928085052.2599436-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox