All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
@ 2012-10-30  8:12 r66093
  2012-10-30  8:12 ` [PATCH 2/4 v4] MMC/SD: Add callback function to detect card r66093
  2012-10-30 23:08 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Ulf Hansson
  0 siblings, 2 replies; 36+ messages in thread
From: r66093 @ 2012-10-30  8:12 UTC (permalink / raw)
  To: linux-mmc; +Cc: Jerry Huang, Anton Vorontsov, Chris Ball

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

When f_init is zero, the SDHC can't work correctly. So f_min will replace
f_init, when f_init is zero.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Anton Vorontsov <cbouatmailru@gmail.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
	- add the CC
changes for v3:
	- enalbe the controller clock in platform, instead of core

 drivers/mmc/core/core.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 06c42cf..9c162cd 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1319,7 +1319,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);
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 36+ messages in thread
* [PATCH 2/4 v4] MMC/SD: Add callback function to detect card
@ 2011-12-27  8:00 r66093
  2012-01-13  2:25 ` Huang Changming-R66093
  0 siblings, 1 reply; 36+ messages in thread
From: r66093 @ 2011-12-27  8:00 UTC (permalink / raw)
  To: linux-mmc; +Cc: Jerry Huang, Chris Ball

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

In order to check whether the card has been removed, the function
mmc_send_status() will send command CMD13 to card and ask the card
to send its status register to sdhc driver, which will generate
many interrupts repeatedly and make the system performance bad.

Therefore, add callback function get_cd() to check whether
the card has been removed when the driver has this callback function.

If the card is present, 1 will return, if the card is absent, 0 will return.
If the controller will not support this feature, -ENOSYS will return.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
        - when controller don't support get_cd, return -ENOSYS
        - add the CC
changes for v3:
        - enalbe the controller clock in platform, instead of core
changes for v4:
	- move the detect code to core.c according to the new structure

 drivers/mmc/core/core.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 6db6621..d570c72 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2060,7 +2060,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 
 int _mmc_detect_card_removed(struct mmc_host *host)
 {
-	int ret;
+	int ret = -ENOSYS;
 
 	if ((host->caps & MMC_CAP_NONREMOVABLE) || !host->bus_ops->alive)
 		return 0;
@@ -2068,7 +2068,13 @@ int _mmc_detect_card_removed(struct mmc_host *host)
 	if (!host->card || mmc_card_removed(host->card))
 		return 1;
 
-	ret = host->bus_ops->alive(host);
+	if (host->ops->get_cd) {
+		ret = host->ops->get_cd(host);
+		if (ret >= 0)
+			ret = !ret;
+	}
+	if (ret < 0)
+		ret = host->bus_ops->alive(host);
 	if (ret) {
 		mmc_card_set_removed(host->card);
 		pr_debug("%s: card remove detected\n", mmc_hostname(host));
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2012-11-19  3:38 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30  8:12 [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() r66093
2012-10-30  8:12 ` [PATCH 2/4 v4] MMC/SD: Add callback function to detect card r66093
2012-10-30  8:12   ` [PATCH 3/4 v5] SDHCI: add sdhci_get_cd callback to detect the card r66093
2012-10-30  8:12     ` [PATCH 4/4 v4] ESDHC: add callback esdhc_of_get_cd to detect card r66093
2012-11-19  2:50       ` Huang Changming-R66093
2012-11-19  2:54         ` Anton Vorontsov
2012-11-19  2:50     ` [PATCH 3/4 v5] SDHCI: add sdhci_get_cd callback to detect the card Huang Changming-R66093
2012-11-19  2:58       ` Anton Vorontsov
2012-11-19  3:15         ` Huang Changming-R66093
2012-11-19  3:31           ` Anton Vorontsov
2012-11-19  3:38             ` Huang Changming-R66093
2012-10-30 11:34   ` [PATCH 2/4 v4] MMC/SD: Add callback function to detect card Girish K S
2012-10-31  2:23     ` Huang Changming-R66093
2012-10-31  4:29       ` Jaehoon Chung
2012-10-31  5:52         ` Huang Changming-R66093
2012-11-01 15:57   ` Johan Rudholm
2012-11-02  1:37     ` Huang Changming-R66093
2012-11-02 10:33       ` Johan Rudholm
2012-11-05  3:17         ` Huang Changming-R66093
2012-11-05 14:07           ` Johan Rudholm
2012-11-06  1:55             ` Huang Changming-R66093
2012-11-06  1:55             ` Huang Changming-R66093
2012-11-13  7:50               ` Huang Changming-R66093
2012-11-19  2:48             ` Huang Changming-R66093
2012-11-19  3:05   ` Anton Vorontsov
2012-11-19  3:11     ` Huang Changming-R66093
2012-10-30 23:08 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Ulf Hansson
2012-10-31  2:23   ` Huang Changming-R66093
2012-10-31  4:21   ` Jaehoon Chung
  -- strict thread matches above, loose matches on Subject: below --
2011-12-27  8:00 [PATCH 2/4 v4] MMC/SD: Add callback function to detect card r66093
2012-01-13  2:25 ` Huang Changming-R66093
2012-01-13  3:26   ` Aaron Lu
2012-01-13  4:52     ` Huang Changming-R66093
2012-01-13  6:27       ` Aaron Lu
2012-01-13  7:05         ` Huang Changming-R66093
2012-01-13  7:36           ` Aaron Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.