From f7f3af18c7a9cffcb1e13ee3c6deadb45f2313a8 Mon Sep 17 00:00:00 2001 From: xbw Date: Sun, 9 Dec 2012 18:21:04 +0800 Subject: [PATCH] SDMMC: for RK3066B project Modify the difference between RK3066B and RK3066 architecture platform. --- arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c | 135 ++++++++++++++++------ arch/arm/mach-rk30/board-rk3066b-m701.c | 95 +++++++++------ arch/arm/mach-rk30/board-rk3066b-sdk.c | 95 +++++++++------ 3 files changed, 218 insertions(+), 107 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c index 47f653fbcd64..b181c6547f2b 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c @@ -84,9 +84,9 @@ #define RK29SDK_SD_CARD_INSERT_LEVEL GPIO_LOW // set the voltage of insert-card. Please pay attention to the default setting. #define RK29SDK_SD_CARD_DETECT_PIN_NAME GPIO3B0_SDMMC0DETECTN_NAME #define RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO GPIO3B_GPIO3B0 -#define RK29SDK_SD_CARD_DETECT_IOMUX_FMUX GPIO3B_SDMMC0_DETECT_N +#define RK29SDK_SD_CARD_DETECT_IOMUX_FMUX GPIO3B_SDMMC0DETECTN -#elif defined(CONFIG_ARCH_RK30) +#elif defined(CONFIG_ARCH_RK30)&& !defined(CONFIG_ARCH_RK3066B) //for RK30,RK3066 SDK //refer to file /arch/arm/mach-rk30/include/mach/Iomux.h //define reset-pin #define RK29SDK_SD_CARD_DETECT_N RK30_PIN3_PB6 //According to your own project to set the value of card-detect-pin. @@ -119,7 +119,8 @@ // Define wifi module's power and reset gpio, and gpio sensitive level. // Please set the value according to your own project. // -#if defined(CONFIG_ARCH_RK30) // refer to file /arch/arm/mach-rk30/include/mach/Iomux.h +#if defined(CONFIG_ARCH_RK30) && !defined(CONFIG_ARCH_RK3066B) //for RK30,RK3066 SDK + // refer to file /arch/arm/mach-rk30/include/mach/Iomux.h #define WIFI_HOST_WAKE RK30_PIN3_PD2 #if defined(CONFIG_RK903) || defined(CONFIG_RK901) || defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) @@ -346,18 +347,18 @@ #if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH - #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_NAME + #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_MIIMD_NAME #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3D_GPIO3D0 #elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RK903) || defined(CONFIG_RK901) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH - #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_NAME + #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_MIIMD_NAME #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3D_GPIO3D0 #define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN2_PA7 #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH - #define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO2A7_LCDC1DATA7_SMCADDR11_NAME + #define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO2A7_LCDC1DATA7_SMCDATA7_TRACEDATA7_NAME #define RK30SDK_WIFI_GPIO_RESET_IOMUX_FGPIO GPIO2A_GPIO2A7 #endif #elif defined(CONFIG_ARCH_RK2928) //refer to file ./arch/arm/mach-rk2928/include/mach/iomux.h @@ -419,7 +420,7 @@ #define RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO GPIO3A_GPIO3A1 #define RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX GPIO3A_SDMMC0PWREN -#elif defined(CONFIG_ARCH_RK30) +#elif defined(CONFIG_ARCH_RK30)&& !defined(CONFIG_ARCH_RK3066B) //for RK30,RK3066 SDK //refer to file /arch/arm/mach-rk30/include/mach/Iomux.h //define PowerEn-pin #define RK29SDK_SD_CARD_PWR_EN RK30_PIN3_PA7 @@ -439,7 +440,7 @@ #endif -#if defined(CONFIG_ARCH_RK30) +#if defined(CONFIG_ARCH_RK30)&& !defined(CONFIG_ARCH_RK3066B)//for RK30,RK3066 SDK /* * define the gpio for sdmmc0 */ @@ -504,26 +505,48 @@ struct rksdmmc_gpio_board rksdmmc0_gpio_init = { .fmux = GPIO3B_SDMMC0_DATA3, }, }, - - .power_en_gpio = { + + .power_en_gpio = { +#if defined(RK29SDK_SD_CARD_PWR_EN) || (INVALID_GPIO != RK29SDK_SD_CARD_PWR_EN) .io = RK29SDK_SD_CARD_PWR_EN, .enable = RK29SDK_SD_CARD_PWR_EN_LEVEL, + #ifdef RK29SDK_SD_CARD_PWR_EN_PIN_NAME .iomux = { .name = RK29SDK_SD_CARD_PWR_EN_PIN_NAME, + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO .fgpio = RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX .fmux = RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX, + #endif }, + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif }, .detect_irq = { +#if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N) .io = RK29SDK_SD_CARD_DETECT_N, .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME .iomux = { .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + #endif }, - }, + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif + }, }; @@ -592,7 +615,7 @@ static struct rksdmmc_gpio_board rksdmmc1_gpio_init = { }, }, }; - // ---end -#if defined(CONFIG_ARCH_RK30) + // ---end -#if defined(CONFIG_ARCH_RK30)&& !defined(CONFIG_ARCH_RK3066B) #elif defined(CONFIG_ARCH_RK3066B) @@ -661,25 +684,49 @@ static struct rksdmmc_gpio_board rksdmmc0_gpio_init = { }, }, - .power_en_gpio = { - .io = RK29SDK_SD_CARD_PWR_EN, - .enable = RK29SDK_SD_CARD_PWR_EN_LEVEL, - .iomux = { - .name = RK29SDK_SD_CARD_PWR_EN_PIN_NAME, - .fgpio = RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO, - .fmux = RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX, - }, - }, + + .power_en_gpio = { +#if defined(RK29SDK_SD_CARD_PWR_EN) || (INVALID_GPIO != RK29SDK_SD_CARD_PWR_EN) + .io = RK29SDK_SD_CARD_PWR_EN, + .enable = RK29SDK_SD_CARD_PWR_EN_LEVEL, + #ifdef RK29SDK_SD_CARD_PWR_EN_PIN_NAME + .iomux = { + .name = RK29SDK_SD_CARD_PWR_EN_PIN_NAME, + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO + .fgpio = RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX + .fmux = RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX, + #endif + }, + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif + }, + + .detect_irq = { +#if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N) + .io = RK29SDK_SD_CARD_DETECT_N, + .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME + .iomux = { + .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO + .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX + .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + #endif + }, + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif + }, - .detect_irq = { - .io = RK29SDK_SD_CARD_DETECT_N, - .enable = RK29SDK_SD_CARD_INSERT_LEVEL, - .iomux = { - .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, - .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, - .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, - }, - }, }; @@ -816,26 +863,48 @@ static struct rksdmmc_gpio_board rksdmmc0_gpio_init = { }, }, - .power_en_gpio = { + + .power_en_gpio = { +#if defined(RK29SDK_SD_CARD_PWR_EN) || (INVALID_GPIO != RK29SDK_SD_CARD_PWR_EN) .io = RK29SDK_SD_CARD_PWR_EN, .enable = RK29SDK_SD_CARD_PWR_EN_LEVEL, + #ifdef RK29SDK_SD_CARD_PWR_EN_PIN_NAME .iomux = { .name = RK29SDK_SD_CARD_PWR_EN_PIN_NAME, + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO .fgpio = RK29SDK_SD_CARD_PWR_EN_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX .fmux = RK29SDK_SD_CARD_PWR_EN_IOMUX_FMUX, + #endif }, + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif }, .detect_irq = { +#if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N) .io = RK29SDK_SD_CARD_DETECT_N, .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME .iomux = { .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + #endif + #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + #endif }, - }, - + #endif +#else + .io = INVALID_GPIO, + .enable = GPIO_LOW, +#endif + }, }; diff --git a/arch/arm/mach-rk30/board-rk3066b-m701.c b/arch/arm/mach-rk30/board-rk3066b-m701.c index d2bc45181c77..b03d6ecd7551 100755 --- a/arch/arm/mach-rk30/board-rk3066b-m701.c +++ b/arch/arm/mach-rk30/board-rk3066b-m701.c @@ -951,23 +951,12 @@ static struct platform_device device_ion = { #endif /************************************************************************************************** - * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05 + * SDMMC devices, include the module of SD,MMC,and SDIO.noted by xbw at 2012-03-05 **************************************************************************************************/ #ifdef CONFIG_SDMMC_RK29 -#include "board-rk3066b-sdk-sdmmc.c" - -#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) -#define SDMMC0_WRITE_PROTECT_PIN RK30_PIN3_PB7 //According to your own project to set the value of write-protect-pin. -#endif - -#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) -#define SDMMC1_WRITE_PROTECT_PIN RK30_PIN3_PC7 //According to your own project to set the value of write-protect-pin. +#include "board-rk30-sdk-sdmmc.c" #endif -#define RK29SDK_WIFI_SDIO_CARD_DETECT_N RK30_PIN6_PB2 - -#endif //endif ---#ifdef CONFIG_SDMMC_RK29 - #ifdef CONFIG_SDMMC0_RK29 static int rk29_sdmmc0_cfg_gpio(void) { @@ -986,14 +975,18 @@ static int rk29_sdmmc0_cfg_gpio(void) gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW); #else - rk29_sdmmc_set_iomux(0, 0xFFFF); + rk29_sdmmc_set_iomux(0, 0xFFFF); - rk30_mux_api_set(GPIO3B0_SDMMC0DETECTN_NAME, GPIO3B_SDMMC0DETECTN); + #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO) + rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO); + #else + rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX); + #endif -#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) - gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp"); - gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN); -#endif + #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) + gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp"); + gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN); + #endif #endif @@ -1020,14 +1013,33 @@ struct rk29_sdmmc_platform_data default_sdmmc0_data = { #else .use_dma = 0, #endif - .detect_irq = RK30_PIN3_PB6, // INVALID_GPIO + +#if defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) && defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD) + .status = rk29sdk_wifi_mmc0_status, + .register_status_notify = rk29sdk_wifi_mmc0_status_register, +#endif + + .power_en = RK29SDK_SD_CARD_PWR_EN, + .power_en_level = RK29SDK_SD_CARD_PWR_EN_LEVEL, + .enable_sd_wakeup = 0, #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) .write_prt = SDMMC0_WRITE_PROTECT_PIN, + .write_prt_enalbe_level = SDMMC0_WRITE_PROTECT_ENABLE_VALUE; #else .write_prt = INVALID_GPIO, #endif + + .det_pin_info = { + .io = RK29SDK_SD_CARD_DETECT_N, //INVALID_GPIO, + .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + .iomux = { + .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + }, + }, }; #endif // CONFIG_SDMMC0_RK29 @@ -1042,8 +1054,6 @@ static int rk29_sdmmc1_cfg_gpio(void) rk30_mux_api_set(GPIO3C2_SDMMC1DATA1_NAME, GPIO3C_SDMMC1_DATA1); rk30_mux_api_set(GPIO3C3_SDMMC1DATA2_NAME, GPIO3C_SDMMC1_DATA2); rk30_mux_api_set(GPIO3C4_SDMMC1DATA3_NAME, GPIO3C_SDMMC1_DATA3); - //rk30_mux_api_set(GPIO3C6_SDMMC1DETECTN_NAME, GPIO3C_SDMMC1_DETECT_N); - #else #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) @@ -1083,26 +1093,37 @@ struct rk29_sdmmc_platform_data default_sdmmc1_data = { .use_dma = 0, #endif -#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD) -#ifdef CONFIG_WIFI_CONTROL_FUNC - .status = rk29sdk_wifi_status, - .register_status_notify = rk29sdk_wifi_status_register, -#endif -#if 0 - .detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N, +#if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) + .status = rk29sdk_wifi_status, + .register_status_notify = rk29sdk_wifi_status_register, #endif -#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) - .write_prt = SDMMC1_WRITE_PROTECT_PIN, -#else - .write_prt = INVALID_GPIO, -#endif + #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) + .write_prt = SDMMC1_WRITE_PROTECT_PIN, + .write_prt_enalbe_level = SDMMC1_WRITE_PROTECT_ENABLE_VALUE; + #else + .write_prt = INVALID_GPIO, + #endif + + #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO) + .sdio_INT_gpio = RK29SDK_WIFI_SDIO_CARD_INT, + #endif + .det_pin_info = { +#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD) + .io = RK29SDK_SD_CARD_DETECT_N, #else - .detect_irq = INVALID_GPIO, - .enable_sd_wakeup = 0, + .io = INVALID_GPIO, #endif - + .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + .iomux = { + .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + }, + }, + + .enable_sd_wakeup = 0, }; #endif //endif--#ifdef CONFIG_SDMMC1_RK29 diff --git a/arch/arm/mach-rk30/board-rk3066b-sdk.c b/arch/arm/mach-rk30/board-rk3066b-sdk.c index f5ccbc0b056f..03abe99aeaf7 100755 --- a/arch/arm/mach-rk30/board-rk3066b-sdk.c +++ b/arch/arm/mach-rk30/board-rk3066b-sdk.c @@ -794,23 +794,12 @@ static struct platform_device device_ion = { #endif /************************************************************************************************** - * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05 + * SDMMC devices, include the module of SD,MMC,and SDIO.noted by xbw at 2012-03-05 **************************************************************************************************/ #ifdef CONFIG_SDMMC_RK29 -#include "board-rk3066b-sdk-sdmmc.c" - -#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) -#define SDMMC0_WRITE_PROTECT_PIN RK30_PIN3_PB7 //According to your own project to set the value of write-protect-pin. -#endif - -#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) -#define SDMMC1_WRITE_PROTECT_PIN RK30_PIN3_PC7 //According to your own project to set the value of write-protect-pin. +#include "board-rk30-sdk-sdmmc.c" #endif -#define RK29SDK_WIFI_SDIO_CARD_DETECT_N RK30_PIN6_PB2 - -#endif //endif ---#ifdef CONFIG_SDMMC_RK29 - #ifdef CONFIG_SDMMC0_RK29 static int rk29_sdmmc0_cfg_gpio(void) { @@ -829,14 +818,18 @@ static int rk29_sdmmc0_cfg_gpio(void) gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW); #else - rk29_sdmmc_set_iomux(0, 0xFFFF); + rk29_sdmmc_set_iomux(0, 0xFFFF); - rk30_mux_api_set(GPIO3B0_SDMMC0DETECTN_NAME, GPIO3B_SDMMC0DETECTN); + #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO) + rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO); + #else + rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX); + #endif -#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) - gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp"); - gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN); -#endif + #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) + gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp"); + gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN); + #endif #endif @@ -863,14 +856,33 @@ struct rk29_sdmmc_platform_data default_sdmmc0_data = { #else .use_dma = 0, #endif - .detect_irq = RK30_PIN3_PB6, // INVALID_GPIO + +#if defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) && defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD) + .status = rk29sdk_wifi_mmc0_status, + .register_status_notify = rk29sdk_wifi_mmc0_status_register, +#endif + + .power_en = RK29SDK_SD_CARD_PWR_EN, + .power_en_level = RK29SDK_SD_CARD_PWR_EN_LEVEL, + .enable_sd_wakeup = 0, #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT) .write_prt = SDMMC0_WRITE_PROTECT_PIN, + .write_prt_enalbe_level = SDMMC0_WRITE_PROTECT_ENABLE_VALUE; #else .write_prt = INVALID_GPIO, #endif + + .det_pin_info = { + .io = RK29SDK_SD_CARD_DETECT_N, //INVALID_GPIO, + .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + .iomux = { + .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + }, + }, }; #endif // CONFIG_SDMMC0_RK29 @@ -885,8 +897,6 @@ static int rk29_sdmmc1_cfg_gpio(void) rk30_mux_api_set(GPIO3C2_SDMMC1DATA1_NAME, GPIO3C_SDMMC1_DATA1); rk30_mux_api_set(GPIO3C3_SDMMC1DATA2_NAME, GPIO3C_SDMMC1_DATA2); rk30_mux_api_set(GPIO3C4_SDMMC1DATA3_NAME, GPIO3C_SDMMC1_DATA3); - //rk30_mux_api_set(GPIO3C6_SDMMC1DETECTN_NAME, GPIO3C_SDMMC1_DETECT_N); - #else #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) @@ -926,26 +936,37 @@ struct rk29_sdmmc_platform_data default_sdmmc1_data = { .use_dma = 0, #endif -#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD) -#ifdef CONFIG_WIFI_CONTROL_FUNC - .status = rk29sdk_wifi_status, - .register_status_notify = rk29sdk_wifi_status_register, -#endif -#if 0 - .detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N, +#if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) + .status = rk29sdk_wifi_status, + .register_status_notify = rk29sdk_wifi_status_register, #endif -#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) - .write_prt = SDMMC1_WRITE_PROTECT_PIN, -#else - .write_prt = INVALID_GPIO, -#endif + #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT) + .write_prt = SDMMC1_WRITE_PROTECT_PIN, + .write_prt_enalbe_level = SDMMC1_WRITE_PROTECT_ENABLE_VALUE; + #else + .write_prt = INVALID_GPIO, + #endif + + #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO) + .sdio_INT_gpio = RK29SDK_WIFI_SDIO_CARD_INT, + #endif + .det_pin_info = { +#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD) + .io = RK29SDK_SD_CARD_DETECT_N, #else - .detect_irq = INVALID_GPIO, - .enable_sd_wakeup = 0, + .io = INVALID_GPIO, #endif - + .enable = RK29SDK_SD_CARD_INSERT_LEVEL, + .iomux = { + .name = RK29SDK_SD_CARD_DETECT_PIN_NAME, + .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO, + .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX, + }, + }, + + .enable_sd_wakeup = 0, }; #endif //endif--#ifdef CONFIG_SDMMC1_RK29 -- 2.34.1