I am working in a product based on Android JB and IMX6. However, I have notice the WiFi is failing after the device enter in sleep mode. We are using the QCA6234 as SD interface which is defined in the sd2.
I tried to reset the chip during the resume process but the driver breaks and we lose control of WiFi... However, I was investigating some gpios and I noticed the following with the gpio ESDHC_WP:
Before activate Wi-Fi -> LOW
After activate Wi-Fi -> LOW
After sleep Wi-Fi -> HIGH (at this moment I can see a lot of "AP failed to scan" and WiFi only recovers if I turn off and turn on the WiFi again).
In the board definition I have
#define MY_SDIO_CD IMX_GPIO_NR(2, 7)
static const struct esdhc_platform_data mx6_horizon_sd2_data __initconst = {
.cd_gpio = MY_SDIO_CD,
.keep_power_at_suspend = 1,
.support_8bit = 0,
.delay_line = 0,
.cd_type = ESDHC_CD_CONTROLLER,
.support_18v = 1,
.runtime_pm = 1,
};
So, as you can see keep_power_at_suspend = 1.
Any idea to help me to debug this issue ? Many thanks !!!!
Hi Manoel
seems for gpio ESDHC_WP there could be record like:
.wp_gpio | = SABREAUTO_SD3_WP, |
as in linux/arch/arm/mach-mx6/board-mx6q_sabreauto.c
#define SABREAUTO_SD3_WP | IMX_GPIO_NR(1, 13) |
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Many thanks.. However, my hardware does not have any GPIO for WP. Do you have some recommendation ? I tried to set the a GPIO not in use in my hardware as the wp_gpio as you recommended and the change the code in the sdhci-esdhc-imx.c in order to return always LOW as you can see below:
static unsigned int esdhc_pltfm_get_ro(struct sdhci_host *host)
{
struct esdhc_platform_data *boarddata = host->mmc->parent->platform_data;
if (boarddata && gpio_is_valid(boarddata->wp_gpio))
{
if (boarddata->wp_gpio != MY_GPIO_TEST) |
return gpio_get_value(boarddata->wp_gpio);
else |
return 0;
}
else
return -ENOSYS;
}
However, I still see ESDHC_WP being set as HIGH all the time. I do not have JTAG for debugging this and everything is thru log messages and it is being very painful. If you guys have another suggestion this is very welcome.