aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mmc-twl4030.c
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2009-03-23 21:23:47 -0400
committerTony Lindgren <tony@atomide.com>2009-03-23 21:51:23 -0400
commit07d83cc9c839a5f05c7c1b6d823a8f483bda0441 (patch)
tree463bce2402acd63d3180a41c672b31d8d41c8d01 /arch/arm/mach-omap2/mmc-twl4030.c
parent01971f65ff88e3ebe2b6ae42b95d68e26b83718d (diff)
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: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/mmc-twl4030.c')
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index c67078db07b..d9fad8dda15 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -62,7 +62,7 @@ static struct twl_mmc_controller {
62 u8 twl_vmmc_dev_grp; 62 u8 twl_vmmc_dev_grp;
63 u8 twl_mmc_dedicated; 63 u8 twl_mmc_dedicated;
64 char name[HSMMC_NAME_LEN + 1]; 64 char name[HSMMC_NAME_LEN + 1];
65} hsmmc[] = { 65} hsmmc[OMAP34XX_NR_MMC] = {
66 { 66 {
67 .twl_vmmc_dev_grp = VMMC1_DEV_GRP, 67 .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
68 .twl_mmc_dedicated = VMMC1_DEDICATED, 68 .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 return ret; 347 return ret;
348} 348}
349 349
350static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
351 int vdd)
352{
353 /*
354 * Assume MMC3 has self-powered device connected, for example on-board
355 * chip with external power source.
356 */
357 return 0;
358}
359
350static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; 360static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
351 361
352void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) 362void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
@@ -415,7 +425,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
415 425
416 /* NOTE: we assume OMAP's MMC1 and MMC2 use 426 /* NOTE: we assume OMAP's MMC1 and MMC2 use
417 * the TWL4030's VMMC1 and VMMC2, respectively; 427 * the TWL4030's VMMC1 and VMMC2, respectively;
418 * and that OMAP's MMC3 isn't used. 428 * and that MMC3 device has it's own power source.
419 */ 429 */
420 430
421 switch (c->mmc) { 431 switch (c->mmc) {
@@ -430,8 +440,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
430 else 440 else
431 mmc->slots[0].ocr_mask = MMC_VDD_165_195; 441 mmc->slots[0].ocr_mask = MMC_VDD_165_195;
432 break; 442 break;
443 case 3:
444 mmc->slots[0].set_power = twl_mmc3_set_power;
445 mmc->slots[0].ocr_mask = MMC_VDD_165_195;
446 break;
433 default: 447 default:
434 pr_err("MMC%d configuration not supported!\n", c->mmc); 448 pr_err("MMC%d configuration not supported!\n", c->mmc);
449 kfree(mmc);
435 continue; 450 continue;
436 } 451 }
437 hsmmc_data[c->mmc - 1] = mmc; 452 hsmmc_data[c->mmc - 1] = mmc;