Commit 07d83cc9 authored by Grazvydas Ignotas's avatar Grazvydas Ignotas Committed by Tony Lindgren

ARM: OMAP3: mmc-twl4030 add MMC3 support, v2

Device connected to MMC3 is assumed to be self-powered, so
set_power() function is empty. It can't be omited because
host driver requires it.

Array size for hsmmc[] is specified to allocate to allocate
an instance for the third MMC controller.

Also fix a leak which happens if invalid controller id
is passed.
Signed-off-by: default avatarGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 01971f65
...@@ -55,6 +55,12 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = { ...@@ -55,6 +55,12 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
.ext_clock = 1, .ext_clock = 1,
.transceiver = true, .transceiver = true,
}, },
{
.mmc = 3,
.wires = 4,
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
},
{} /* Terminator */ {} /* Terminator */
}; };
......
...@@ -62,7 +62,7 @@ static struct twl_mmc_controller { ...@@ -62,7 +62,7 @@ static struct twl_mmc_controller {
u8 twl_vmmc_dev_grp; u8 twl_vmmc_dev_grp;
u8 twl_mmc_dedicated; u8 twl_mmc_dedicated;
char name[HSMMC_NAME_LEN + 1]; char name[HSMMC_NAME_LEN + 1];
} hsmmc[] = { } hsmmc[OMAP34XX_NR_MMC] = {
{ {
.twl_vmmc_dev_grp = VMMC1_DEV_GRP, .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
.twl_mmc_dedicated = VMMC1_DEDICATED, .twl_mmc_dedicated = VMMC1_DEDICATED,
...@@ -347,6 +347,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd ...@@ -347,6 +347,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
return ret; return ret;
} }
static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
int vdd)
{
/*
* Assume MMC3 has self-powered device connected, for example on-board
* chip with external power source.
*/
return 0;
}
static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
...@@ -415,7 +425,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) ...@@ -415,7 +425,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
/* NOTE: we assume OMAP's MMC1 and MMC2 use /* NOTE: we assume OMAP's MMC1 and MMC2 use
* the TWL4030's VMMC1 and VMMC2, respectively; * the TWL4030's VMMC1 and VMMC2, respectively;
* and that OMAP's MMC3 isn't used. * and that MMC3 device has it's own power source.
*/ */
switch (c->mmc) { switch (c->mmc) {
...@@ -430,8 +440,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) ...@@ -430,8 +440,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
else else
mmc->slots[0].ocr_mask = MMC_VDD_165_195; mmc->slots[0].ocr_mask = MMC_VDD_165_195;
break; break;
case 3:
mmc->slots[0].set_power = twl_mmc3_set_power;
mmc->slots[0].ocr_mask = MMC_VDD_165_195;
break;
default: default:
pr_err("MMC%d configuration not supported!\n", c->mmc); pr_err("MMC%d configuration not supported!\n", c->mmc);
kfree(mmc);
continue; continue;
} }
hsmmc_data[c->mmc - 1] = mmc; hsmmc_data[c->mmc - 1] = mmc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment