summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-21 18:29:48 +0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-23 11:26:39 +0200
commit2512cc2076c2af03cab91aed79a0a9eee1222528 (patch)
treefbd7870d2a578f9f19ad2fd55f35fd479d404336
parentff2ec0ade9360e9672ad667ab0cea4910cb32fb6 (diff)
ccwmx51js: Implement MMC/SD as suspend wake up source
Note that the microSD card has no card detect capability so only the SD card can act as a wake up source. Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-rw-r--r--arch/arm/mach-mx5/devices_ccwmx51.c4
-rw-r--r--drivers/mmc/host/mx_sdhci.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-mx5/devices_ccwmx51.c b/arch/arm/mach-mx5/devices_ccwmx51.c
index 074e4d369e89..4e4a07f7c4a7 100644
--- a/arch/arm/mach-mx5/devices_ccwmx51.c
+++ b/arch/arm/mach-mx5/devices_ccwmx51.c
@@ -126,7 +126,7 @@ struct mxc_mmc_platform_data mmc1_data = {
.caps = MMC_CAP_4_BIT_DATA,
.min_clk = 400000,
.max_clk = 52000000,
- .card_inserted_state = 1,
+ .card_inserted_state = 0,
.status = sdhc_get_card_det_status,
.wp_status = sdhc_write_protect,
.clock_mmc = "esdhc_clk",
@@ -139,7 +139,7 @@ struct mxc_mmc_platform_data mmc3_data = {
.caps = MMC_CAP_4_BIT_DATA,
.min_clk = 150000,
.max_clk = 50000000,
- .card_inserted_state = 0,
+ .card_inserted_state = 1,
.status = sdhc_get_card_det_status,
.wp_status = sdhc_write_protect,
.clock_mmc = "esdhc_clk",
diff --git a/drivers/mmc/host/mx_sdhci.c b/drivers/mmc/host/mx_sdhci.c
index b36a3ef8b005..22d18b0bf110 100644
--- a/drivers/mmc/host/mx_sdhci.c
+++ b/drivers/mmc/host/mx_sdhci.c
@@ -1657,6 +1657,9 @@ static int sdhci_suspend(struct platform_device *pdev, pm_message_t state)
DBG("Suspending...\n");
+ if( device_may_wakeup( &pdev->dev ) )
+ enable_irq_wake(platform_get_irq(pdev, 1));
+
for (i = 0; i < chip->num_slots; i++) {
if (!chip->hosts[i])
continue;
@@ -2006,6 +2009,10 @@ static int __devinit sdhci_probe_slot(struct platform_device
mmc_hostname(mmc), host->detect_irq, host->irq,
(host->flags & SDHCI_USE_DMA) ? "INTERNAL DMA" : "PIO");
+ /* Mark the SD/MMC as capable of being a wake up source */
+ if ( mmc_plat->card_inserted_state )
+ device_set_wakeup_capable(&pdev->dev,1);
+
return 0;
out6:
@@ -2113,7 +2120,7 @@ static int sdhci_probe(struct platform_device *pdev)
* FIXME
* PPH This should be revisited and implemented a bit different.
* We pass quirks per device through the platform_data variable to allow
- * different settings on each interface (DMA vs PIO, etc.
+ * different settings on each interface (DMA vs PIO, etc.
*/
if (mmc_plat->quirks != 0)
chip->quirks = mmc_plat->quirks;