summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2013-06-24 17:02:37 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2013-07-07 10:29:51 -0700
commit6ca37a6dbbd683db03caa5fdfeb5c79b7f2cbec3 (patch)
tree02e627a482d274d85f863bd93fd0791e8e563d77 /drivers
parent4d98ebdfe6afc86fde88fa459c9f038d55e2f3be (diff)
sdhci/sdhci-esdhc-imx: Allow platform-specific set_power callback
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c15
-rw-r--r--drivers/mmc/host/sdhci.c4
-rw-r--r--drivers/mmc/host/sdhci.h2
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 7b08196eb4cf..49f427e81c89 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -753,6 +753,18 @@ static void plt_clk_ctrl(struct sdhci_host *host, bool enable)
}
}
+static void sdhci_platform_set_power(struct sdhci_host *host,
+ int on)
+{
+ struct esdhc_platform_data *boarddata
+ = host->mmc->parent->platform_data;
+ pr_debug("%s----------------- %d: %p:%p\n", __func__, on,
+ boarddata,
+ boarddata ? boarddata->set_power : 0);
+ if (boarddata && boarddata->set_power)
+ boarddata->set_power(on);
+}
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = esdhc_readl_le,
.read_w = esdhc_readw_le,
@@ -764,6 +776,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_max_clock = esdhc_pltfm_get_max_clock,
.get_min_clock = esdhc_pltfm_get_min_clock,
.platform_8bit_width = plt_8bit_width,
+ .platform_set_power = sdhci_platform_set_power,
.platform_clk_ctrl = plt_clk_ctrl,
};
@@ -877,6 +890,8 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
reg &= ~SDHCI_MIX_CTRL_DDREN;
writel(reg, host->ioaddr + SDHCI_MIX_CTRL);
+ pr_debug("-----------%s: boarddata %p, set_power %p\n",
+ __func__, boarddata, boarddata->set_power);
if (boarddata) {
/* Device is always present, e.x, populated emmc device */
if (boarddata->always_present) {
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d34486e8c9f4..7d1f287c2a9f 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1343,6 +1343,10 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
sdhci_set_power(host, -1);
else
sdhci_set_power(host, ios->vdd);
+ if (host->ops->platform_set_power)
+ host->ops->platform_set_power
+ (host,
+ MMC_POWER_OFF != ios->power_mode);
if (host->ops->platform_send_init_74_clocks)
host->ops->platform_send_init_74_clocks(host, ios->power_mode);
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index ef45fa98dc90..a59721c1364e 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -267,6 +267,8 @@ struct sdhci_ops {
unsigned int (*get_timeout_clock)(struct sdhci_host *host);
int (*platform_8bit_width)(struct sdhci_host *host,
int width);
+ void (*platform_set_power)(struct sdhci_host *host,
+ int on);
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
u8 power_mode);
unsigned int (*get_ro)(struct sdhci_host *host);