summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2019-03-18 23:29:45 +0100
committerStefano Babic <sbabic@denx.de>2019-04-13 20:30:09 +0200
commitec837c82d7093140d834ff17995ec0a5417e88aa (patch)
tree5635b9033206d4a8316bf47233fcf458ff81ed4e /board
parentf99cd5a787208227e665a76002322a17fad2f1b2 (diff)
downloadu-boot-ec837c82d7093140d834ff17995ec0a5417e88aa.tar.gz
imx6: wandboard: convert to DM_PMIC
Enable DM_PMIC_PFUZE100 driver and add PMIC description to DTS. Rework power_init_board() code. Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'board')
-rw-r--r--board/wandboard/wandboard.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index e0d5769131..23589df932 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -453,24 +453,30 @@ int board_early_init_f(void)
int power_init_board(void)
{
- struct pmic *p;
- u32 reg;
-
- /* configure PFUZE100 PMIC */
- power_pfuze100_init(PMIC_I2C_BUS);
- p = pmic_get("PFUZE100");
- if (p && !pmic_probe(p)) {
- pmic_reg_read(p, PFUZE100_DEVICEID, &reg);
- printf("PMIC: PFUZE100 ID=0x%02x\n", reg);
- with_pmic = true;
-
- /* Set VGEN2 to 1.5V and enable */
- pmic_reg_read(p, PFUZE100_VGEN2VOL, &reg);
- reg &= ~(LDO_VOL_MASK);
- reg |= (LDOA_1_50V | (1 << (LDO_EN)));
- pmic_reg_write(p, PFUZE100_VGEN2VOL, reg);
+ struct udevice *dev;
+ int reg, ret;
+
+ puts("PMIC: ");
+
+ ret = pmic_get("pfuze100", &dev);
+ if (ret < 0) {
+ printf("pmic_get() ret %d\n", ret);
+ return 0;
}
+ reg = pmic_reg_read(dev, PFUZE100_DEVICEID);
+ if (reg < 0) {
+ printf("pmic_reg_read() ret %d\n", reg);
+ return 0;
+ }
+ printf("PMIC: PFUZE100 ID=0x%02x\n", reg);
+ with_pmic = true;
+
+ /* Set VGEN2 to 1.5V and enable */
+ reg = pmic_reg_read(dev, PFUZE100_VGEN2VOL);
+ reg &= ~(LDO_VOL_MASK);
+ reg |= (LDOA_1_50V | (1 << (LDO_EN)));
+ pmic_reg_write(dev, PFUZE100_VGEN2VOL, reg);
return 0;
}