summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorArnd Hannemann <arnd@arndnet.de>2010-08-24 17:27:01 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-10-29 00:29:13 +0200
commit777271d0f33da306575ef776c75f66fc27246bf0 (patch)
tree24ee153012443783166946cac260c6ccc67de1b2 /drivers/mmc
parent998283e2e359249133f2f47db26669a55ff25c98 (diff)
downloadtalos-op-linux-777271d0f33da306575ef776c75f66fc27246bf0.tar.gz
talos-op-linux-777271d0f33da306575ef776c75f66fc27246bf0.zip
mmc: Allow the platform to specify the sh_mmcif get_cd handler
In some platforms (e.g. AP4EVB) the card detect pin of a slot is not directly connected to the sh_mmcif controller, so that polling needs to be used. To overcome the overhead induced by querying the controller on each poll cycle, card detection can be handled in the platform code more efficiently. This patch exposes a get_cd hook for that purpose. Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mmcif.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 0f06b8002814..ddd09840520b 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -710,9 +710,21 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->bus_width = ios->bus_width;
}
+static int sh_mmcif_get_cd(struct mmc_host *mmc)
+{
+ struct sh_mmcif_host *host = mmc_priv(mmc);
+ struct sh_mmcif_plat_data *p = host->pd->dev.platform_data;
+
+ if (!p->get_cd)
+ return -ENOSYS;
+ else
+ return p->get_cd(host->pd);
+}
+
static struct mmc_host_ops sh_mmcif_ops = {
.request = sh_mmcif_request,
.set_ios = sh_mmcif_set_ios,
+ .get_cd = sh_mmcif_get_cd,
};
static void sh_mmcif_detect(struct mmc_host *mmc)
OpenPOWER on IntegriCloud