diff options
author | Ricardo Perez Olivares <x0081762@ti.com> | 2010-07-10 03:30:23 -0500 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-07-10 03:30:23 -0500 |
commit | ae2c6358a12bd46e175136eea6679822a7fc4149 (patch) | |
tree | c47083d583ff02ec96e139ec37353cc001fe731f /drivers | |
parent | 45f033c9186be11e0a223113a2d5a7ccafe35a8b (diff) | |
parent | 2d45669beed28c2f926a2bc2df98c981b2bd478c (diff) |
Merge branch 'Wlan-next' of git://dev.omapzoom.org/pub/scm/pradeep/wlan-1283 into L24x8
Conflicts:
arch/arm/mach-omap2/board-4430sdp.c
drivers/mmc/host/omap_hsmmc.c
Signed-off-by: Ricardo Perez Olivares <x0081762@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/core/core.c | 13 | ||||
-rw-r--r-- | drivers/mmc/core/sdio.c | 37 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_bus.c | 11 | ||||
-rwxr-xr-x | drivers/mmc/host/omap_hsmmc.c | 47 |
4 files changed, 108 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3168ebd616b2..2966a3cf84ac 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1335,6 +1335,19 @@ EXPORT_SYMBOL(mmc_resume_host); #endif +#ifdef CONFIG_TIWLAN_SDIO +void mmc_set_embedded_sdio_data(struct mmc_host *host, + struct sdio_cis *cis, + struct sdio_embedded_func *funcs, + unsigned int quirks) +{ + host->embedded_sdio_data.cis = cis; + host->embedded_sdio_data.funcs = funcs; + host->embedded_sdio_data.quirks = quirks; +} +EXPORT_SYMBOL(mmc_set_embedded_sdio_data); +#endif + static int __init mmc_init(void) { int ret; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 2dd4cfe7ca17..d33f7d4348c5 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -24,6 +24,10 @@ #include "sdio_ops.h" #include "sdio_cis.h" +#ifdef CONFIG_TIWLAN_SDIO +#include <linux/mmc/sdio_ids.h> +#endif + static int sdio_read_fbr(struct sdio_func *func) { int ret; @@ -293,6 +297,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, goto err; } +#ifdef CONFIG_TIWLAN_SDIO + card->quirks = host->embedded_sdio_data.quirks; +#endif card->type = MMC_TYPE_SDIO; /* @@ -322,6 +329,12 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, if (err) goto remove; +#ifdef CONFIG_TIWLAN_SDIO + if (host->embedded_sdio_data.cis) + memcpy(&card->cis, host->embedded_sdio_data.cis, + sizeof(struct sdio_cis)); + else { +#endif /* * Read the common CIS tuples. */ @@ -329,6 +342,10 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, if (err) goto remove; +#ifdef CONFIG_TIWLAN_SDIO + } +#endif + if (oldcard) { int same = (card->cis.vendor == oldcard->cis.vendor && card->cis.device == oldcard->cis.device); @@ -578,9 +595,29 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr) * Initialize (but don't add) all present functions. */ for (i = 0; i < funcs; i++, card->sdio_funcs++) { +#ifdef CONFIG_TIWLAN_SDIO + if (host->embedded_sdio_data.funcs) { + struct sdio_func *tmp; + + tmp = sdio_alloc_func(host->card); + if (IS_ERR(tmp)) + goto remove; + tmp->num = (i + 1); + card->sdio_func[i] = tmp; + tmp->class = host->embedded_sdio_data.funcs[i].f_class; + tmp->max_blksize = + host->embedded_sdio_data.funcs[i].f_maxblksize; + tmp->vendor = card->cis.vendor; + tmp->device = card->cis.device; + } else { +#endif + err = sdio_init_func(host->card, i + 1); if (err) goto remove; +#ifdef CONFIG_TIWLAN_SDIO + } +#endif } mmc_release_host(host); diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 4a890dcb95ab..af5c1d81258b 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -21,6 +21,10 @@ #include "sdio_cis.h" #include "sdio_bus.h" +#ifdef CONFIG_TIWLAN_SDIO +#include <linux/mmc/host.h> +#endif + /* show configuration fields */ #define sdio_config_attr(field, format_string) \ static ssize_t \ @@ -200,6 +204,13 @@ static void sdio_release_func(struct device *dev) { struct sdio_func *func = dev_to_sdio_func(dev); +#ifdef CONFIG_TIWLAN_SDIO + /* + * If this device is embedded then we never allocated + * cis tables for this func + */ + if (!func->card->host->embedded_sdio_data.funcs) +#endif sdio_free_func_cis(func); if (func->info) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3abeca657b0e..c0ca3e5951a0 100755 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1096,6 +1096,9 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host, __func__); } +/* + * MMC controller IRQ handler + */ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) { struct mmc_data *data; @@ -1782,6 +1785,30 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmc_host_lazy_disable(host->mmc); } +#ifdef CONFIG_TIWLAN_SDIO +static void omap_hsmmc_status_notify_cb(int card_present, void *dev_id) +{ + struct omap_hsmmc_host *host = dev_id; + struct omap_mmc_slot_data *slot = &mmc_slot(host); + int carddetect; + + printk(KERN_DEBUG "%s: card_present %d\n", mmc_hostname(host->mmc), + card_present); + + carddetect = slot->card_detect(host->dev, host->slot_id); + + sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); + if (carddetect) { + mmc_detect_change(host->mmc, (HZ * 200) / 1000); + } else { + mmc_host_enable(host->mmc); + omap_hsmmc_reset_controller_fsm(host, SRD); + mmc_host_lazy_disable(host->mmc); + mmc_detect_change(host->mmc, (HZ * 50) / 1000); + } +} +#endif + static int omap_hsmmc_get_cd(struct mmc_host *mmc) { struct omap_hsmmc_host *host = mmc_priv(mmc); @@ -2215,6 +2242,17 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) host->regs = (u16 *) omap3_mmc_reg_map; host->power_mode = MMC_POWER_OFF; +#ifdef CONFIG_TIWLAN_SDIO + if (pdev->id == CONFIG_TIWLAN_MMC_CONTROLLER-1) { + if (pdata->slots[0].embedded_sdio != NULL) { + mmc_set_embedded_sdio_data(mmc, + &pdata->slots[0].embedded_sdio->cis, + pdata->slots[0].embedded_sdio->funcs, + pdata->slots[0].embedded_sdio->quirks); + } + } +#endif + platform_set_drvdata(pdev, host); INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect); @@ -2378,6 +2416,15 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) pdata->resume = omap_hsmmc_resume_cdirq; } +#ifdef CONFIG_TIWLAN_SDIO + else if (mmc_slot(host).register_status_notify) { + if (pdev->id == CONFIG_TIWLAN_MMC_CONTROLLER-1) { + mmc_slot(host).register_status_notify( + omap_hsmmc_status_notify_cb, host); + } + } +#endif + omap_hsmmc_disable_irq(host); mmc_host_lazy_disable(host->mmc); |