* [PATCH] 7/7 AU1100 MMC support
@ 2006-08-09 21:12 Rodolfo Giometti
2006-08-10 8:40 ` Rodolfo Giometti
0 siblings, 1 reply; 2+ messages in thread
From: Rodolfo Giometti @ 2006-08-09 21:12 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
Power Management support for AU1100 (PIO mode) added.
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
[-- Attachment #2: patch-mmc-pm-au1100 --]
[-- Type: text/plain, Size: 2962 bytes --]
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c
index 61acf6b..920486d 100644
--- a/drivers/mmc/au1xmmc.c
+++ b/drivers/mmc/au1xmmc.c
@@ -19,6 +19,10 @@
* Rodolfo Giometti <giometti@linux.it>
* Eurotech S.p.A. <info@eurotech.it>
+ * Power Management Support for AU1100 in PIO mode by:
+ * Rodolfo Giometti <giometti@linux.it>
+ * Eurotech S.p.A. <info@eurotech.it>
+
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@@ -1086,11 +1090,79 @@ #endif
return 0;
}
+#ifdef CONFIG_PM
+static u32 sd_txport[2];
+static u32 sd_rxport[2];
+static u32 sd_config[2];
+static u32 sd_config2[2];
+static u32 sd_blksize[2];
+static u32 sd_status[2];
+static u32 sd_cmd[2];
+static u32 sd_cmdarg[2];
+static u32 sd_timeout[2];
+
+static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct au1xmmc_host *host = platform_get_drvdata(pdev);
+ struct mmc_host *mmc = host->mmc;
+ int ret = 0;
+
+printk("GU au1xmmc_suspend %d\n", host->id);
+ if (mmc)
+ ret = mmc_suspend_host(mmc, state);
+
+ sd_txport[host->id] = au_readl(HOST_TXPORT(host));
+ sd_rxport[host->id] = au_readl(HOST_RXPORT(host));
+ sd_config[host->id] = au_readl(HOST_CONFIG(host));
+ sd_config2[host->id] = au_readl(HOST_CONFIG2(host));
+ sd_blksize[host->id] = au_readl(HOST_BLKSIZE(host));
+ sd_status[host->id] = au_readl(HOST_STATUS(host));
+ sd_cmd[host->id] = au_readl(HOST_CMD(host));
+ sd_cmdarg[host->id] = au_readl(HOST_CMDARG(host));
+ sd_timeout[host->id] = au_readl(HOST_TIMEOUT(host));
+
+ au_writel(0x0, HOST_ENABLE(host));
+
+printk("GU au1xmmc_suspend END\n");
+ return ret;
+}
+
+static int au1xmmc_resume(struct platform_device *pdev)
+{
+ struct au1xmmc_host *host = platform_get_drvdata(pdev);
+ struct mmc_host *mmc = host->mmc;
+ int ret = 0;
+
+ au1xmmc_reset_controller(host);
+
+ au_writel(sd_txport[host->id], HOST_TXPORT(host));
+ au_writel(sd_rxport[host->id], HOST_RXPORT(host));
+ au_writel(sd_config[host->id], HOST_CONFIG(host));
+ au_writel(sd_config2[host->id], HOST_CONFIG2(host));
+ au_writel(sd_blksize[host->id], HOST_BLKSIZE(host));
+ au_writel(sd_status[host->id], HOST_STATUS(host));
+ au_writel(sd_cmd[host->id], HOST_CMD(host));
+ au_writel(sd_cmdarg[host->id], HOST_CMDARG(host));
+ au_writel(sd_timeout[host->id], HOST_TIMEOUT(host));
+
+printk("GU au1xmmc_resume\n");
+ if (mmc)
+ ret = mmc_resume_host(mmc);
+
+printk("GU au1xmmc_resume END\n");
+ return ret;
+}
+
+#else
+#define au1xmmc_suspend NULL
+#define au1xmmc_resume NULL
+#endif
+
static struct platform_driver au1xmmc_driver = {
.probe = au1xmmc_probe,
.remove = au1xmmc_remove,
- .suspend = NULL,
- .resume = NULL,
+ .suspend = au1xmmc_suspend,
+ .resume = au1xmmc_resume,
.driver = {
.name = DRIVER_NAME,
},
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] 7/7 AU1100 MMC support
2006-08-09 21:12 [PATCH] 7/7 AU1100 MMC support Rodolfo Giometti
@ 2006-08-10 8:40 ` Rodolfo Giometti
0 siblings, 0 replies; 2+ messages in thread
From: Rodolfo Giometti @ 2006-08-10 8:40 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1.1: Type: text/plain, Size: 627 bytes --]
On Wed, Aug 09, 2006 at 11:12:43PM +0200, Rodolfo Giometti wrote:
> Power Management support for AU1100 (PIO mode) added.
>
> Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Sorry, I forgot into this patch some debugging messages... :)
Please, use this one instead.
Ciao,
Rodolfo
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
[-- Attachment #1.2: patch-mmc-pm-au1100 --]
[-- Type: text/plain, Size: 2904 bytes --]
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c
index 61acf6b..46b4fa5 100644
--- a/drivers/mmc/au1xmmc.c
+++ b/drivers/mmc/au1xmmc.c
@@ -19,6 +19,10 @@
* Rodolfo Giometti <giometti@linux.it>
* Eurotech S.p.A. <info@eurotech.it>
+ * Power Management Support for AU1100 in PIO mode by:
+ * Rodolfo Giometti <giometti@linux.it>
+ * Eurotech S.p.A. <info@eurotech.it>
+
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@@ -1086,11 +1090,75 @@ #endif
return 0;
}
+#ifdef CONFIG_PM
+static u32 sd_txport[2];
+static u32 sd_rxport[2];
+static u32 sd_config[2];
+static u32 sd_config2[2];
+static u32 sd_blksize[2];
+static u32 sd_status[2];
+static u32 sd_cmd[2];
+static u32 sd_cmdarg[2];
+static u32 sd_timeout[2];
+
+static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct au1xmmc_host *host = platform_get_drvdata(pdev);
+ struct mmc_host *mmc = host->mmc;
+ int ret = 0;
+
+ if (mmc)
+ ret = mmc_suspend_host(mmc, state);
+
+ sd_txport[host->id] = au_readl(HOST_TXPORT(host));
+ sd_rxport[host->id] = au_readl(HOST_RXPORT(host));
+ sd_config[host->id] = au_readl(HOST_CONFIG(host));
+ sd_config2[host->id] = au_readl(HOST_CONFIG2(host));
+ sd_blksize[host->id] = au_readl(HOST_BLKSIZE(host));
+ sd_status[host->id] = au_readl(HOST_STATUS(host));
+ sd_cmd[host->id] = au_readl(HOST_CMD(host));
+ sd_cmdarg[host->id] = au_readl(HOST_CMDARG(host));
+ sd_timeout[host->id] = au_readl(HOST_TIMEOUT(host));
+
+ au_writel(0x0, HOST_ENABLE(host));
+
+ return ret;
+}
+
+static int au1xmmc_resume(struct platform_device *pdev)
+{
+ struct au1xmmc_host *host = platform_get_drvdata(pdev);
+ struct mmc_host *mmc = host->mmc;
+ int ret = 0;
+
+ au1xmmc_reset_controller(host);
+
+ au_writel(sd_txport[host->id], HOST_TXPORT(host));
+ au_writel(sd_rxport[host->id], HOST_RXPORT(host));
+ au_writel(sd_config[host->id], HOST_CONFIG(host));
+ au_writel(sd_config2[host->id], HOST_CONFIG2(host));
+ au_writel(sd_blksize[host->id], HOST_BLKSIZE(host));
+ au_writel(sd_status[host->id], HOST_STATUS(host));
+ au_writel(sd_cmd[host->id], HOST_CMD(host));
+ au_writel(sd_cmdarg[host->id], HOST_CMDARG(host));
+ au_writel(sd_timeout[host->id], HOST_TIMEOUT(host));
+
+ if (mmc)
+ ret = mmc_resume_host(mmc);
+
+ return ret;
+}
+
+#else
+#define au1xmmc_suspend NULL
+#define au1xmmc_resume NULL
+#endif
+
static struct platform_driver au1xmmc_driver = {
.probe = au1xmmc_probe,
.remove = au1xmmc_remove,
- .suspend = NULL,
- .resume = NULL,
+ .suspend = au1xmmc_suspend,
+ .resume = au1xmmc_resume,
.driver = {
.name = DRIVER_NAME,
},
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-10 8:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-09 21:12 [PATCH] 7/7 AU1100 MMC support Rodolfo Giometti
2006-08-10 8:40 ` Rodolfo Giometti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.