summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.28/collie/0010-mmc_spi-add-suspend-and-resume-callbacks.patch
blob: fbf1b4573b8246a608852ad834c6a551cd1b978a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 53fc40876ed9b753f935361fb1027718a184c41e Mon Sep 17 00:00:00 2001
From: Thomas Kunze <thommycheck@gmx.de>
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