Porting AP6335 Wifi module to Android 5.1 which use 3.14.52 kernel.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Porting AP6335 Wifi module to Android 5.1 which use 3.14.52 kernel.

Jump to solution
2,459 Views
chenli_2016
Contributor II

Hi, All

our custom product is refer to i.MX6Q SABRE and the only modification is the wifi module, ours is AMPAK's AP6335 , we are porting this module to Android 5.1 which use 3.14.52 kernel.

According to the  the wifi user  guide :

Power control and SDIO card detection

Fill WL_REG_ON GPIO pin number and implement card detection function to dhd_gpio.c as

following:

void bcm_wlan_power_on(int flag)

{

if (flag == 1) {

printk("======== PULL WL_REG_ON HIGH! ========\n");

gpio_set_value(WIFI_WL_REG_ON, 1);

mdelay(100);

printk("======== Card detection to detect SDIO card ========\n");

imx_wifi_mmc_safe_detect(1);

} else {

printk("======== PULL WL_REG_ON HIGH! (flag = %d) ========\n", flag);

gpio_set_value(WIFI_WL_REG_ON, 1);

}

}

when we ported this wifi module to Android 4.3 which use 3.0.35 kernel,the card detect function we used is

int imx_wifi_mmc_safe_detect(int online);

which is located in drivers/mmc/host/sdhci-esdhc-imx.c:827:int imx_wifi_mmc_safe_detect(int online)

drivers/mmc/host/sdhci-esdhc-imx.c:905:EXPORT_SYMBOL(imx_wifi_mmc_safe_detect);

but we just can't find this function anymore in 3.14.52 kernel .

the question is :which function is the card detect function in 3.14.52 kernel ?

Hope for your help!

Regards,

0 Kudos
1 Solution
1,154 Views
igorpadykov
NXP Employee
NXP Employee

Hi li

it is wifi_card_detect(void) in linux/drivers/mmc/host/sdhci-esdhc-imx.c,

also please check attached Chapter 33 MMC/SD/SDIO Host Driver

Linux Manual.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,155 Views
igorpadykov
NXP Employee
NXP Employee

Hi li

it is wifi_card_detect(void) in linux/drivers/mmc/host/sdhci-esdhc-imx.c,

also please check attached Chapter 33 MMC/SD/SDIO Host Driver

Linux Manual.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,154 Views
chenli_2016
Contributor II

Hi igor

Thanks for your help.

After reading the Chapter 33 MMC/SD/SDIO Host Driver in Linux Manual,I have found that function (wifi_card_detect(void))in linux/drivers/mmc/host/sdhci-esdhc-imx.c and add it to my driver code ,it compile ok.

when i use insmod command to load ther driver , I got the following information :

insmod system/lib/modules/cfg80211.ko

cfg80211: Calling CRDA to update world regulatory domain

insmod system/lib/modules/bcmdhd.ko                                            <

dhd_module_init: in

======== bcm_wlan_set_plat_data ========

GPIO(WL_HOST_WAKE) = GPIO_4_25

host_oob_irq: 281

host_oob_irq_flags=4

dhd_wifi_platform_load: Enter

Power-up adapter 'DHD generic adapter'

wifi_platform_set_power = 1

======== PULL WL_REG_ON HIGH! ========

======== Card detection to detect SDIO card ========

wifi_platform_bus_enumerate device present 1

failed to power up DHD generic adapter, 3 retry left

wifi_platform_set_power = 0

======== PULL WL_REG_ON LOW! ========

wifi_platform_bus_enumerate device present 0

wifi_platform_set_power = 1

======== PULL WL_REG_ON HIGH! ========

======== Card detection to detect SDIO card ========

wifi_platform_bus_enumerate device present 1

failed to power up DHD generic adapter, 2 retry left

wifi_platform_set_power = 0

======== PULL WL_REG_ON LOW! ========

wifi_platform_bus_enumerate device present 0

wifi_platform_set_power = 1

======== PULL WL_REG_ON HIGH! ========

... ...

======== PULL WL_REG_ON LOW! ========

wifi_platform_bus_enumerate device present 0

failed to power up DHD generic adapter, max retry reached**

unregister wifi platform drivers

wifi_platform_bus_enumerate device present 0

dhd_module_init: Failed to load the driver, try cnt 0

dhd_module_init: Failed to load driver max retry reached**

dhd_module_init: Exit err=-19

I wonder if the WiFi driver I used is too old to run properly on 3.14.52 kernel , I will attach it below ,about this driver ,the file I modified is dhd_gpio.c.can you look at it and see if the changes I made is right .

Thank you again for you time on this case.

Best regards!

li chen.

0 Kudos