From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org, s.christ@phytec.de,
j.remmet@phytec.de, s.riedmueller@phytec.de, c.hemp@phytec.de
Cc: mfe@pengutronix.de
Subject: [PATCH v2] ARM: i.MX: phytec-som-imx6: phycore: fix updating pmic regulators
Date: Wed, 2 Oct 2019 15:09:59 +0200 [thread overview]
Message-ID: <20191002130959.2856-1-m.felsch@pengutronix.de> (raw)
Currently the fixup code assumes that only one i2c bus is active. If we
reuse the board code for other boards this isn't always true. Fix that
by using of_find_i2c_adapter_by_node() to address both cases.
Fixes: b6bebb7aca ("ARM: i.MX: phytec-som-imx6: phycore: Set BUCK mode to SYNC")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
Changelog:
v2:
- Make use of of_find_i2c_adapter_by_node() to get the right adapter.
---
arch/arm/boards/phytec-som-imx6/board.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c
index 730115702b..27a1ad4f66 100644
--- a/arch/arm/boards/phytec-som-imx6/board.c
+++ b/arch/arm/boards/phytec-som-imx6/board.c
@@ -115,12 +115,16 @@ static int ksz8081_phy_fixup(struct phy_device *phydev)
static int phycore_da9062_setup_buck_mode(void)
{
struct i2c_adapter *adapter = NULL;
+ struct device_node *pmic_np = NULL;
struct i2c_client client;
unsigned char value;
- int bus = 0;
int ret;
- adapter = i2c_get_adapter(bus);
+ pmic_np = of_find_node_by_name(NULL, "pmic@58");
+ if (!pmic_np)
+ return -ENODEV;
+
+ adapter = of_find_i2c_adapter_by_node(pmic_np->parent);
if (!adapter)
return -ENODEV;
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2019-10-02 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 13:09 Marco Felsch [this message]
2019-10-04 7:58 ` Stefan Riedmüller
2019-10-14 12:04 ` 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=20191002130959.2856-1-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=c.hemp@phytec.de \
--cc=j.remmet@phytec.de \
--cc=mfe@pengutronix.de \
--cc=s.christ@phytec.de \
--cc=s.riedmueller@phytec.de \
/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