aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/geode/display_gx.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2008-04-28 05:14:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:36 -0400
commitd255114f22e19b50cf45fcc70963e6a9f287ad40 (patch)
tree2e6b56b2d1e395ce4d1ca528bf00725c591df05f /drivers/video/geode/display_gx.c
parentab06aaf6a6d5de896e4c52e158be2881036cbee9 (diff)
gxfb: clean up register definitions
This does the following in preparation for register saving: - moves the register definitions from video_gx.h and display_gx.h into gxfb.h. - renames GX_* registers to match their section (ie, VP_). - renames register bitfields to match the data sheet (ie, DC_DCFG_TGEN -> DC_DISPLAY_CFG_TGEN). - for DC registers, rather than defining to specific addresses, use an enum to number them sequentially and just multiply by 4(bytes) to access them (in read_dc/write_dc). - for VP and FP registers, use an enum and multiple by 8 (bytes). They're 64bit registers. Signed-off-by: Andres Salomon <dilinger@debian.org> Cc: Jordan Crouse <jordan.crouse@amd.com> 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>
Diffstat (limited to 'drivers/video/geode/display_gx.c')
-rw-r--r--drivers/video/geode/display_gx.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/video/geode/display_gx.c b/drivers/video/geode/display_gx.c
index 47f422e19974..acf20bf2d26c 100644
--- a/drivers/video/geode/display_gx.c
+++ b/drivers/video/geode/display_gx.c
@@ -51,20 +51,21 @@ static void gx_set_mode(struct fb_info *info)
51 int vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal; 51 int vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal;
52 52
53 /* Unlock the display controller registers. */ 53 /* Unlock the display controller registers. */
54 write_dc(par, DC_UNLOCK, DC_UNLOCK_CODE); 54 write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK);
55 55
56 gcfg = read_dc(par, DC_GENERAL_CFG); 56 gcfg = read_dc(par, DC_GENERAL_CFG);
57 dcfg = read_dc(par, DC_DISPLAY_CFG); 57 dcfg = read_dc(par, DC_DISPLAY_CFG);
58 58
59 /* Disable the timing generator. */ 59 /* Disable the timing generator. */
60 dcfg &= ~(DC_DCFG_TGEN); 60 dcfg &= ~DC_DISPLAY_CFG_TGEN;
61 write_dc(par, DC_DISPLAY_CFG, dcfg); 61 write_dc(par, DC_DISPLAY_CFG, dcfg);
62 62
63 /* Wait for pending memory requests before disabling the FIFO load. */ 63 /* Wait for pending memory requests before disabling the FIFO load. */
64 udelay(100); 64 udelay(100);
65 65
66 /* Disable FIFO load and compression. */ 66 /* Disable FIFO load and compression. */
67 gcfg &= ~(DC_GCFG_DFLE | DC_GCFG_CMPE | DC_GCFG_DECE); 67 gcfg &= ~(DC_GENERAL_CFG_DFLE | DC_GENERAL_CFG_CMPE |
68 DC_GENERAL_CFG_DECE);
68 write_dc(par, DC_GENERAL_CFG, gcfg); 69 write_dc(par, DC_GENERAL_CFG, gcfg);
69 70
70 /* Setup DCLK and its divisor. */ 71 /* Setup DCLK and its divisor. */
@@ -75,12 +76,13 @@ static void gx_set_mode(struct fb_info *info)
75 */ 76 */
76 77
77 /* Clear all unused feature bits. */ 78 /* Clear all unused feature bits. */
78 gcfg &= DC_GCFG_YUVM | DC_GCFG_VDSE; 79 gcfg &= DC_GENERAL_CFG_YUVM | DC_GENERAL_CFG_VDSE;
79 dcfg = 0; 80 dcfg = 0;
80 81
81 /* Set FIFO priority (default 6/5) and enable. */ 82 /* Set FIFO priority (default 6/5) and enable. */
82 /* FIXME: increase fifo priority for 1280x1024 and higher modes? */ 83 /* FIXME: increase fifo priority for 1280x1024 and higher modes? */
83 gcfg |= (6 << DC_GCFG_DFHPEL_POS) | (5 << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE; 84 gcfg |= (6 << DC_GENERAL_CFG_DFHPEL_SHIFT) |
85 (5 << DC_GENERAL_CFG_DFHPSL_SHIFT) | DC_GENERAL_CFG_DFLE;
84 86
85 /* Framebuffer start offset. */ 87 /* Framebuffer start offset. */
86 write_dc(par, DC_FB_ST_OFFSET, 0); 88 write_dc(par, DC_FB_ST_OFFSET, 0);
@@ -92,25 +94,25 @@ static void gx_set_mode(struct fb_info *info)
92 94
93 95
94 /* Enable graphics and video data and unmask address lines. */ 96 /* Enable graphics and video data and unmask address lines. */
95 dcfg |= DC_DCFG_GDEN | DC_DCFG_VDEN | DC_DCFG_A20M | DC_DCFG_A18M; 97 dcfg |= DC_DISPLAY_CFG_GDEN | DC_DISPLAY_CFG_VDEN |
98 DC_DISPLAY_CFG_A20M | DC_DISPLAY_CFG_A18M;
96 99
97 /* Set pixel format. */ 100 /* Set pixel format. */
98 switch (info->var.bits_per_pixel) { 101 switch (info->var.bits_per_pixel) {
99 case 8: 102 case 8:
100 dcfg |= DC_DCFG_DISP_MODE_8BPP; 103 dcfg |= DC_DISPLAY_CFG_DISP_MODE_8BPP;
101 break; 104 break;
102 case 16: 105 case 16:
103 dcfg |= DC_DCFG_DISP_MODE_16BPP; 106 dcfg |= DC_DISPLAY_CFG_DISP_MODE_16BPP;
104 dcfg |= DC_DCFG_16BPP_MODE_565;
105 break; 107 break;
106 case 32: 108 case 32:
107 dcfg |= DC_DCFG_DISP_MODE_24BPP; 109 dcfg |= DC_DISPLAY_CFG_DISP_MODE_24BPP;
108 dcfg |= DC_DCFG_PALB; 110 dcfg |= DC_DISPLAY_CFG_PALB;
109 break; 111 break;
110 } 112 }
111 113
112 /* Enable timing generator. */ 114 /* Enable timing generator. */
113 dcfg |= DC_DCFG_TGEN; 115 dcfg |= DC_DISPLAY_CFG_TGEN;
114 116
115 /* Horizontal and vertical timings. */ 117 /* Horizontal and vertical timings. */
116 hactive = info->var.xres; 118 hactive = info->var.xres;
@@ -148,7 +150,7 @@ static void gx_set_mode(struct fb_info *info)
148 par->vid_ops->configure_display(info); 150 par->vid_ops->configure_display(info);
149 151
150 /* Relock display controller registers */ 152 /* Relock display controller registers */
151 write_dc(par, DC_UNLOCK, 0); 153 write_dc(par, DC_UNLOCK, DC_UNLOCK_LOCK);
152} 154}
153 155
154static void gx_set_hw_palette_reg(struct fb_info *info, unsigned regno, 156static void gx_set_hw_palette_reg(struct fb_info *info, unsigned regno,