SDMMC:
authorxbw <xbw@rock-chips.com>
Fri, 25 Jan 2013 07:30:31 +0000 (15:30 +0800)
committerxbw <xbw@rock-chips.com>
Fri, 25 Jan 2013 07:30:31 +0000 (15:30 +0800)
unified engineering code version of SDMMC in your board-xxx.c
continue with the commit aa56711b7b8a1f7888bca60289a156ab3e5e9778

arch/arm/mach-rk3188/board-rk3188-ds1006h.c

index d8c46075dc50c200f590dd0de5f4865de46fc018..f61b97a0ac541798628bd85138de62701deeb554 100644 (file)
@@ -567,7 +567,9 @@ static struct platform_device device_ion = {
  * SDMMC devices,  include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
 **************************************************************************************************/
 #ifdef CONFIG_SDMMC_RK29
-#include "../mach-rk30/board-rk30-sdk-sdmmc.c"
+#include "board-rk3188-ds1006h-sdmmc-config.c"
+#include "../plat-rk/rk-sdmmc-ops.c"
+#include "../plat-rk/rk-sdmmc-wifi.c"
 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
 
 #ifdef CONFIG_SDMMC0_RK29
@@ -580,7 +582,8 @@ static int rk29_sdmmc0_cfg_gpio(void)
        iomux_set(MMC0_D1);
        iomux_set(MMC0_D2);
        iomux_set(MMC0_D3);
-       iomux_set(MMC0_DETN);
+
+       iomux_set_gpio_mode(iomux_mode_to_gpio(MMC0_DETN));
 
        gpio_request(RK30_PIN3_PA7, "sdmmc-power");
        gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);
@@ -589,9 +592,17 @@ static int rk29_sdmmc0_cfg_gpio(void)
        rk29_sdmmc_set_iomux(0, 0xFFFF);
 
     #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
+        #if SDMMC_USE_NEW_IOMUX_API
+        iomux_set_gpio_mode(iomux_gpio_to_mode(RK29SDK_SD_CARD_DETECT_N));
+        #else
         rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO);
+        #endif
     #else
-           rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX);
+        #if SDMMC_USE_NEW_IOMUX_API       
+        iomux_set(MMC0_DETN);
+        #else
+        rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX);
+        #endif
     #endif     
 
 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
@@ -675,12 +686,12 @@ struct rk29_sdmmc_platform_data default_sdmmc0_data = {
 static int rk29_sdmmc1_cfg_gpio(void)
 {
 #if defined(CONFIG_SDMMC_RK29_OLD)
-       iomux_set(MMC0_CMD);
-       iomux_set(MMC0_CLKOUT);
-       iomux_set(MMC0_D0);
-       iomux_set(MMC0_D1);
-       iomux_set(MMC0_D2);
-       iomux_set(MMC0_D3);
+       iomux_set(MMC1_CMD);
+       iomux_set(MMC1_CLKOUT);
+       iomux_set(MMC1_D0);
+       iomux_set(MMC1_D1);
+       iomux_set(MMC1_D2);
+       iomux_set(MMC1_D3);
 #else
 
 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)