* OR, rescan host from argument.
*
*/
-int mmc_host_rescan(struct mmc_host *host, int val)
+int mmc_host_rescan(struct mmc_host *host, int val, int is_cap_sdio_irq)
{
- if(NULL != primary_sdio_host){
- if(!host)
- host = primary_sdio_host;
- else
- printk("%s: mmc_host_rescan pass in host from argument!\n", mmc_hostname(host));
- }
- else{
- printk("sdio: host isn't initialization successfully.\n");
- return -ENOMEDIUM;
- }
-
- printk("%s:mmc host rescan start!\n", mmc_hostname(host));
-
- if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->set_sdio_status)
+ if (NULL != primary_sdio_host) {
+ if(!host)
+ host = primary_sdio_host;
+ else
+ printk("%s: mmc_host_rescan pass in host from argument!\n", mmc_hostname(host));
+ } else {
+ printk("sdio: host isn't initialization successfully.\n");
+ return -ENOMEDIUM;
+ }
+
+ printk("%s:mmc host rescan start!\n", mmc_hostname(host));
+
+ /* 0: oob 1:cap-sdio-irq */
+ if (is_cap_sdio_irq == 1) {
+ host->caps |= MMC_CAP_SDIO_IRQ;
+ } else if (is_cap_sdio_irq == 0) {
+ host->caps &= ~MMC_CAP_SDIO_IRQ;
+ } else {
+ dev_err(&host->class_dev, "sdio: host doesn't identify oob or sdio_irq mode!\n");
+ return -ENOMEDIUM;
+ }
+
+ if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->set_sdio_status)
host->ops->set_sdio_status(host, val);
- return 0;
+ return 0;
}
EXPORT_SYMBOL(mmc_host_rescan);
void mmc_remove_host(struct mmc_host *);
void mmc_free_host(struct mmc_host *);
int mmc_of_parse(struct mmc_host *host);
-int mmc_host_rescan(struct mmc_host *host, int val);
+int mmc_host_rescan(struct mmc_host *host, int val, int irq_type);
#ifdef CONFIG_MMC_EMBEDDED_SDIO
extern void mmc_set_embedded_sdio_data(struct mmc_host *host,
struct sdio_cis *cis,
*
*************************************************************************/
#include <linux/mmc/host.h>
-extern int mmc_host_rescan(struct mmc_host *host, int val);
+extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type);
int rockchip_wifi_set_carddetect(int val)
{
- return mmc_host_rescan(NULL, val);//NULL => SDIO host
+ int chip, irq_type;
+ chip = get_wifi_chip_type();
+
+ /* irq_type : 0, oob; 1, cap-sdio-irq */
+ if (chip == WIFI_ESP8089)
+ irq_type = 1;
+ else
+ irq_type = 0;
+
+ return mmc_host_rescan(NULL, val, irq_type);//NULL => SDIO host
}
EXPORT_SYMBOL(rockchip_wifi_set_carddetect);