From 272516419479e5266d1e3ea14823d35283492efc Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 15 Oct 2013 10:35:42 +0200 Subject: [PATCH] mci: bcm2835: Add detect callback support for hardware device Signed-off-by: Sascha Hauer --- drivers/mci/mci-bcm2835.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c index 576e8da6f..2ffdeecc0 100644 --- a/drivers/mci/mci-bcm2835.c +++ b/drivers/mci/mci-bcm2835.c @@ -516,6 +516,13 @@ static u32 bcm2835_mci_get_emmc_clock(struct msg_get_clock_rate *clk_data) return 0; } +static int bcm2835_mci_detect(struct device_d *dev) +{ + struct bcm2835_mci_host *host = dev->priv; + + return mci_detect_card(&host->mci); +} + static int bcm2835_mci_probe(struct device_d *hw_dev) { struct bcm2835_mci_host *host; @@ -566,6 +573,9 @@ static int bcm2835_mci_probe(struct device_d *hw_dev) host->mci.f_min = MIN_FREQ; host->mci.f_max = host->max_clock; + hw_dev->priv = host; + hw_dev->detect = bcm2835_mci_detect, + /* * The Arasan has a bugette whereby it may lose the content of * successive writes to registers that are within two SD-card clock