]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mmc: Allow the tmio_mmc mfd driver to specify get_cd handler
authorArnd Hannemann <arnd@arndnet.de>
Tue, 24 Aug 2010 15:26:59 +0000 (17:26 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 28 Oct 2010 22:29:08 +0000 (00:29 +0200)
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>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mmc/host/tmio_mmc.c
include/linux/mfd/tmio.h

index 69d98e3bf6abaa3c784d1d70f171387b3142eb64..1a47221d01a4ff6af673e2057c3a62aa758d516b 100644 (file)
@@ -756,10 +756,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
index f07425bc3dcdef6fa37f8bc8f7237e0e41971727..24c43bbad541e250a6ce76a9de4860ed22f91afd 100644 (file)
@@ -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);
 };
 
 /*