[PATCH 5/5] gxfb: Adjust the powerdown behavior when a DCON is attached

Jordan Crouse jordan.crouse at amd.com
Wed Apr 25 20:31:42 EDT 2007


From: Jordan Crouse <jordan.crouse at amd.com>

When a DCON is attached, we don't turn off the FP PM to avoid the
64ms delay when we come back up.  Power loss should be minimal.

Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>
---

 drivers/video/geode/video_gx.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/video/geode/video_gx.c b/drivers/video/geode/video_gx.c
index b0e4303..13fce28 100644
--- a/drivers/video/geode/video_gx.c
+++ b/drivers/video/geode/video_gx.c
@@ -16,6 +16,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <asm/msr.h>
+#include <asm/olpc.h>
 
 #include "geodefb.h"
 #include "video_gx.h"
@@ -370,9 +371,13 @@ int gxfb_powerdown(struct fb_info *info) {
 	gx_pm_regs[VC_DCFG] = readl(par->vid_regs + GX_DCFG);
 	writel(gx_pm_regs[VC_DCFG] & ~0x0F, par->vid_regs + GX_DCFG);
 
-	/* Turn off the flat panel */
-	gx_pm_regs[VC_FP_PM] = readl(par->vid_regs + GX_FP_PM);
-	writel(gx_pm_regs[VC_FP_PM] & ~GX_FP_PM_P, par->vid_regs + GX_FP_PM);
+	/* Turn off the flat panel unless we are attached to a DCON */
+
+	if (!olpc_has_dcon()) {
+		gx_pm_regs[VC_FP_PM] = readl(par->vid_regs + GX_FP_PM);
+		writel(gx_pm_regs[VC_FP_PM] & ~GX_FP_PM_P,
+			par->vid_regs + GX_FP_PM);
+	}
 
 	/* Unlock the DC - this will remain unlocked until power up */
 	writel(0x4758, par->dc_regs + DC_UNLOCK);
@@ -393,15 +398,20 @@ int gxfb_powerdown(struct fb_info *info) {
 int gxfb_powerup(struct fb_info *info)
 {
 	struct geodefb_par *par = info->par;
+	u32 val;
 
 	if (gxfb_powered_down == 0)
 		return 0;
 
 	writel(gx_pm_regs[VC_VCFG], par->vid_regs + GX_VCFG);
 	writel(gx_pm_regs[VC_DCFG], par->vid_regs + GX_DCFG);
-	writel(gx_pm_regs[VC_FP_PM], par->vid_regs + GX_FP_PM);
 
-	msleep(64);
+	val = readl(par->vid_regs + GX_FP_PM);
+
+	if (!(val & 0x09)) {
+		writel(gx_pm_regs[VC_FP_PM], par->vid_regs + GX_FP_PM);
+		msleep(64);
+	}
 
 	writel(gx_pm_regs[DC_DCFG], par->dc_regs + DC_DISPLAY_CFG);
 





More information about the Devel mailing list