r4821 - developers/werner/wlan-spi/patches-tracking
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Nov 25 02:43:05 CET 2008
Author: werner
Date: 2008-11-25 02:43:05 +0100 (Tue, 25 Nov 2008)
New Revision: 4821
Added:
developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch
Log:
*** WORK IN PROGRESS. DOESN'T DO ANYTHING USEFUL YET. ***
Try to restore S3C MCI state such that Atheros module can be kept up
and running during suspend.
Added: developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/experiment-s3cmci-suspend-softly.patch 2008-11-25 01:43:05 UTC (rev 4821)
@@ -0,0 +1,113 @@
+Index: ktrack/drivers/mmc/core/core.c
+===================================================================
+--- ktrack.orig/drivers/mmc/core/core.c 2008-11-24 22:52:14.000000000 -0200
++++ ktrack/drivers/mmc/core/core.c 2008-11-24 22:53:53.000000000 -0200
+@@ -57,11 +57,13 @@
+ /*
+ * Internal function. Flush all scheduled work from the MMC work queue.
+ */
+-static void mmc_flush_scheduled_work(void)
++void mmc_flush_scheduled_work(void)
+ {
+ flush_workqueue(workqueue);
+ }
+
++EXPORT_SYMBOL_GPL(mmc_flush_scheduled_work);
++
+ /**
+ * mmc_request_done - finish processing an MMC request
+ * @host: MMC host which completed request
+Index: ktrack/drivers/mmc/host/s3cmci.c
+===================================================================
+--- ktrack.orig/drivers/mmc/host/s3cmci.c 2008-11-24 22:26:54.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.c 2008-11-24 23:40:18.000000000 -0200
+@@ -1518,18 +1518,61 @@
+
+ #ifdef CONFIG_PM
+
++
++void mmc_flush_scheduled_work(void);
++
++
++static int save_regs(struct mmc_host *mmc)
++{
++ struct s3cmci_host *host = mmc_priv(mmc);
++ unsigned from;
++ u32 *to = host->saved;
++
++ mmc_flush_scheduled_work();
++ for (from = S3C2410_SDICON; from != S3C2410_SDIIMSK+4; from += 4)
++ if (from != host->sdidata)
++ *to++ = readl(host->base + from);
++ BUG_ON(to-host->saved != ARRAY_SIZE(host->saved));
++ return 0;
++}
++
++/*
++ * @@@ This is what s3c24xx_hcd.c does, but I don't trust it one bit ...
++ */
++
++static int restore_regs(struct mmc_host *mmc)
++{
++ struct s3cmci_host *host = mmc_priv(mmc);
++ unsigned to;
++ u32 *from = host->saved;
++
++ for (to = S3C2410_SDICON; to != S3C2410_SDIIMSK+4; to += 4)
++ if (to != host->sdidata)
++ *from++ = readl(host->base + to);
++ BUG_ON(from-host->saved != ARRAY_SIZE(host->saved));
++ return 0;
++}
++
+ static int s3cmci_suspend(struct platform_device *dev, pm_message_t state)
+ {
+ struct mmc_host *mmc = platform_get_drvdata(dev);
+
++#if 1
++ return save_regs(mmc);
++#else
+ return mmc_suspend_host(mmc, state);
++#endif
+ }
+
+ 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
+ }
+
+ #else /* CONFIG_PM */
+Index: ktrack/drivers/mmc/host/s3cmci.h
+===================================================================
+--- ktrack.orig/drivers/mmc/host/s3cmci.h 2008-11-24 22:41:54.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.h 2008-11-24 23:37:06.000000000 -0200
+@@ -8,6 +8,9 @@
+ * published by the Free Software Foundation.
+ */
+
++
++#include <mach/regs-sdi.h>
++
+ /* FIXME: DMA Resource management ?! */
+ #define S3CMCI_DMA 0
+
+@@ -68,6 +71,13 @@
+ unsigned int ccnt, dcnt;
+ struct tasklet_struct pio_tasklet;
+
++ /*
++ * 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.
++ */
++ u32 saved[(S3C2410_SDIIMSK-S3C2410_SDICON)/4];
++
+ #ifdef CONFIG_CPU_FREQ
+ struct notifier_block freq_transition;
+ #endif
More information about the commitlog
mailing list