From 53fc40876ed9b753f935361fb1027718a184c41e Mon Sep 17 00:00:00 2001 From: Thomas Kunze Date: Thu, 5 Feb 2009 00:49:03 +0100 Subject: [PATCH 10/23] mmc_spi: add suspend and resume callbacks --- drivers/mmc/host/mmc_spi.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index ad00e16..ac6719b 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1407,6 +1407,33 @@ static int __devexit mmc_spi_remove(struct spi_device *spi) return 0; } +#ifdef CONFIG_PM +static int mmc_spi_suspend(struct spi_device *spi, pm_message_t state) +{ + struct mmc_host *mmc = dev_get_drvdata(&spi->dev); + struct mmc_spi_host *host = mmc_priv(mmc); + int ret = 0; + + if (mmc) + ret = mmc_suspend_host(mmc, state); + return ret; +} + +static int mmc_spi_resume(struct spi_device *spi) +{ + struct mmc_host *mmc = dev_get_drvdata(&spi->dev); + int ret = 0; + + if (mmc) + ret = mmc_resume_host(mmc); + + return ret; +} +#else +#define mmc_spi_suspend NULL +#define mmc_spi_resume NULL +#endif + static struct spi_driver mmc_spi_driver = { .driver = { @@ -1416,6 +1443,8 @@ static struct spi_driver mmc_spi_driver = { }, .probe = mmc_spi_probe, .remove = __devexit_p(mmc_spi_remove), + .suspend = mmc_spi_suspend, + .resume = mmc_spi_resume, }; -- 1.5.6.5