linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Chang-Ming.Huang@freescale.com>
To: linux-mmc@vger.kernel.org
Cc: linuxppc-dev@linux.freescale.net,
	Jerry Huang <Chang-Ming.Huang@freescale.com>
Subject: [PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on
Date: Wed, 11 May 2011 17:32:11 +0800	[thread overview]
Message-ID: <1305106331-21280-3-git-send-email-Chang-Ming.Huang@freescale.com> (raw)
In-Reply-To: <1305106331-21280-2-git-send-email-Chang-Ming.Huang@freescale.com>

From: Jerry Huang <Chang-Ming.Huang@freescale.com>

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 <Chang-Ming.Huang@freescale.com>
---
 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++) {
-- 
1.7.4.1



  reply	other threads:[~2011-05-11 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  9:32 [PATCH 1/3] SDHCI: add sdhci_get_cd callback to detect the card Chang-Ming.Huang
2011-05-11  9:32 ` [PATCH 2/3] MMC/SD: add callback function to detect card Chang-Ming.Huang
2011-05-11  9:32   ` Chang-Ming.Huang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-12  5:24 [PATCH 1/3] SDHCI: add sdhci_get_cd callback to detect the card r66093
2011-05-12  5:24 ` [PATCH 2/3] MMC/SD: add callback function to detect card r66093
2011-05-12  5:24   ` [PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on r66093
2011-05-20  7:35 [PATCH 1/3] SDHCI: add sdhci_get_cd callback to detect the card r66093
2011-05-20  7:35 ` [PATCH 2/3] MMC/SD: add callback function to detect card r66093
2011-05-20  7:35   ` [PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on r66093

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305106331-21280-3-git-send-email-Chang-Ming.Huang@freescale.com \
    --to=chang-ming.huang@freescale.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linuxppc-dev@linux.freescale.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).