[PATCH] tgafb: sync-on-green support fixes
authorMaciej W. Rozycki <macro@linux-mips.org>
Mon, 12 Feb 2007 08:54:57 +0000 (00:54 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:41 +0000 (09:48 -0800)
This sets up the deep register of the TGA ASIC as well as the blank pedestal
of the Bt463 RAMDAC correctly for the sync-on-green mode.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/tgafb.c

index 2a6bfcdc3039806bf1438535581950220e7e1715..781ca7f77c099de67a4677b670448d5544ec45f4 100644 (file)
@@ -197,7 +197,9 @@ tgafb_set_par(struct fb_info *info)
        while (TGA_READ_REG(par, TGA_CMD_STAT_REG) & 1) /* wait for not busy */
                continue;
        mb();
-       TGA_WRITE_REG(par, deep_presets[tga_type], TGA_DEEP_REG);
+       TGA_WRITE_REG(par, deep_presets[tga_type] |
+                          (par->sync_on_green ? 0x0 : 0x00010000),
+                     TGA_DEEP_REG);
        while (TGA_READ_REG(par, TGA_CMD_STAT_REG) & 1) /* wait for not busy */
                continue;
        mb();
@@ -261,11 +263,11 @@ tgafb_set_par(struct fb_info *info)
 
        } else { /* 24-plane or 24plusZ */
 
-               /* Init BT463 registers.  */
+               /* Init BT463 RAMDAC registers.  */
                BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_0, 0x40);
                BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_1, 0x08);
                BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_2,
-                           (par->sync_on_green ? 0x80 : 0x40));
+                           (par->sync_on_green ? 0xc0 : 0x40));
 
                BT463_WRITE(par, BT463_REG_ACC, BT463_READ_MASK_0, 0xff);
                BT463_WRITE(par, BT463_REG_ACC, BT463_READ_MASK_1, 0xff);