summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/mmc-twl4030.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/mmc-twl4030.c')
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 68891f26f951..aa84fed1edc6 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -24,6 +24,11 @@
#include <mach/mmc.h>
#include <mach/board.h>
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+#include <asm/mach/mmc.h>
+#include <linux/mmc/sdio_ids.h>
+#endif
+
#include "mmc-twl4030.h"
#include <linux/i2c/twl.h>
@@ -460,6 +465,43 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v
static struct omap_mmc_platform_data *hsmmc_data[OMAP44XX_NR_MMC] __initdata;
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+int omap_wifi_status_register(void (*callback)(int card_present,
+ void *dev_id), void *dev_id);
+int omap_wifi_status(int irq);
+
+static struct sdio_embedded_func wifi_func_array[] = {
+ {
+ .f_class = SDIO_CLASS_BT_A,
+ .f_maxblksize = 512,
+ },
+ {
+ .f_class = SDIO_CLASS_WLAN,
+ .f_maxblksize = 512,
+ },
+};
+
+static struct embedded_sdio_data omap_wifi_emb_data = {
+ .cis = {
+ .vendor = SDIO_VENDOR_ID_TI,
+ .device = SDIO_DEVICE_ID_TI_WL12xx,
+ .blksize = 512,
+ .max_dtr = 24000000,
+ },
+ .cccr = {
+ .multi_block = 1,
+ .low_speed = 0,
+ .wide_bus = 1,
+ .high_power = 0,
+ .high_speed = 0,
+ .disable_cd = 1,
+ },
+ .funcs = wifi_func_array,
+ .num_funcs = 2,
+ .quirks = MMC_QUIRK_VDD_165_195 | MMC_QUIRK_LENIENT_FUNC0,
+};
+#endif
+
void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
{
struct twl4030_hsmmc_info *c;
@@ -513,6 +555,16 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
else
snprintf(twl->name, ARRAY_SIZE(twl->name),
"mmc%islot%i", c->mmc, 1);
+
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ if (c->mmc == CONFIG_TIWLAN_MMC_CONTROLLER) {
+ mmc->slots[0].embedded_sdio = &omap_wifi_emb_data;
+ mmc->slots[0].register_status_notify =
+ &omap_wifi_status_register;
+ mmc->slots[0].card_detect = &omap_wifi_status;
+ }
+#endif
+
mmc->slots[0].name = twl->name;
mmc->nr_slots = 1;
mmc->slots[0].wires = c->wires;
@@ -598,6 +650,9 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
case 5:
/* TODO */
mmc->slots[0].set_power = twl_mmc23_set_power;
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ mmc->slots[0].ocr_mask = MMC_VDD_165_195;
+#endif
break;
default:
pr_err("MMC%d configuration not supported!\n", c->mmc);