Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799Ab0KEJgE (ORCPT ); Fri, 5 Nov 2010 05:36:04 -0400 Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:44200 "EHLO eu1sys200aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752307Ab0KEJgD (ORCPT ); Fri, 5 Nov 2010 05:36:03 -0400 X-Greylist: delayed 69007 seconds by postgrey-1.27 at vger.kernel.org; Fri, 05 Nov 2010 05:36:02 EDT From: Linus Walleij To: , , Cc: , Ulf Hansson , Linus Walleij Subject: [PATCH] mmci: reset voltage after power off. Date: Fri, 5 Nov 2010 10:35:41 +0100 Message-ID: <1288949741-9712-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 44 From: Ulf Hansson At power off, reset OCR mask to be the highest possible voltage supported for the current mmc host. This solves the re-initialization during the power up sequence. The voltage may have been decreased due to the card accepts a lower voltage than the voltage used during the initialization sequence. We need to reset the voltage to by the host highest possible value since according to specification the initialization must always be done at high voltage. Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/mmc/core/core.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8f86d70..508ed2b 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -940,6 +940,13 @@ static void mmc_power_off(struct mmc_host *host) { host->ios.clock = 0; host->ios.vdd = 0; + + /* + * Reset ocr mask to be the highest possible voltage supported for + * this mmc host. This value will be used at next power up. + */ + host->ocr = 1 << (fls(host->ocr_avail) - 1); + if (!mmc_host_is_spi(host)) { host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; host->ios.chip_select = MMC_CS_DONTCARE; -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/