mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
mmc: change mmc_rescan_host usage for Rockchip turnkey customer :((
Before this patch we identify oob-wifi or sdio-irq-wifi by DTS. However wifi engineers argue that our customer is lazy to modify it event we had moentioned in release wifi configure document before and claim it again and agin. Cc: hwg <hwg@rock-chips.com> Cc: gwl <gwl@rock-chips.com> Signed-off-by: Shawn Lin <lintao@rock-chips.com>
This commit is contained in:
@@ -604,25 +604,34 @@ EXPORT_SYMBOL(mmc_free_host);
|
||||
* 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;
|
||||
}
|
||||
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));
|
||||
printk("%s:mmc host rescan start!\n", mmc_hostname(host));
|
||||
|
||||
if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->set_sdio_status)
|
||||
/* 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);
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ int mmc_add_host(struct mmc_host *);
|
||||
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,
|
||||
|
||||
@@ -436,10 +436,19 @@ EXPORT_SYMBOL(rockchip_wifi_power);
|
||||
*
|
||||
*************************************************************************/
|
||||
#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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user