]> git.sur5r.net Git - u-boot/commitdiff
MX5: mx53evk: use new pmic driver
authorStefano Babic <sbabic@denx.de>
Sat, 8 Oct 2011 09:00:22 +0000 (11:00 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 27 Oct 2011 19:56:32 +0000 (21:56 +0200)
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <jason.hui@linaro.org>
Acked-by: Jason Liu <jason.hui@linaro.org>
board/freescale/mx53evk/mx53evk.c
include/configs/mx53evk.h

index fd821c0b1db9b77d9d8b7a34599a9ad6cf6032e0..eab9c5f7d4d7ebc56b2ce0eaaa47f1d45df5aad6 100644 (file)
@@ -32,6 +32,7 @@
 #include <i2c.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
+#include <pmic.h>
 #include <fsl_pmic.h>
 #include <asm/gpio.h>
 #include <mc13892.h>
@@ -124,12 +125,16 @@ static void setup_i2c(unsigned int port_number)
 void power_init(void)
 {
        unsigned int val;
+       struct pmic *p;
+
+       pmic_init();
+       p = get_pmic();
 
        /* Set VDDA to 1.25V */
-       val = pmic_reg_read(REG_SW_2);
+       pmic_reg_read(p, REG_SW_2, &val);
        val &= ~SWX_OUT_MASK;
        val |= SWX_OUT_1_25;
-       pmic_reg_write(REG_SW_2, val);
+       pmic_reg_write(p, REG_SW_2, val);
 
        /*
         * Need increase VCC and VDDA to 1.3V
@@ -137,16 +142,16 @@ void power_init(void)
         */
        if (is_soc_rev(CHIP_REV_2_0) == 0) {
                /* Set VCC to 1.3V for TO2 */
-               val = pmic_reg_read(REG_SW_1);
+               pmic_reg_read(p, REG_SW_1, &val);
                val &= ~SWX_OUT_MASK;
                val |= SWX_OUT_1_30;
-               pmic_reg_write(REG_SW_1, val);
+               pmic_reg_write(p, REG_SW_1, val);
 
                /* Set VDDA to 1.3V for TO2 */
-               val = pmic_reg_read(REG_SW_2);
+               pmic_reg_read(p, REG_SW_2, &val);
                val &= ~SWX_OUT_MASK;
                val |= SWX_OUT_1_30;
-               pmic_reg_write(REG_SW_2, val);
+               pmic_reg_write(p, REG_SW_2, val);
        }
 }
 
index 2033492961290bff7adb9465f7489c2bf10bb0a6..97ae2f2960ae2bb5c8984ce57cb17d09d2e87f99 100644 (file)
@@ -59,8 +59,9 @@
 #define CONFIG_SYS_I2C_SLAVE            0xfe
 
 /* PMIC Configs */
-#define CONFIG_FSL_PMIC
-#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR    8
 
 /* MMC Configs */