From: Arnd Hannemann <arnd@arndnet.de>
To: ian@mnementh.co.uk
Cc: sameo@linux.intel.com, linux-mmc@vger.kernel.org,
linux-sh@vger.kernel.org, yusuke.goda.sx@renesas.com,
Arnd Hannemann <arnd@arndnet.de>
Subject: [PATCH 1/4] tmio_mmc: Allow the mfd driver to specify get_cd handler
Date: Tue, 24 Aug 2010 15:26:59 +0000 [thread overview]
Message-ID: <1282663622-20564-2-git-send-email-arnd@arndnet.de> (raw)
In-Reply-To: <1282663622-20564-1-git-send-email-arnd@arndnet.de>
Some controllers, supported by the tmio_mmc driver do not have the card detect
pin of a slot connected, so that polling needs to be used and card detection is
handled by other means.
This patch exposes a get_cd hook for that purpose.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
drivers/mmc/host/tmio_mmc.c | 13 +++++++++++++
include/linux/mfd/tmio.h | 1 +
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index ee7d0a5..fe2ebf6 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -755,10 +755,23 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1;
}
+static int tmio_mmc_get_cd(struct mmc_host *mmc)
+{
+ struct tmio_mmc_host *host = mmc_priv(mmc);
+ struct mfd_cell *cell = host->pdev->dev.platform_data;
+ struct tmio_mmc_data *pdata = cell->driver_data;
+
+ if (!pdata->get_cd)
+ return -ENOSYS;
+ else
+ return pdata->get_cd(host->pdev);
+}
+
static const struct mmc_host_ops tmio_mmc_ops = {
.request = tmio_mmc_request,
.set_ios = tmio_mmc_set_ios,
.get_ro = tmio_mmc_get_ro,
+ .get_cd = tmio_mmc_get_cd,
};
#ifdef CONFIG_PM
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f07425b..24c43bb 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -74,6 +74,7 @@ struct tmio_mmc_data {
struct tmio_mmc_dma *dma;
void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state);
+ int (*get_cd)(struct platform_device *host);
};
/*
--
1.7.0.4
next prev parent reply other threads:[~2010-08-24 15:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-24 15:26 [PATCH 0/4] Fix/improve hotplug for sh_mobile_sdhi/tmio_mmc/sh_mmcif Arnd Hannemann
2010-08-24 15:26 ` Arnd Hannemann [this message]
2010-09-10 16:10 ` [PATCH 1/4] tmio_mmc: Allow the mfd driver to specify get_cd Samuel Ortiz
2010-09-12 12:51 ` Arnd Hannemann
2010-08-24 15:27 ` [PATCH 2/4] sh_mobile_sdhi: Allow the platform " Arnd Hannemann
2010-08-24 15:27 ` [PATCH 3/4] sh_mmcif: Allow the platform to specify own get_cd handler Arnd Hannemann
2010-08-26 4:59 ` [PATCH 3/4] sh_mmcif: Allow the platform to specify own get_cd Yusuke Goda
2010-08-24 15:27 ` [PATCH 4/4] ARM: mach-shmobile: ap4evb: Fix hotplug for SDHI1 Arnd Hannemann
2010-08-26 5:00 ` Yusuke Goda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282663622-20564-2-git-send-email-arnd@arndnet.de \
--to=arnd@arndnet.de \
--cc=ian@mnementh.co.uk \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=yusuke.goda.sx@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).