summaryrefslogtreecommitdiff
path: root/board/warp7
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2019-01-18 17:40:14 +0000
committerStefano Babic <sbabic@denx.de>2019-01-28 20:55:46 +0100
commit8ba377321c862a7498458972618f0278c6c2043b (patch)
treedf0a931d30d21e5af0f09b01596903a9f10b9df1 /board/warp7
parentce36f56aca33fcfb736f213d5b187fff59b6dd4f (diff)
arm: imx7s-warp: Convert to DM PMIC
This patch converts the warp7 and warp7_bl33 board ports over to using the DM PMIC model. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'board/warp7')
-rw-r--r--board/warp7/warp7.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 19f0df4d097..6ebeb08e331 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -64,29 +64,24 @@ int board_early_init_f(void)
return 0;
}
-#ifdef CONFIG_POWER
-#define I2C_PMIC 0
-static struct pmic *pfuze;
+#ifdef CONFIG_DM_PMIC
int power_init_board(void)
{
- int ret;
- unsigned int reg, rev_id;
+ struct udevice *dev;
+ int ret, dev_id, rev_id;
- ret = power_pfuze3000_init(I2C_PMIC);
- if (ret)
+ ret = pmic_get("pfuze3000", &dev);
+ if (ret == -ENODEV)
+ return 0;
+ if (ret != 0)
return ret;
- pfuze = pmic_get("PFUZE3000");
- ret = pmic_probe(pfuze);
- if (ret)
- return ret;
-
- pmic_reg_read(pfuze, PFUZE3000_DEVICEID, &reg);
- pmic_reg_read(pfuze, PFUZE3000_REVID, &rev_id);
- printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id);
+ dev_id = pmic_reg_read(dev, PFUZE3000_DEVICEID);
+ rev_id = pmic_reg_read(dev, PFUZE3000_REVID);
+ printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", dev_id, rev_id);
/* disable Low Power Mode during standby mode */
- pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1);
+ pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
return 0;
}