aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRom Lemarchand <rlemarchand@sta.samsung.com>2011-03-08 17:09:10 -0800
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:53:23 -0800
commit1626381a5010affed00227d7359281b67bd36dd4 (patch)
tree861cf411b3d1f72bf49cf4c86f42d07e94ee0c80
parent60a669f36c65c31d0d2f4164f7ae98646d36f950 (diff)
downloadkernel_samsung_aries-1626381a5010affed00227d7359281b67bd36dd4.zip
kernel_samsung_aries-1626381a5010affed00227d7359281b67bd36dd4.tar.gz
kernel_samsung_aries-1626381a5010affed00227d7359281b67bd36dd4.tar.bz2
MMC: host: add a quirk to keep the clocks on when idling
Add an extra quirk to keep the clocks running when the device is idle. Change-Id: I620f515088385b4b031daa9051c6f1ef380ea4a6 Signed-off-by: Rom Lemarchand <rlemarchand@sta.samsung.com>
-rwxr-xr-xdrivers/mmc/host/sdhci.c6
-rw-r--r--include/linux/mmc/sdhci.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 19d6ccc..7baca39 100755
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1962,7 +1962,8 @@ static void sdhci_tasklet_finish(unsigned long param)
sdhci_reset(host, SDHCI_RESET_DATA);
}
out:
- if(readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_DATA_INHIBIT)
+ if((readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_DATA_INHIBIT) ||
+ (host->quirks & SDHCI_QUIRK_MUST_MAINTAIN_CLOCK))
mod_timer(&host->busy_check_timer, jiffies + msecs_to_jiffies(10));
else
sdhci_disable_clock_card(host);
@@ -2035,7 +2036,8 @@ static void sdhci_busy_check_timer(unsigned long data)
spin_lock_irqsave(&host->lock, flags);
- if(readl(host->ioaddr + SDHCI_PRESENT_STATE) & (SDHCI_CMD_INHIBIT | SDHCI_DATA_INHIBIT))
+ if((readl(host->ioaddr + SDHCI_PRESENT_STATE) & (SDHCI_CMD_INHIBIT | SDHCI_DATA_INHIBIT)) ||
+ (host->quirks & SDHCI_QUIRK_MUST_MAINTAIN_CLOCK))
mod_timer(&host->busy_check_timer, jiffies + msecs_to_jiffies(10));
else
sdhci_disable_clock_card(host);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index de04d52..b27792a 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -21,7 +21,7 @@ struct sdhci_host {
/* Data set by hardware interface driver */
const char *hw_name; /* Hardware bus name */
- unsigned int quirks; /* Deviations from spec. */
+ u64 quirks; /* Deviations from spec. */
/* Controller doesn't honor resets unless we touch the clock register */
#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0)
@@ -87,6 +87,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30)
/* The read-only detection via SDHCI_PRESENT_STATE register is unstable */
#define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31)
+/* Controller must maintain clock when no activity */
+#define SDHCI_QUIRK_MUST_MAINTAIN_CLOCK (1ULL<<32)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */