linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: mmci: Gate the clock when freq is 0
@ 2012-12-12 15:50 Ulf Hansson
  2012-12-12 18:57 ` Linus Walleij
  2012-12-21 16:21 ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: Ulf Hansson @ 2012-12-12 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Johan Rudholm <johan.rudholm@stericsson.com>

In the ST Micro variant, the MMCI_CLOCK register should not be used to
gate the clock. Use MMCI_POWER to do this.

Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/mmci.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9b..bf07823 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1147,6 +1147,15 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 	}
 
+	/*
+	 * If clock = 0 and the block needs a certain value in the clreg
+	 * to function, we need to gate the clock by removing MCI_PWR_ON.
+	 * This is a special case for ST Micro variants, since the power
+	 * register in the ARM legacy case is used for powering the cards.
+	 */
+	if (!ios->clock && variant->clkreg)
+		pwr &= ~MCI_PWR_ON;
+
 	spin_lock_irqsave(&host->lock, flags);
 
 	mmci_set_clkreg(host, ios->clock);
-- 
1.7.10

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

end of thread, other threads:[~2013-01-07 16:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 15:50 [PATCH] mmc: mmci: Gate the clock when freq is 0 Ulf Hansson
2012-12-12 18:57 ` Linus Walleij
2012-12-21 16:21 ` Russell King - ARM Linux
2013-01-07 10:29   ` Ulf Hansson
2013-01-07 16:28     ` Ulf Hansson

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).