From 3dba2bed8216623e281409788de8c7c322959421 Mon Sep 17 00:00:00 2001 From: Rahul Bansal Date: Mon, 13 Dec 2010 16:18:12 +0530 Subject: [arm/tegra] Support for Wake-On-Wireless Event. Support for device wakeup on receiving in-band SDIO-WIFI interrupt for incoming wifi pakcket. Bug: 767438 Change-Id: Ibc1f95cc38eacef84e528e1beca6a4fdbdc36338 Reviewed-on: http://git-master/r/12702 Reviewed-by: Rahul Bansal Tested-by: Rahul Bansal Reviewed-by: Rakesh Kumar Reviewed-by: Bharat Nihalani Tested-by: Bharat Nihalani --- arch/arm/mach-tegra/board-ventana-power.c | 4 ++-- arch/arm/mach-tegra/board-ventana-sdhci.c | 4 ++++ drivers/mmc/host/sdhci-tegra.c | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) mode change 100644 => 100755 arch/arm/mach-tegra/board-ventana-power.c mode change 100644 => 100755 arch/arm/mach-tegra/board-ventana-sdhci.c mode change 100644 => 100755 drivers/mmc/host/sdhci-tegra.c diff --git a/arch/arm/mach-tegra/board-ventana-power.c b/arch/arm/mach-tegra/board-ventana-power.c old mode 100644 new mode 100755 index d56ac998a385..e90775410b3c --- a/arch/arm/mach-tegra/board-ventana-power.c +++ b/arch/arm/mach-tegra/board-ventana-power.c @@ -183,9 +183,9 @@ static struct tegra_suspend_platform_data ventana_suspend_data = { .separate_req = true, .corereq_high = false, .sysclkreq_high = true, - .wake_enb = TEGRA_WAKE_GPIO_PV2 | TEGRA_WAKE_GPIO_PC7, + .wake_enb = TEGRA_WAKE_GPIO_PV2 | TEGRA_WAKE_GPIO_PC7 | TEGRA_WAKE_GPIO_PY6, .wake_high = 0, - .wake_low = TEGRA_WAKE_GPIO_PV2, + .wake_low = TEGRA_WAKE_GPIO_PV2 | TEGRA_WAKE_GPIO_PY6, .wake_any = TEGRA_WAKE_GPIO_PC7, }; diff --git a/arch/arm/mach-tegra/board-ventana-sdhci.c b/arch/arm/mach-tegra/board-ventana-sdhci.c old mode 100644 new mode 100755 index 7dc76f6111cc..9eb7a71306e1 --- a/arch/arm/mach-tegra/board-ventana-sdhci.c +++ b/arch/arm/mach-tegra/board-ventana-sdhci.c @@ -226,6 +226,10 @@ static int __init ventana_wifi_init(void) gpio_direction_output(VENTANA_WLAN_RST, 0); platform_device_register(&ventana_wifi_device); + + device_init_wakeup(&ventana_wifi_device.dev, 1); + device_set_wakeup_enable(&ventana_wifi_device.dev, 0); + return 0; } int __init ventana_sdhci_init(void) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c old mode 100644 new mode 100755 index b6308d5a9572..a16aa2b53417 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -283,6 +283,10 @@ static int tegra_sdhci_suspend(struct platform_device *pdev, pm_message_t state) u16 clk; unsigned int clock = 100000; + if (device_may_wakeup(&pdev->dev)) { + enable_irq_wake(host->sdhci->irq); + } + /* save interrupt status before suspending */ host->sdhci_ints = sdhci_readl(host->sdhci, SDHCI_INT_ENABLE); @@ -320,6 +324,10 @@ static int tegra_sdhci_resume(struct platform_device *pdev) if (host->card_always_on && is_card_sdio(host->sdhci->mmc->card)) { int ret = 0; + if (device_may_wakeup(&pdev->dev)) { + disable_irq_wake(host->sdhci->irq); + } + /* soft reset SD host controller and enable interrupts */ ret = tegra_sdhci_restore(host->sdhci); if (ret) { -- cgit v1.2.3