MMC: Tegra: Enabling wake up event
naveenk [Fri, 18 Nov 2011 08:48:05 +0000 (13:48 +0530)]
Enabling wake up event for sd card insertion/deletion
to handle insertion/removal events during suspend

Bug 895672

Change-Id: If9c59889d22b19b99584a8f01cb7bf7316c3b8b5
Signed-off-by: naveenk <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/65971
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R29c4dd500afac98150f7347f5f87d77efe45b676

drivers/mmc/host/sdhci-tegra.c

index 72ef8e1..6228b65 100644 (file)
@@ -532,6 +532,11 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
                        dev_err(mmc_dev(host->mmc), "request irq error\n");
                        goto err_cd_irq_req;
                }
+               rc = enable_irq_wake(gpio_to_irq(plat->cd_gpio));
+               if (rc < 0)
+                       dev_err(mmc_dev(host->mmc),
+                               "SD card wake-up event registration"
+                                       "failed with eroor: %d\n", rc);
 
        } else if (plat->mmc_data.register_status_notify) {
                plat->mmc_data.register_status_notify(sdhci_status_notify_cb, host);
@@ -676,6 +681,8 @@ static int __devexit sdhci_tegra_remove(struct platform_device *pdev)
 
        plat = pdev->dev.platform_data;
 
+       disable_irq_wake(gpio_to_irq(plat->cd_gpio));
+
        if (tegra_host->vdd_slot_reg) {
                regulator_disable(tegra_host->vdd_slot_reg);
                regulator_put(tegra_host->vdd_slot_reg);