From: gwl Date: Tue, 23 Jul 2013 07:09:21 +0000 (+0800) Subject: add broadcom wifi OOB support, gpio resource & sdio irq. X-Git-Tag: firefly_0821_release~6857^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=740f63bc5307c59b9079b272c16356d806f8daae;p=firefly-linux-kernel-4.4.55.git add broadcom wifi OOB support, gpio resource & sdio irq. --- diff --git a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c index f419cedb898a..05fb97b430f6 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c @@ -130,7 +130,6 @@ // #if defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188)//refer to file /arch/arm/mach-rk30/include/mach/iomux-rk3066b.h - #define WIFI_HOST_WAKE RK30_PIN3_PD2 #if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) || defined(CONFIG_RTL8723AU) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 @@ -144,6 +143,10 @@ #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME "wifi_power" #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3_D0 + //wake up host gpio + #define RK30SDK_WIFI_GPIO_WIFI_INT_B RK30_PIN3_PD2 + #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH + #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 "wifi_reset" @@ -176,7 +179,6 @@ #endif #elif defined(CONFIG_ARCH_RK2928) //refer to file ./arch/arm/mach-rk2928/include/mach/iomux.h - #define WIFI_HOST_WAKE RK2928_PIN3_PC0 #if defined(CONFIG_RKWIFI) || defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RTL8189ES) #define RK30SDK_WIFI_GPIO_POWER_N RK2928_PIN0_PD6 @@ -186,6 +188,9 @@ #define RK30SDK_WIFI_GPIO_RESET_N RK2928_PIN3_PC2 #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH + //wake up host gpio + #define RK30SDK_WIFI_GPIO_WIFI_INT_B RK2928_PIN3_PC0 + #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH //You need not define the pin-iomux-name due to the pin only used gpio. //#define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO3C2_SDMMC1DATA1_NAME //#define RK30SDK_WIFI_GPIO_RESET_IOMUX_FGPIO GPIO3C_GPIO3C2 @@ -212,7 +217,6 @@ #else //default 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_RKWIFI) || defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) || defined(CONFIG_RTL8723AU) \ || defined(CONFIG_RTL8189ES) @@ -222,6 +226,9 @@ //reset #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_NAME #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3D_GPIO3D0 + //wake up host gpio + #define RK30SDK_WIFI_GPIO_WIFI_INT_B RK30_PIN3_PD2 + #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH #elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) //power @@ -1790,8 +1797,8 @@ EXPORT_SYMBOL(rk29sdk_wifi_set_carddetect); static struct resource resources[] = { { - .start = WIFI_HOST_WAKE, - .flags = IORESOURCE_IRQ, + .start = RK30SDK_WIFI_GPIO_WIFI_INT_B, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE, .name = "bcmdhd_wlan_irq", }, }; diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c index c4ff14dd26a2..1a56e4ce7c7b 100644 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c @@ -83,6 +83,9 @@ int rk31sdk_get_sdmmc0_pin_io_voltage(void) #define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN2_PA7 #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH + #define RK30SDK_WIFI_GPIO_WIFI_INT_B RK30_PIN3_PD2 + #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH + #elif defined(CONFIG_MT5931_MT6622) || defined(CONFIG_MT5931) #ifdef CONFIG_MACH_RK3168_LR097 diff --git a/arch/arm/plat-rk/rk-sdmmc-wifi.c b/arch/arm/plat-rk/rk-sdmmc-wifi.c index bb45ecf75f2d..55e1435ad1a7 100644 --- a/arch/arm/plat-rk/rk-sdmmc-wifi.c +++ b/arch/arm/plat-rk/rk-sdmmc-wifi.c @@ -501,12 +501,12 @@ int rk29sdk_wifi_set_carddetect(int val) } EXPORT_SYMBOL(rk29sdk_wifi_set_carddetect); -#define WIFI_HOST_WAKE RK30_PIN3_PD2 +//#define WIFI_HOST_WAKE RK30_PIN3_PD2 static struct resource resources[] = { { - .start = WIFI_HOST_WAKE, - .flags = IORESOURCE_IRQ, + .start = RK30SDK_WIFI_GPIO_WIFI_INT_B, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE, .name = "bcmdhd_wlan_irq", }, }; diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 547079d059b9..e6441ca70630 100755 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -73,7 +73,7 @@ if SDMMC_RK29 config RK29_SDIO_IRQ_FROM_GPIO bool "sdio-irq from gpio" default n - depends on SDMMC1_RK29 + depends on SDMMC1_RK29 && (BCM_OOB_ENABLED || MT6620) help You will generate sdio interrupt from gpio if you say Yes. Please note that this feature requires hardware support. diff --git a/drivers/mmc/host/rk29_sdmmc.c b/drivers/mmc/host/rk29_sdmmc.c index bb9a690951cb..a567829abc4a 100755 --- a/drivers/mmc/host/rk29_sdmmc.c +++ b/drivers/mmc/host/rk29_sdmmc.c @@ -3864,6 +3864,7 @@ static int rk29_sdmmc_probe(struct platform_device *pdev) #endif +#ifndef CONFIG_BCM_OOB_ENABLED #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO) if(RK29_CTRL_SDIO1_ID == host->pdev->id) { @@ -3899,6 +3900,7 @@ static int rk29_sdmmc_probe(struct platform_device *pdev) } #endif +#endif //#ifndef CONFIG_BCM_OOB_ENABLE /* setup sdmmc1 wifi card detect change */ if (pdata->register_status_notify) { diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index fb3fe1a81fb0..6dc11f26463c 100755 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -32,6 +32,13 @@ config AIDC default n ---help--- +config BCM_OOB_ENABLED + bool "Enable wifi host wake up function" + depends on RKWIFI + select RK29_SDIO_IRQ_FROM_GPIO + default n + ---help--- + choice prompt "WiFi device driver support" default WIFI_NONE @@ -157,10 +164,10 @@ choice endchoice -choice +choice depends on RKWIFI && WLAN_80211 && RK903 prompt "Select the wifi module crystal freq" - default RKWIFI_37_4M + default RKWIFI_26M config RKWIFI_37_4M bool "37_4M" diff --git a/drivers/net/wireless/rkwifi/Kconfig b/drivers/net/wireless/rkwifi/Kconfig index 5a17bd877351..83d7b96f6023 100644 --- a/drivers/net/wireless/rkwifi/Kconfig +++ b/drivers/net/wireless/rkwifi/Kconfig @@ -1,5 +1,5 @@ config RKWIFI - tristate "RK901/RK903/BCM4330 wireless cards support" + tristate "RK901/RK903/BCM4330/AP6XXX wireless cards support" depends on MMC && WLAN_80211 select WIRELESS_EXT select WEXT_PRIV