]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/geode/video_gx.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / drivers / video / geode / video_gx.c
index 1b98b7b4e8537e7a8aa3491d635a95d1a2996f8e..b8d52a8360db2436371dc3445a39e3a4fd96c8c2 100644 (file)
@@ -18,8 +18,6 @@
 #include <asm/msr.h>
 #include <asm/geode.h>
 
-#include "geodefb.h"
-#include "video_gx.h"
 #include "gxfb.h"
 
 
@@ -119,7 +117,7 @@ static const struct gx_pll_entry gx_pll_table_14MHz[] = {
        {  4357, 0, 0x0000057D },       /* 229.5000 */
 };
 
-static void gx_set_dclk_frequency(struct fb_info *info)
+void gx_set_dclk_frequency(struct fb_info *info)
 {
        const struct gx_pll_entry *pll_table;
        int pll_table_len;
@@ -180,15 +178,15 @@ static void gx_set_dclk_frequency(struct fb_info *info)
 static void
 gx_configure_tft(struct fb_info *info)
 {
-       struct geodefb_par *par = info->par;
+       struct gxfb_par *par = info->par;
        unsigned long val;
        unsigned long fp;
 
        /* Set up the DF pad select MSR */
 
        rdmsrl(MSR_GX_MSR_PADSEL, val);
-       val &= ~GX_VP_PAD_SELECT_MASK;
-       val |= GX_VP_PAD_SELECT_TFT;
+       val &= ~MSR_GX_MSR_PADSEL_MASK;
+       val |= MSR_GX_MSR_PADSEL_TFT;
        wrmsrl(MSR_GX_MSR_PADSEL, val);
 
        /* Turn off the panel */
@@ -235,9 +233,9 @@ gx_configure_tft(struct fb_info *info)
        write_fp(par, FP_PM, fp);
 }
 
-static void gx_configure_display(struct fb_info *info)
+void gx_configure_display(struct fb_info *info)
 {
-       struct geodefb_par *par = info->par;
+       struct gxfb_par *par = info->par;
        u32 dcfg, misc;
 
        /* Write the display configuration */
@@ -297,41 +295,43 @@ static void gx_configure_display(struct fb_info *info)
                gx_configure_tft(info);
 }
 
-static int gx_blank_display(struct fb_info *info, int blank_mode)
+int gx_blank_display(struct fb_info *info, int blank_mode)
 {
-       struct geodefb_par *par = info->par;
+       struct gxfb_par *par = info->par;
        u32 dcfg, fp_pm;
-       int blank, hsync, vsync;
+       int blank, hsync, vsync, crt;
 
        /* CRT power saving modes. */
        switch (blank_mode) {
        case FB_BLANK_UNBLANK:
-               blank = 0; hsync = 1; vsync = 1;
+               blank = 0; hsync = 1; vsync = 1; crt = 1;
                break;
        case FB_BLANK_NORMAL:
-               blank = 1; hsync = 1; vsync = 1;
+               blank = 1; hsync = 1; vsync = 1; crt = 1;
                break;
        case FB_BLANK_VSYNC_SUSPEND:
-               blank = 1; hsync = 1; vsync = 0;
+               blank = 1; hsync = 1; vsync = 0; crt = 1;
                break;
        case FB_BLANK_HSYNC_SUSPEND:
-               blank = 1; hsync = 0; vsync = 1;
+               blank = 1; hsync = 0; vsync = 1; crt = 1;
                break;
        case FB_BLANK_POWERDOWN:
-               blank = 1; hsync = 0; vsync = 0;
+               blank = 1; hsync = 0; vsync = 0; crt = 0;
                break;
        default:
                return -EINVAL;
        }
        dcfg = read_vp(par, VP_DCFG);
-       dcfg &= ~(VP_DCFG_DAC_BL_EN
-                 | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN);
+       dcfg &= ~(VP_DCFG_DAC_BL_EN | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN |
+                       VP_DCFG_CRT_EN);
        if (!blank)
                dcfg |= VP_DCFG_DAC_BL_EN;
        if (hsync)
                dcfg |= VP_DCFG_HSYNC_EN;
        if (vsync)
                dcfg |= VP_DCFG_VSYNC_EN;
+       if (crt)
+               dcfg |= VP_DCFG_CRT_EN;
        write_vp(par, VP_DCFG, dcfg);
 
        /* Power on/off flat panel. */
@@ -347,9 +347,3 @@ static int gx_blank_display(struct fb_info *info, int blank_mode)
 
        return 0;
 }
-
-struct geode_vid_ops gx_vid_ops = {
-       .set_dclk          = gx_set_dclk_frequency,
-       .configure_display = gx_configure_display,
-       .blank_display     = gx_blank_display,
-};