r4828 - developers/werner/wlan-spi/patches-tracking
werner at docs.openmoko.org
werner at docs.openmoko.org
Thu Nov 27 01:04:07 CET 2008
Author: werner
Date: 2008-11-27 01:04:06 +0100 (Thu, 27 Nov 2008)
New Revision: 4828
Modified:
developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch
Log:
Final backup before splitting it.
Modified: developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch 2008-11-26 23:36:24 UTC (rev 4827)
+++ developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch 2008-11-27 00:04:06 UTC (rev 4828)
@@ -20,9 +20,17 @@
Index: ktrack/drivers/mmc/host/s3cmci.c
===================================================================
--- ktrack.orig/drivers/mmc/host/s3cmci.c 2008-11-26 20:04:23.000000000 -0200
-+++ ktrack/drivers/mmc/host/s3cmci.c 2008-11-26 21:27:15.000000000 -0200
-@@ -1518,18 +1518,71 @@
++++ ktrack/drivers/mmc/host/s3cmci.c 2008-11-26 22:03:17.000000000 -0200
+@@ -57,6 +57,7 @@
+ static const int dbgmap_debug = dbg_err | dbg_debug;
+ static int f_max = -1; /* override maximum frequency limit */
++static int persist = 0; /* keep interface active across suspend/resume */
+
+ #define dbg(host, channels, args...) \
+ do { \
+@@ -1518,18 +1519,65 @@
+
#ifdef CONFIG_PM
+
@@ -48,10 +56,6 @@
+ return 0;
+}
+
-+/*
-+ * @@@ This is what s3c24xx_hcd.c does, but I don't trust it one bit ...
-+ * - clearn SDICMDCON
-+ */
+
+static int restore_regs(struct mmc_host *mmc)
+{
@@ -60,6 +64,12 @@
+ unsigned to;
+ u32 *from = host->saved;
+
++ /*
++ * Before we begin with the necromancy, make sure we don't
++ * inadvertently start something we'll regret microseconds later.
++ */
++ from[S3C2410_SDICMDCON - S3C2410_SDICON] = 0;
++
+ local_irq_save(flags);
+ for (to = S3C2410_SDICON; to != S3C2410_SDIIMSK+4; to += 4)
+ if (to != host->sdidata)
@@ -74,29 +84,31 @@
{
struct mmc_host *mmc = platform_get_drvdata(dev);
-+#if 1
-+ return save_regs(mmc);
-+#else
- return mmc_suspend_host(mmc, state);
-+#endif
+- return mmc_suspend_host(mmc, state);
++ return persist ? save_regs(mmc) : mmc_suspend_host(mmc, state);
}
static int s3cmci_resume(struct platform_device *dev)
{
struct mmc_host *mmc = platform_get_drvdata(dev);
-+#if 1
-+ return restore_regs(mmc);
-+#else
- return mmc_resume_host(mmc);
-+#endif
+- return mmc_resume_host(mmc);
++ return persist ? restore_regs(mmc) : mmc_resume_host(mmc);
}
#else /* CONFIG_PM */
+@@ -1588,6 +1636,7 @@
+ module_exit(s3cmci_exit);
+
+ module_param(f_max, int, 0644);
++module_param(persist, int, 0644);
+
+ MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
+ MODULE_LICENSE("GPL v2");
Index: ktrack/drivers/mmc/host/s3cmci.h
===================================================================
--- ktrack.orig/drivers/mmc/host/s3cmci.h 2008-11-25 12:02:47.000000000 -0200
-+++ ktrack/drivers/mmc/host/s3cmci.h 2008-11-26 20:06:06.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.h 2008-11-26 21:59:18.000000000 -0200
@@ -8,6 +8,9 @@
* published by the Free Software Foundation.
*/
@@ -114,7 +126,7 @@
+ /*
+ * Here's where we save the registers during suspend. Note that we skip
+ * SDIDATA, which is at different positions on 2410 and 2440, so
-+ *there's no "+1" in the array size.
++ * there's no "+1" in the array size.
+ */
+ u32 saved[(S3C2410_SDIIMSK-S3C2410_SDICON)/4];
+
More information about the commitlog
mailing list