diff mbox

[U-Boot,v2,4/4] imx: imx6q/dlsabreauto: Add PMIC Pfuze100 support

Message ID 1410754306-17261-4-git-send-email-B37916@freescale.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Ye.Li Sept. 15, 2014, 4:11 a.m. UTC
Initialize the pfuze100 at board late init.

Signed-off-by: Ye.Li <B37916@freescale.com>
---
Changes since v1:
- Factorize the pfuze init function for sabre boards.

 board/freescale/mx6qsabreauto/mx6qsabreauto.c |   20 ++++++++++++++++++--
 include/configs/mx6qsabreauto.h               |    6 ++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index bfb9b6a..fbb65c2 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -1,5 +1,5 @@ 
 /*
- * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2012-2014 Freescale Semiconductor, Inc.
  *
  * Author: Fabio Estevam <fabio.estevam@freescale.com>
  *
@@ -23,7 +23,8 @@ 
 #include <netdev.h>
 #include <asm/arch/sys_proto.h>
 #include <i2c.h>
-
+#include <power/pmic.h>
+#include "../common/pfuze.h"
 DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
@@ -43,6 +44,8 @@  DECLARE_GLOBAL_DATA_PTR;
 
 #define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
 
+#define I2C_PMIC	1
+
 int dram_init(void)
 {
 	gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
@@ -259,6 +262,18 @@  int board_init(void)
 	return 0;
 }
 
+static int pfuze_init(void)
+{
+	struct pmic *p;
+
+	p = pfuze_common_init(I2C_PMIC);
+	if (!p)
+		return -ENODEV;
+
+	return 0;
+}
+
+
 #ifdef CONFIG_CMD_BMODE
 static const struct boot_mode board_boot_modes[] = {
 	/* 4 bit bus width */
@@ -272,6 +287,7 @@  int board_late_init(void)
 #ifdef CONFIG_CMD_BMODE
 	add_board_boot_modes(board_boot_modes);
 #endif
+	pfuze_init();
 
 	return 0;
 }
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h
index e8580e6..d82563f 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -40,6 +40,12 @@ 
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED		100000
 
+/* PMIC */
+#define CONFIG_POWER
+#define CONFIG_POWER_I2C
+#define CONFIG_POWER_PFUZE100
+#define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
+
 #define CONFIG_OF_SEPARATE
 #define CONFIG_DEFAULT_DEVICE_TREE   imx6q-sabreauto