From patchwork Fri May 20 07:35:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Changming-R66093 X-Patchwork-Id: 802702 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4K8NP2F027205 for ; Fri, 20 May 2011 08:23:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934735Ab1ETIXd (ORCPT ); Fri, 20 May 2011 04:23:33 -0400 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:44287 "EHLO VA3EHSOBE008.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934688Ab1ETIXc (ORCPT ); Fri, 20 May 2011 04:23:32 -0400 Received: from mail23-va3-R.bigfish.com (10.7.14.248) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.22; Fri, 20 May 2011 08:23:32 +0000 Received: from mail23-va3 (localhost.localdomain [127.0.0.1]) by mail23-va3-R.bigfish.com (Postfix) with ESMTP id 15E546B820E for ; Fri, 20 May 2011 08:23:32 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail23-va3 (localhost.localdomain [127.0.0.1]) by mail23-va3 (MessageSwitch) id 1305879811927628_3512; Fri, 20 May 2011 08:23:31 +0000 (UTC) Received: from VA3EHSMHS013.bigfish.com (unknown [10.7.14.252]) by mail23-va3.bigfish.com (Postfix) with ESMTP id C6DB529004E for ; Fri, 20 May 2011 08:23:31 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS013.bigfish.com (10.7.99.23) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 20 May 2011 08:23:30 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.270.2; Fri, 20 May 2011 03:23:27 -0500 Received: from localhost (rock.ap.freescale.net [10.193.20.106]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p4K8NPW7025796; Fri, 20 May 2011 03:23:26 -0500 (CDT) From: To: CC: Jerry Huang Subject: [PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on Date: Fri, 20 May 2011 15:35:14 +0800 Message-ID: <1305876914-23714-3-git-send-email-r66093@freescale.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1305876914-23714-2-git-send-email-r66093@freescale.com> References: <1305876914-23714-1-git-send-email-r66093@freescale.com> <1305876914-23714-2-git-send-email-r66093@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 20 May 2011 08:23:34 +0000 (UTC) From: Jerry Huang 1. when f_init is zero, the SDHC can't work correctly, so f_min will replace it. 2. Before running get_cd recall function to detect if the card is present, must make sure the power is up. Signed-off-by: Jerry Huang --- drivers/mmc/core/core.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 1f453ac..5a22b85 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -993,7 +993,10 @@ static void mmc_power_up(struct mmc_host *host) */ mmc_delay(10); - host->ios.clock = host->f_init; + if (host->f_init) + host->ios.clock = host->f_init; + else + host->ios.clock = host->f_min; host->ios.power_mode = MMC_POWER_ON; mmc_set_ios(host); @@ -1571,8 +1574,10 @@ void mmc_rescan(struct work_struct *work) */ mmc_bus_put(host); + mmc_power_up(host); if (host->ops->get_cd && host->ops->get_cd(host) == 0) goto out; + mmc_power_off(host); mmc_claim_host(host); for (i = 0; i < ARRAY_SIZE(freqs); i++) {