* [PATCH] Power management support for au1100fb.c
@ 2006-05-24 17:36 Rodolfo Giometti
2006-05-24 17:51 ` Martin Michlmayr
0 siblings, 1 reply; 2+ messages in thread
From: Rodolfo Giometti @ 2006-05-24 17:36 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 421 bytes --]
Hello,
attached a patch for power management on au1100fb.c. The patch is
against 2.6.17-rc4 and has been tested with an au1100 based board.
Ciao,
Rodolfo
--
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-au1100fb-pm --]
[-- Type: text/plain, Size: 1922 bytes --]
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 1f401a9..0be2d55 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -7,6 +7,8 @@
* Karl Lessard <klessard@sunrisetelecom.com>
* <c.pellegrin@exadron.com>
*
+ * PM support added by Rodolfo Giometti <giometti@linux.it>
+ *
* Copyright 2002 MontaVista Software
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
@@ -657,17 +659,49 @@ int au1100fb_drv_remove(struct device *d
return 0;
}
+#ifdef CONFIG_PM
+static u32 sys_clksrc;
+static struct au1100fb_regs fbregs;
+
int au1100fb_drv_suspend(struct device *dev, pm_message_t state)
{
- /* TODO */
+ struct au1100fb_device *fbdev = (struct au1100fb_device*) dev_get_drvdata(dev);
+
+ if (!fbdev)
+ return 0;
+
+ /* Save the clock source state */
+ sys_clksrc = au_readl(SYS_CLKSRC);
+
+ /* Blank the LCD */
+ au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
+
+ /* Stop LCD clocking */
+ au_writel(sys_clksrc & ~SYS_CS_ML_MASK, SYS_CLKSRC);
+
+ memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
+
return 0;
}
int au1100fb_drv_resume(struct device *dev)
{
- /* TODO */
+ struct au1100fb_device *fbdev = (struct au1100fb_device*) dev_get_drvdata(dev);
+
+ if (!fbdev)
+ return 0;
+
+ memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
+
+ /* Restart LCD clocking */
+ au_writel(sys_clksrc, SYS_CLKSRC);
+
+ /* Unblank the LCD */
+ au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);
+
return 0;
}
+#endif
static struct device_driver au1100fb_driver = {
.name = "au1100-lcd",
@@ -675,8 +709,10 @@ static struct device_driver au1100fb_dri
.probe = au1100fb_drv_probe,
.remove = au1100fb_drv_remove,
+#ifdef CONFIG_PM
.suspend = au1100fb_drv_suspend,
.resume = au1100fb_drv_resume,
+#endif
};
/*-------------------------------------------------------------------------*/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Power management support for au1100fb.c
2006-05-24 17:36 [PATCH] Power management support for au1100fb.c Rodolfo Giometti
@ 2006-05-24 17:51 ` Martin Michlmayr
0 siblings, 0 replies; 2+ messages in thread
From: Martin Michlmayr @ 2006-05-24 17:51 UTC (permalink / raw)
To: Rodolfo Giometti; +Cc: linux-mips
* Rodolfo Giometti <giometti@linux.it> [2006-05-24 19:36]:
> attached a patch for power management on au1100fb.c. The patch is
> against 2.6.17-rc4 and has been tested with an au1100 based board.
This has to go to linux-fbdev-devel@lists.sourceforge.net
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-24 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-24 17:36 [PATCH] Power management support for au1100fb.c Rodolfo Giometti
2006-05-24 17:51 ` Martin Michlmayr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox