Message ID | 49A3EF96.3090603@nokia.com (mailing list archive) |
---|---|
State | Awaiting Upstream, archived |
Headers | show |
On Tuesday 24 February 2009, Adrian Hunter wrote: > > I agree that code removed by this patch is ugly and worth > > removing if it's not actually needed for MMC1. > > Here is a patch against current OMAP tree. > > From: Adrian Hunter <ext-adrian.hunter@nokia.com> > Date: Tue, 24 Feb 2009 14:48:16 +0200 > Subject: [PATCH] OMAP: HSMMC: do not re-power when powering off MMC > > Remove code that turns MMC1 power back on after it > has been powered off (when the voltage is 1.8V). > > The offending code is not necessary because the > host controller bus voltage is initialized to > 3V when probing or resuming. Â Note that MMC powers up > with the highest voltage available (see mmc_power_up()) > which will be 3V also. > > Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Looks OK to me -- ack. Safe to merge through the MMC tree right away, but it'll be a NOP until the glue actually supports 1.8V correctly for MMC1 ... so IMO no rush to merge for 2.6.29-final. > --- > Â drivers/mmc/host/omap_hsmmc.c | Â 17 ----------------- > Â 1 files changed, 0 insertions(+), 17 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index c0d5420..43cec98 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -486,9 +486,6 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd) > Â Â Â Â Â Â Â Â u32 reg_val = 0; > Â Â Â Â Â Â Â Â int ret; > Â > -Â Â Â Â Â Â Â if (host->id != OMAP_MMC1_DEVID) > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0; > - > Â Â Â Â Â Â Â Â /* Disable the clocks */ > Â Â Â Â Â Â Â Â clk_disable(host->fclk); > Â Â Â Â Â Â Â Â clk_disable(host->iclk); > @@ -787,20 +784,6 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > Â Â Â Â Â Â Â Â switch (ios->power_mode) { > Â Â Â Â Â Â Â Â case MMC_POWER_OFF: > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0); > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * Reset interface voltage to 3V if it's 1.8V now; > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * only relevant on MMC-1, the others always use 1.8V. > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * REVISIT: If we are able to detect cards after unplugging > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * a 1.8V card, this code should not be needed. > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â */ > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (host->id != OMAP_MMC1_DEVID) > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break; > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) { > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â int vdd = fls(host->mmc->ocr_avail) - 1; > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (omap_mmc_switch_opcond(host, vdd) != 0) > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â host->mmc->ios.vdd = vdd; > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â } > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break; > Â Â Â Â Â Â Â Â case MMC_POWER_UP: > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mmc_slot(host).set_power(host->dev, host->slot_id, 1, ios->vdd); -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tuesday 24 February 2009, Adrian Hunter wrote: > I would still like the other two issues I raised considered. > They were: > Â Â Â Â Â Â Â Â 1. Â 'host' can be NULL in omap_mmc_suspend() / omap_mmc_resume() > Â Â Â Â Â Â Â Â 2. wait for SDBP bit Someone from Nokia was going to be shepherding HSMMC patches, as I recall... that person should deal with these issues. :) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
* David Brownell <david-b@pacbell.net> [090224 14:14]: > On Tuesday 24 February 2009, Adrian Hunter wrote: > > > I agree that code removed by this patch is ugly and worth > > > removing if it's not actually needed for MMC1. > > > > Here is a patch against current OMAP tree. > > > > From: Adrian Hunter <ext-adrian.hunter@nokia.com> > > Date: Tue, 24 Feb 2009 14:48:16 +0200 > > Subject: [PATCH] OMAP: HSMMC: do not re-power when powering off MMC > > > > Remove code that turns MMC1 power back on after it > > has been powered off (when the voltage is 1.8V). > > > > The offending code is not necessary because the > > host controller bus voltage is initialized to > > 3V when probing or resuming. Â Note that MMC powers up > > with the highest voltage available (see mmc_power_up()) > > which will be 3V also. > > > > Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> > > Looks OK to me -- ack. Safe to merge through the MMC > tree right away, but it'll be a NOP until the glue > actually supports 1.8V correctly for MMC1 ... so IMO > no rush to merge for 2.6.29-final. Good to hear we get rid of that REVISIT part.. My ack here too. Acked-by: Tony Lindgren <tony@atomide.com> > > --- > > Â drivers/mmc/host/omap_hsmmc.c | Â 17 ----------------- > > Â 1 files changed, 0 insertions(+), 17 deletions(-) > > > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > > index c0d5420..43cec98 100644 > > --- a/drivers/mmc/host/omap_hsmmc.c > > +++ b/drivers/mmc/host/omap_hsmmc.c > > @@ -486,9 +486,6 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd) > > Â Â Â Â Â Â Â Â u32 reg_val = 0; > > Â Â Â Â Â Â Â Â int ret; > > Â > > -Â Â Â Â Â Â Â if (host->id != OMAP_MMC1_DEVID) > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0; > > - > > Â Â Â Â Â Â Â Â /* Disable the clocks */ > > Â Â Â Â Â Â Â Â clk_disable(host->fclk); > > Â Â Â Â Â Â Â Â clk_disable(host->iclk); > > @@ -787,20 +784,6 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > > Â Â Â Â Â Â Â Â switch (ios->power_mode) { > > Â Â Â Â Â Â Â Â case MMC_POWER_OFF: > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0); > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * Reset interface voltage to 3V if it's 1.8V now; > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * only relevant on MMC-1, the others always use 1.8V. > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * REVISIT: If we are able to detect cards after unplugging > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â * a 1.8V card, this code should not be needed. > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â */ > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (host->id != OMAP_MMC1_DEVID) > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break; > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) { > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â int vdd = fls(host->mmc->ocr_avail) - 1; > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (omap_mmc_switch_opcond(host, vdd) != 0) > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â host->mmc->ios.vdd = vdd; > > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â } > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break; > > Â Â Â Â Â Â Â Â case MMC_POWER_UP: > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mmc_slot(host).set_power(host->dev, host->slot_id, 1, ios->vdd); > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index c0d5420..43cec98 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -486,9 +486,6 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd) u32 reg_val = 0; int ret; - if (host->id != OMAP_MMC1_DEVID) - return 0; - /* Disable the clocks */ clk_disable(host->fclk); clk_disable(host->iclk); @@ -787,20 +784,6 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) switch (ios->power_mode) { case MMC_POWER_OFF: mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0); - /* - * Reset interface voltage to 3V if it's 1.8V now; - * only relevant on MMC-1, the others always use 1.8V. - * - * REVISIT: If we are able to detect cards after unplugging - * a 1.8V card, this code should not be needed. - */ - if (host->id != OMAP_MMC1_DEVID) - break; - if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) { - int vdd = fls(host->mmc->ocr_avail) - 1; - if (omap_mmc_switch_opcond(host, vdd) != 0) - host->mmc->ios.vdd = vdd; - } break; case MMC_POWER_UP: mmc_slot(host).set_power(host->dev, host->slot_id, 1, ios->vdd);