/*
* define the card-detect-pin.
-* define reset-pin
*/
#define RK29SDK_SD_CARD_DETECT_N RK30_PIN3_PB0 //According to your own project to set the value of card-detect-pin.
-#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_INSERT_LEVEL GPIO_LOW // set the voltage of insert-card. Please pay attention to the default setting.
/*
* Define wifi module's power and reset gpio, and gpio sensitive level.
#endif
#elif defined(CONFIG_MT6620)
- #define COMBO_MODULE_MT6620_CDT 1 //- 1--use Cdtech chip; 0--unuse CDT chip
+ #define COMBO_MODULE_MT6620_CDT 1 // to control antsel2,antsel3 and gps_lan foot when using AcSip or Cdtech chip.
+ //- 1--use Cdtech chip; 0--unuse CDT chip
+
//power, PMU_EN
#define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PC7
#define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH
#if defined(CONFIG_SDMMC1_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
- #if !defined(CONFIG_MT5931) && !defined(CONFIG_MT5931_MT6622)
+ #if !defined(CONFIG_MT5931) && !defined(CONFIG_MT5931_MT6622)
+ #if !(!!SDMMC_USE_NEW_IOMUX_API)
rk29_mux_api_set(rksdmmc1_gpio_init.data1_gpio.iomux.name, rksdmmc1_gpio_init.data1_gpio.iomux.fgpio);
+ #endif
gpio_request(rksdmmc1_gpio_init.data1_gpio.io, "mmc1-data1");
gpio_direction_output(rksdmmc1_gpio_init.data1_gpio.io,GPIO_LOW);//set mmc1-data1 to low.
+ #if !(!!SDMMC_USE_NEW_IOMUX_API)
rk29_mux_api_set(rksdmmc1_gpio_init.data2_gpio.iomux.name, rksdmmc1_gpio_init.data2_gpio.iomux.fgpio);
+ #endif
gpio_request(rksdmmc1_gpio_init.data2_gpio.io, "mmc1-data2");
gpio_direction_output(rksdmmc1_gpio_init.data2_gpio.io,GPIO_LOW);//set mmc1-data2 to low.
+ #if !(!!SDMMC_USE_NEW_IOMUX_API)
rk29_mux_api_set(rksdmmc1_gpio_init.data3_gpio.iomux.name, rksdmmc1_gpio_init.data3_gpio.iomux.fgpio);
+ #endif
gpio_request(rksdmmc1_gpio_init.data3_gpio.io, "mmc1-data3");
gpio_direction_output(rksdmmc1_gpio_init.data3_gpio.io,GPIO_LOW);//set mmc1-data3 to low.
#endif
rk30_mux_api_set(rk_platform_wifi_gpio.ANTSEL3.iomux.name, rk_platform_wifi_gpio.ANTSEL3.iomux.fgpio);
#endif
gpio_request(rk_platform_wifi_gpio.ANTSEL3.io, "combo-ANTSEL3");
- gpio_direction_output(rk_platform_wifi_gpio.ANTSEL3.io, rk_platform_wifi_gpio.ANTSEL3.enable);
+ gpio_direction_output(rk_platform_wifi_gpio.ANTSEL3.io, !(rk_platform_wifi_gpio.ANTSEL3.enable));
#endif
//GPS_LAN
{
if(on)
{
+ #ifdef RK30SDK_WIFI_GPIO_ANTSEL2
+ gpio_direction_output(rk_platform_wifi_gpio.ANTSEL2.io, rk_platform_wifi_gpio.ANTSEL2.enable);
+ #endif
+
+ #ifdef RK30SDK_WIFI_GPIO_ANTSEL3
+ gpio_direction_output(rk_platform_wifi_gpio.ANTSEL3.io, rk_platform_wifi_gpio.ANTSEL3.enable);
+ #endif
+
+ #ifdef RK30SDK_WIFI_GPIO_GPS_LAN
+ gpio_direction_output(rk_platform_wifi_gpio.GPS_LAN.io, rk_platform_wifi_gpio.GPS_LAN.enable);
+ #endif
+
#ifdef RK30SDK_WIFI_GPIO_VCCIO_WL
gpio_set_value(rk_platform_wifi_gpio.vddio.io, rk_platform_wifi_gpio.vddio.enable);
mdelay(10);
gpio_set_value(rk_platform_wifi_gpio.power_n.io, !(rk_platform_wifi_gpio.power_n.enable) );
mdelay(10);
+ #ifdef RK30SDK_WIFI_GPIO_ANTSEL2
+ //Because the foot is pulled low, therefore, continue to remain low
+ gpio_direction_output(rk_platform_wifi_gpio.ANTSEL2.io, rk_platform_wifi_gpio.ANTSEL2.enable);
+ #endif
+
+ #ifdef RK30SDK_WIFI_GPIO_ANTSEL3
+ gpio_direction_output(rk_platform_wifi_gpio.ANTSEL3.io, !(rk_platform_wifi_gpio.ANTSEL3.enable));
+ #endif
+
+ #ifdef RK30SDK_WIFI_GPIO_GPS_LAN
+ gpio_direction_output(rk_platform_wifi_gpio.GPS_LAN.io, !(rk_platform_wifi_gpio.GPS_LAN.enable));
+ #endif
+
#ifdef RK30SDK_WIFI_GPIO_VCCIO_WL
gpio_set_value(rk_platform_wifi_gpio.vddio.io, !(rk_platform_wifi_gpio.vddio.enable));
#endif
int ret;
struct rk29_sdmmc *host = container_of(work, struct rk29_sdmmc, work.work);
- rk29_sdmmc_hw_init(host);
-
rk28_send_wakeup_key();
rk29_sdmmc_detect_change(host);
}
int ret = 0;
#if !defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
rk29_sdmmc_enable_irq(host,false);
- #if !(!!SDMMC_USE_NEW_IOMUX_API)
+ #if (defined(SDMMC_USE_NEW_IOMUX_API) && SDMMC_USE_NEW_IOMUX_API)
+ //need not to change mode to gpio.
+ #else
rk29_mux_api_set(host->det_pin.iomux.name, host->det_pin.iomux.fgpio);
#endif
gpio_request(host->det_pin.io, "sd_detect");
disable_irq_wake(host->gpio_irq);
free_irq(host->gpio_irq,host);
gpio_free(host->det_pin.io);
- #if SDMMC_USE_NEW_IOMUX_API
+ #if (defined(SDMMC_USE_NEW_IOMUX_API)&& SDMMC_USE_NEW_IOMUX_API)
iomux_set(MMC0_DETN);
#else
rk29_mux_api_set(host->det_pin.iomux.name, host->det_pin.iomux.fmux);