Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62302
b: refs/heads/master
c: 63b6643
h: refs/heads/master
v: v3
  • Loading branch information
Marc Pignat authored and Pierre Ossman committed Jul 20, 2007
1 parent 183849e commit 8199740
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81764fa9a472dd72b93385f30f718ed4f98ec129
refs/heads/master: 63b66438860f246f25f5563cde4978cf255cb810
13 changes: 12 additions & 1 deletion trunk/drivers/mmc/host/at91_mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,10 @@ static int __init at91_mci_probe(struct platform_device *pdev)
/*
* Add host to MMC layer
*/
if (host->board->det_pin)
if (host->board->det_pin) {
host->present = !at91_get_gpio_value(host->board->det_pin);
device_init_wakeup(&pdev->dev, 1);
}
else
host->present = -1;

Expand Down Expand Up @@ -940,6 +942,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
host = mmc_priv(mmc);

if (host->present != -1) {
device_init_wakeup(&pdev->dev, 0);
free_irq(host->board->det_pin, host);
cancel_delayed_work(&host->mmc->detect);
}
Expand All @@ -966,8 +969,12 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
{
struct mmc_host *mmc = platform_get_drvdata(pdev);
struct at91mci_host *host = mmc_priv(mmc);
int ret = 0;

if (device_may_wakeup(&pdev->dev))
enable_irq_wake(host->board->det_pin);

if (mmc)
ret = mmc_suspend_host(mmc, state);

Expand All @@ -977,8 +984,12 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
static int at91_mci_resume(struct platform_device *pdev)
{
struct mmc_host *mmc = platform_get_drvdata(pdev);
struct at91mci_host *host = mmc_priv(mmc);
int ret = 0;

if (device_may_wakeup(&pdev->dev))
disable_irq_wake(host->board->det_pin);

if (mmc)
ret = mmc_resume_host(mmc);

Expand Down

0 comments on commit 8199740

Please sign in to comment.