diff options
author | Rahul Bansal <rbansal@nvidia.com> | 2010-10-27 18:10:15 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2010-11-15 20:13:56 -0800 |
commit | 696d14b5dee46679980c9a41883d29feb19fa9b4 (patch) | |
tree | b2c571a0744248c9c5a76cf83d8e33c66d707afb /drivers | |
parent | 29d62945618a5767b32c3dbc5a6cace5b9b8ac50 (diff) |
[arm/tegra] Support for Wake-On-Wireless Event.
Support for device wakeup on receiving SDIO
interrupt in LP1/LP0 for incoming wifi pakcket.
Bug: 730157
Change-Id: Ia2e9bf2af215f33d6d6d8d78ba0cdf2d71011917
Reviewed-on: http://git-master/r/9813
Reviewed-by: Rahul Bansal <rbansal@nvidia.com>
Tested-by: Rahul Bansal <rbansal@nvidia.com>
Reviewed-by: Rakesh Kumar <krakesh@nvidia.com>
Tested-by: Rakesh Kumar <krakesh@nvidia.com>
Reviewed-by: Udaykumar Rameshchan Raval <uraval@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/mmc/host/sdhci-tegra.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 7d4006084eb1..60d23213e7d1 100755 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -23,6 +23,8 @@ #define NV_DEBUG 0 #include <linux/mmc/host.h> +#include <linux/mmc/sdio_func.h> + #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/irq.h> @@ -461,29 +463,26 @@ static int tegra_sdhci_suspend(struct device *dev) int ret = 0; if (host->card_always_on && is_card_sdio(sdhost->mmc->card)) { - struct mmc_ios ios; - ios.clock = 0; - ios.vdd = 0; - ios.power_mode = MMC_POWER_OFF; - ios.bus_width = MMC_BUS_WIDTH_1; - ios.timing = MMC_TIMING_LEGACY; + int div; + u16 clk; + unsigned int clock = 100000; /* save interrupt status before suspending */ host->sdhci_ints = sdhci_readl(sdhost, SDHCI_INT_ENABLE); - sdhost->mmc->ops->set_ios(sdhost->mmc, &ios); - /* keep CARD_INT enabled - if used as wakeup source */ - if (host->sdhci_ints & SDHCI_INT_CARD_INT) { - u32 ier = sdhci_readl(sdhost, SDHCI_INT_ENABLE); - ier |= SDHCI_INT_CARD_INT; - sdhci_writel(sdhost, ier, SDHCI_INT_ENABLE); - sdhci_writel(sdhost, ier, SDHCI_SIGNAL_ENABLE); - - if (sdhost->quirks & SDHCI_QUIRK_ENABLE_INTERRUPT_AT_BLOCK_GAP) { - u8 gap_ctrl = sdhci_readb(sdhost, SDHCI_BLOCK_GAP_CONTROL); - gap_ctrl |= 0x8; - sdhci_writeb(sdhost, gap_ctrl, SDHCI_BLOCK_GAP_CONTROL); - } + + /* reduce host controller clk and card clk to 100 KHz */ + tegra_sdhci_set_clock(sdhost, clock); + sdhci_writew(sdhost, 0, SDHCI_CLOCK_CONTROL); + + for (div = 1;div < 256;div *= 2) { + if ((sdhost->max_clk / div) <= clock) + break; } + div >>= 1; + + clk = div << SDHCI_DIVIDER_SHIFT; + clk |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; + sdhci_writew(sdhost, clk, SDHCI_CLOCK_CONTROL); return ret; } |