summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2019-10-02 15:09:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-14 14:03:24 +0200
commit94e2382281ba950d63df78ead7fc5ca9aad72cda (patch)
tree578a9bd20457f3803cc71fc41c8162953af4adfa /arch/arm/boards
parent84cf5cfa9a0ee963673a197b2a5b8a576054603b (diff)
downloadbarebox-94e2382281ba950d63df78ead7fc5ca9aad72cda.tar.gz
barebox-94e2382281ba950d63df78ead7fc5ca9aad72cda.tar.xz
ARM: i.MX: phytec-som-imx6: phycore: fix updating pmic regulators
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/phytec-som-imx6/board.c8
1 files 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;