Skip to content

Commit

Permalink
omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
Browse files Browse the repository at this point in the history
On OMAP4, MMC2 controller has eMMC which draws power from VAUX regulator
on TWL. Though the eMMC supports dual voltage[1.8v/3v] as per ocr register,
its VCC is fixed at 3V for operation. With this once the mmc core selects
the minimum voltage[1.8] supported based on the ocr value read from OCR register,
eMMC will not get detected. Thus the platform data for MMC2 is updated with ocr
mask and same will be communicated to core which will set the regulator to
always operate at 3V when ever turned ON.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
kishore kadiyala authored and Tony Lindgren committed Oct 1, 2010
1 parent 91a0b08 commit 64be978
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
@@ -242,6 +242,7 @@ static struct omap2_hsmmc_info mmc[] = {
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
.nonremovable = true,
.ocr_mask = MMC_VDD_29_30,
},
{} /* Terminator */
};
12 changes: 12 additions & 0 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
@@ -364,6 +364,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
{
struct regulator *reg;
int ret = 0;
int ocr_value = 0;

switch (host->id) {
case OMAP_MMC1_DEVID:
@@ -396,6 +397,17 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
}
} else {
host->vcc = reg;
ocr_value = mmc_regulator_get_ocrmask(reg);
if (!mmc_slot(host).ocr_mask) {
mmc_slot(host).ocr_mask = ocr_value;
} else {
if (!(mmc_slot(host).ocr_mask & ocr_value)) {
pr_err("MMC%d ocrmask %x is not supported\n",
host->id, mmc_slot(host).ocr_mask);
mmc_slot(host).ocr_mask = 0;
return -EINVAL;
}
}
mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);

/* Allow an aux regulator */

0 comments on commit 64be978

Please sign in to comment.