* [PATCH v2 2/2]mmc: implemented hardware reset callback in sdhci host layer
@ 2010-11-02 12:36 Chuanxiao.Dong
0 siblings, 0 replies; only message in thread
From: Chuanxiao.Dong @ 2010-11-02 12:36 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc
>From 9fe8402c59d9346dabc1898ddd82ace98583c01e Mon Sep 17 00:00:00 2001
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date: Tue, 2 Nov 2010 20:11:09 +0800
Subject: [PATCH 2/2] mmc: implemented hardware reset callback for sdhci layer
the hardware reset callback in sdhci layer cannot really do
a reset for eMMC card. Different sdhci host controller need use
reset_emmc callback to implement the real reset part.
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
drivers/mmc/host/sdhci.c | 23 +++++++++++++++++++++++
drivers/mmc/host/sdhci.h | 1 +
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 782c0ee..ac789d9 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1266,11 +1266,34 @@ out:
spin_unlock_irqrestore(&host->lock, flags);
}
+/*
+ * HW reset callback for eMMC4.4 card
+ * In this function, HC will do the real HW reset
+ * for eMMC4.4 card
+ *
+ * RETURN VALUE:
+ * 0: reset emmc successfully
+ * 1: reset emmc failed
+ * */
+static int sdhci_hardware_reset(struct mmc_host *mmc)
+{
+ int err = 1;
+ struct sdhci_host *host;
+
+ host = mmc_priv(mmc);
+
+ if (host->ops && host->ops->reset_emmc)
+ err = host->ops->reset_emmc(host);
+
+ return err;
+}
+
static const struct mmc_host_ops sdhci_ops = {
.request = sdhci_request,
.set_ios = sdhci_set_ios,
.get_ro = sdhci_get_ro,
.enable_sdio_irq = sdhci_enable_sdio_irq,
+ .hardware_reset = sdhci_hardware_reset,
};
/*****************************************************************************\
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index b7b8a3b..c4cb360 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -215,6 +215,7 @@ struct sdhci_ops {
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
u8 power_mode);
unsigned int (*get_ro)(struct sdhci_host *host);
+ int (*reset_emmc)(struct sdhci_host *host);
};
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
--
1.6.6.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-02 12:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 12:36 [PATCH v2 2/2]mmc: implemented hardware reset callback in sdhci host layer Chuanxiao.Dong
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).