OMAP3 Move twl4030 mmc function
authorTom Rix <Tom.Rix@windriver.com>
Sun, 28 Jun 2009 17:52:31 +0000 (12:52 -0500)
committerHeiko Schocher <hs@denx.de>
Wed, 29 Jul 2009 07:57:43 +0000 (09:57 +0200)
Because twl4030 now has its own device files, move and rename
twl4030_mmc_config.

twl4030_mmc_config initializes the twl4030 power setting to
the mmc device.  Because it is in the twl4030 power domain, move
it out of drivers/mmc/omap3_mmc.c and into drivers/power/twl4030.c.

The function was renamed to twl4030_power_mmc_init because all
the functions in this file are to have the format

twl4030_power_<device>_<action>

In this case the suffix is mmc_init so
device : mmc
action : init

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Heiko Schocher <hs@denx.de>
drivers/mmc/omap3_mmc.c
drivers/power/twl4030.c
include/configs/omap3_evm.h
include/twl4030.h

index e90db7ee3378c42efc6f0e292563ad9987b420da..9e09434c10f550e1c0de064c45d3a07e50baf05a 100644 (file)
@@ -28,6 +28,7 @@
 #include <mmc.h>
 #include <part.h>
 #include <i2c.h>
+#include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mmc.h>
 
@@ -58,21 +59,11 @@ block_dev_desc_t *mmc_get_dev(int dev)
        return (block_dev_desc_t *) &mmc_blk_dev;
 }
 
-void twl4030_mmc_config(void)
-{
-       unsigned char data;
-
-       data = DEV_GRP_P1;
-       i2c_write(PWRMGT_ADDR_ID4, VMMC1_DEV_GRP, 1, &data, 1);
-       data = VMMC1_VSEL_30;
-       i2c_write(PWRMGT_ADDR_ID4, VMMC1_DEDICATED, 1, &data, 1);
-}
-
 unsigned char mmc_board_init(void)
 {
        t2_t *t2_base = (t2_t *)T2_BASE;
 
-       twl4030_mmc_config();
+       twl4030_power_mmc_init();
 
        writel(readl(&t2_base->pbias_lite) | PBIASLITEPWRDNZ1 |
                PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
index c93b51f695d16e57548b048b2c209405a1c63363..eb066cb58dff11c78b4498e3d3264a23c7b748a6 100644 (file)
@@ -98,3 +98,18 @@ void twl4030_power_init(void)
                             TWL4030_PM_RECEIVER_VDAC_DEDICATED);
 }
 
+#define VMMC1_VSEL_30          0x02
+
+void twl4030_power_mmc_init(void)
+{
+       unsigned char byte;
+
+       byte = DEV_GRP_P1;
+       twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
+                            TWL4030_PM_RECEIVER_VMMC1_DEV_GRP);
+
+       /* 3 Volts */
+       byte = VMMC1_VSEL_30;
+       twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
+                            TWL4030_PM_RECEIVER_VMMC1_DEDICATED);
+}
index 3d9d72caf3bc4a3b40b0503f714b79fccd707069..809198b0f8f753ff89becd05eef1197c6173c5b8 100644 (file)
 #define CONFIG_SYS_I2C_BUS_SELECT      1
 #define CONFIG_DRIVER_OMAP34XX_I2C     1
 
+/*
+ * TWL4030
+ */
+#define CONFIG_TWL4030_POWER           1
+
 /*
  * Board NAND Info.
  */
index eb27ec5b2ad71ecb5e7748b3ac78a64fd0f85eb3..f260ecb8b12ad565c651a9512073c0eff7493249 100644 (file)
@@ -390,6 +390,9 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
 void twl4030_power_reset_init(void);
 /* For initializing power device */
 void twl4030_power_init(void);
+/* For initializing mmc power */
+void twl4030_power_mmc_init(void);
+
 /*
  * LED
  */