diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-01-26 16:46:48 +0100 |
---|---|---|
committer | Henrik Aberg <henrik.aberg@stericsson.com> | 2011-02-18 10:30:59 +0100 |
commit | ccc89479f873e6991e8e9b3316bef7de67768af9 (patch) | |
tree | 271e1c5c6e7caedac7223a758cdfadbbdb4732fd | |
parent | e2d9e98773a2f126854a9cd01c314afb752b0510 (diff) |
MMCI: Add support for wakeup handler
Each MMC/SD/SDIO host are now able to execute specific tasks
of how to handle wakeup and shutdown. This is done by
implementing this new wakeup handler function, which is called
from the enable and disable function.
Typically a SDIO host will need to re-configure the irq handling
of the SDIO irq pin (DAT1) before going to sleep. Otherwise no
SDIO irqs will be received.
ST-Ericsson ID: 318396
Change-Id: Icaa2ce73e5667df2af6d7b2d36addb6fbbff73bd
Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13641
Reviewed-by: QATOOLS
Reviewed-by: Sebastian RASMUSSEN <sebastian.rasmussen@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/mmc/host/mmci.c | 14 | ||||
-rw-r--r-- | include/linux/amba/mmci.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4576f8a8bc3..0079c2035d0 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1238,6 +1238,13 @@ static int mmci_enable(struct mmc_host *mmc) } } + /* + * To be able to handle specific wake up scenarios for each host, + * the following function shall be implemented. + */ + if (host->plat->wakeup_handler) + host->plat->wakeup_handler(host->mmc, true); + /* Enable IRQ */ mask = MCI_IRQENABLE; /* Don't use the datablockend flag if it's broken */ @@ -1281,6 +1288,13 @@ static int mmci_disable(struct mmc_host *mmc, int lazy) */ writel(0, host->base + MMCIMASK0); + /* + * To be able to handle specific shutdown scenarios for each host, + * the following function shall be implemented. + */ + if (host->plat->wakeup_handler) + host->plat->wakeup_handler(host->mmc, false); + mmc_power_save_host(host->mmc); clk_disable(host->clk); diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 010089ddbaa..006e9ba4a1d 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h @@ -30,6 +30,7 @@ struct dma_chan; * whether a card is present in the MMC slot or not * @gpio_wp: read this GPIO pin to see if the card is write protected * @gpio_cd: read this GPIO pin to detect card insertion + * @wakeup_handler: function handling specific wakeup and shutdown actions * @cd_invert: true if the gpio_cd pin value is active low * @indicate_sigdir: true if bus signal direction indication is desired * @capabilities: the capabilities of the block as implemented in @@ -58,6 +59,7 @@ struct mmci_platform_data { unsigned int (*status)(struct device *); int gpio_wp; int gpio_cd; + void (*wakeup_handler)(struct mmc_host *host, bool wakeup); bool cd_invert; bool indicate_sigdir; unsigned long capabilities; |