summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-29 13:15:21 +0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-29 13:16:26 +0200
commit139350bc563a63c21c9d07587092586f07c20b70 (patch)
treecac4b82a5f37a7bbc433bb68d65e1ad6a5155a72
parent03aa1f973871d4b34490e02db5e3fa0e7f03073a (diff)
ccwmx51: Make it possible to disable SD and SMSC wake up sources.
Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-rw-r--r--drivers/mmc/host/mx_sdhci.c11
-rw-r--r--drivers/net/smsc911x.c4
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mmc/host/mx_sdhci.c b/drivers/mmc/host/mx_sdhci.c
index 22d18b0bf110..5a68a8e02fe2 100644
--- a/drivers/mmc/host/mx_sdhci.c
+++ b/drivers/mmc/host/mx_sdhci.c
@@ -37,6 +37,7 @@
#include <linux/mmc/card.h>
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
+#include <linux/irq.h>
#include <asm/dma.h>
#include <asm/io.h>
@@ -1650,6 +1651,8 @@ static int sdhci_suspend(struct platform_device *pdev, pm_message_t state)
{
struct sdhci_chip *chip;
int i, ret;
+ struct irq_desc *desc;
+ int irq;
chip = dev_get_drvdata(&pdev->dev);
if (!chip)
@@ -1657,8 +1660,14 @@ static int sdhci_suspend(struct platform_device *pdev, pm_message_t state)
DBG("Suspending...\n");
+ irq = platform_get_irq(pdev, 1);
if( device_may_wakeup( &pdev->dev ) )
- enable_irq_wake(platform_get_irq(pdev, 1));
+ enable_irq_wake(irq);
+ else {
+ desc = irq_to_desc(irq);
+ if(desc->status & IRQ_WAKEUP)
+ disable_irq_wake(irq);
+ }
for (i = 0; i < chip->num_slots; i++) {
if (!chip->hosts[i])
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 89c1f3d258e7..d4c82f5fa555 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -2349,6 +2349,7 @@ static int smsc911x_suspend(struct platform_device *pdev, pm_message_t state) {
struct net_device *ndev;
struct smsc911x_data *pdata;
int retval;
+ struct irq_desc *desc;
ndev = platform_get_drvdata(pdev);
pdata = netdev_priv(ndev);
@@ -2398,6 +2399,9 @@ static int smsc911x_suspend(struct platform_device *pdev, pm_message_t state) {
enable_irq_wake(ndev->irq);
} else {
+ desc = irq_to_desc(ndev->irq);
+ if(desc->status & IRQ_WAKEUP)
+ disable_irq_wake(ndev->irq);
/*
* Enter into the power mode D2 (the controller doesn't
* support the mode D3)