mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] mci fsl-esdhc: implement detect driver callback
Date: Thu, 30 May 2013 14:40:31 +0200	[thread overview]
Message-ID: <1369917631-31436-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1369917631-31436-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/imx-esdhc.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index 1e3b307..1c710e8 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -495,6 +495,13 @@ static int esdhc_reset(void __iomem *regs)
 	return 0;
 }
 
+static int fsl_esdhc_detect(struct device_d *dev)
+{
+	struct fsl_esdhc_host *host = dev->priv;
+
+	return mci_detect_card(&host->mci);
+}
+
 static int fsl_esdhc_probe(struct device_d *dev)
 {
 	struct fsl_esdhc_host *host;
@@ -552,15 +559,17 @@ static int fsl_esdhc_probe(struct device_d *dev)
 	host->mci.card_present = esdhc_card_present;
 	host->mci.hw_dev = dev;
 
+	dev->detect = fsl_esdhc_detect,
+
 	rate = clk_get_rate(host->clk);
 	host->mci.f_min = rate >> 12;
 	if (host->mci.f_min < 200000)
 		host->mci.f_min = 200000;
 	host->mci.f_max = rate;
 
-	mci_register(&host->mci);
+	dev->priv = host;
 
-	return 0;
+	return mci_register(&host->mci);
 }
 
 static __maybe_unused struct of_device_id fsl_esdhc_compatible[] = {
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2013-05-30 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 12:40 [PATCH] 'detect' command to detect devices Sascha Hauer
2013-05-30 12:40 ` [PATCH 1/3] devices: add detect mechanism Sascha Hauer
2013-05-30 12:40 ` [PATCH 2/3] mci: implement detect driver callback Sascha Hauer
2013-05-30 12:40 ` Sascha Hauer [this message]

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=1369917631-31436-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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