aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/hw.c19
-rw-r--r--drivers/video/via/viamode.c85
2 files changed, 19 insertions, 85 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index b0b02783b6ee..6cb3b5626f0d 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -360,6 +360,24 @@ static struct pll_map pll_value[] = {
360 {208, 5, 2} } 360 {208, 5, 2} }
361}; 361};
362 362
363/* according to VIA Technologies these values are based on experiment */
364static struct io_reg scaling_parameters[] = {
365 {VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
366 {VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
367 {VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
368 {VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
369 {VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
370 {VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
371 {VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
372 {VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
373 {VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
374 {VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
375 {VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
376 {VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
377 {VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
378 {VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
379};
380
363static struct fifo_depth_select display_fifo_depth_reg = { 381static struct fifo_depth_select display_fifo_depth_reg = {
364 /* IGA1 FIFO Depth_Select */ 382 /* IGA1 FIFO Depth_Select */
365 {IGA1_FIFO_DEPTH_SELECT_REG_NUM, {{SR17, 0, 7} } }, 383 {IGA1_FIFO_DEPTH_SELECT_REG_NUM, {{SR17, 0, 7} } },
@@ -2419,6 +2437,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2419 break; 2437 break;
2420 } 2438 }
2421 2439
2440 viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters));
2422 device_off(); 2441 device_off();
2423 via_set_state(devices, VIA_STATE_OFF); 2442 via_set_state(devices, VIA_STATE_OFF);
2424 2443
diff --git a/drivers/video/via/viamode.c b/drivers/video/via/viamode.c
index 4b06dd73ccaa..81274890fc29 100644
--- a/drivers/video/via/viamode.c
+++ b/drivers/video/via/viamode.c
@@ -108,20 +108,6 @@ struct io_reg CN400_ModeXregs[] = { {VIASR, SR10, 0xFF, 0x01},
108{VIACR, CR6A, 0xFF, 0x40}, 108{VIACR, CR6A, 0xFF, 0x40},
109{VIACR, CR6B, 0xFF, 0x00}, 109{VIACR, CR6B, 0xFF, 0x00},
110{VIACR, CR6C, 0xFF, 0x00}, 110{VIACR, CR6C, 0xFF, 0x00},
111{VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
112{VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
113{VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
114{VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
115{VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
116{VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
117{VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
118{VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
119{VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
120{VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
121{VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
122{VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
123{VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
124{VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
125{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */ 111{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */
126{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */ 112{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */
127{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */ 113{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */
@@ -172,20 +158,6 @@ struct io_reg CN700_ModeXregs[] = { {VIASR, SR10, 0xFF, 0x01},
172{VIACR, CR78, 0xFF, 0x00}, /* LCD scaling Factor */ 158{VIACR, CR78, 0xFF, 0x00}, /* LCD scaling Factor */
173{VIACR, CR79, 0xFF, 0x00}, /* LCD scaling Factor */ 159{VIACR, CR79, 0xFF, 0x00}, /* LCD scaling Factor */
174{VIACR, CR9F, 0x03, 0x00}, /* LCD scaling Factor */ 160{VIACR, CR9F, 0x03, 0x00}, /* LCD scaling Factor */
175{VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
176{VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
177{VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
178{VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
179{VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
180{VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
181{VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
182{VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
183{VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
184{VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
185{VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
186{VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
187{VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
188{VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
189{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */ 161{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */
190{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */ 162{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */
191{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */ 163{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */
@@ -229,20 +201,6 @@ struct io_reg KM400_ModeXregs[] = {
229 {VIACR, CR36, 0xFF, 0x01}, /* Power Mangement 3 */ 201 {VIACR, CR36, 0xFF, 0x01}, /* Power Mangement 3 */
230 {VIACR, CR68, 0xFF, 0x67}, /* Default FIFO For IGA2 */ 202 {VIACR, CR68, 0xFF, 0x67}, /* Default FIFO For IGA2 */
231 {VIACR, CR6A, 0x20, 0x20}, /* Extended FIFO On */ 203 {VIACR, CR6A, 0x20, 0x20}, /* Extended FIFO On */
232 {VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
233 {VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
234 {VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
235 {VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
236 {VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
237 {VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
238 {VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
239 {VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
240 {VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
241 {VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
242 {VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
243 {VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
244 {VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
245 {VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
246 {VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */ 204 {VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */
247 {VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */ 205 {VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */
248 {VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */ 206 {VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */
@@ -283,20 +241,6 @@ struct io_reg CX700_ModeXregs[] = { {VIASR, SR10, 0xFF, 0x01},
283{VIACR, CR6A, 0xFF, 0x40}, 241{VIACR, CR6A, 0xFF, 0x40},
284{VIACR, CR6B, 0xFF, 0x00}, 242{VIACR, CR6B, 0xFF, 0x00},
285{VIACR, CR6C, 0xFF, 0x00}, 243{VIACR, CR6C, 0xFF, 0x00},
286{VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
287{VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
288{VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
289{VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
290{VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
291{VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
292{VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
293{VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
294{VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
295{VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
296{VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
297{VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
298{VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
299{VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
300{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */ 244{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */
301{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */ 245{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */
302{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */ 246{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */
@@ -342,20 +286,6 @@ struct io_reg VX855_ModeXregs[] = {
342{VIACR, CR6A, 0xFD, 0x60}, 286{VIACR, CR6A, 0xFD, 0x60},
343{VIACR, CR6B, 0xFF, 0x00}, 287{VIACR, CR6B, 0xFF, 0x00},
344{VIACR, CR6C, 0xFF, 0x00}, 288{VIACR, CR6C, 0xFF, 0x00},
345{VIACR, CR7A, 0xFF, 0x01}, /* LCD Scaling Parameter 1 */
346{VIACR, CR7B, 0xFF, 0x02}, /* LCD Scaling Parameter 2 */
347{VIACR, CR7C, 0xFF, 0x03}, /* LCD Scaling Parameter 3 */
348{VIACR, CR7D, 0xFF, 0x04}, /* LCD Scaling Parameter 4 */
349{VIACR, CR7E, 0xFF, 0x07}, /* LCD Scaling Parameter 5 */
350{VIACR, CR7F, 0xFF, 0x0A}, /* LCD Scaling Parameter 6 */
351{VIACR, CR80, 0xFF, 0x0D}, /* LCD Scaling Parameter 7 */
352{VIACR, CR81, 0xFF, 0x13}, /* LCD Scaling Parameter 8 */
353{VIACR, CR82, 0xFF, 0x16}, /* LCD Scaling Parameter 9 */
354{VIACR, CR83, 0xFF, 0x19}, /* LCD Scaling Parameter 10 */
355{VIACR, CR84, 0xFF, 0x1C}, /* LCD Scaling Parameter 11 */
356{VIACR, CR85, 0xFF, 0x1D}, /* LCD Scaling Parameter 12 */
357{VIACR, CR86, 0xFF, 0x1E}, /* LCD Scaling Parameter 13 */
358{VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
359{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */ 289{VIACR, CR88, 0xFF, 0x40}, /* LCD Panel Type */
360{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */ 290{VIACR, CR89, 0xFF, 0x00}, /* LCD Timing Control 0 */
361{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */ 291{VIACR, CR8A, 0xFF, 0x88}, /* LCD Timing Control 1 */
@@ -390,21 +320,6 @@ struct io_reg CLE266_ModeXregs[] = { {VIASR, SR1E, 0xF0, 0x00},
390{VIAGR, GR20, 0xFF, 0x00}, 320{VIAGR, GR20, 0xFF, 0x00},
391{VIAGR, GR21, 0xFF, 0x00}, 321{VIAGR, GR21, 0xFF, 0x00},
392{VIAGR, GR22, 0xFF, 0x00}, 322{VIAGR, GR22, 0xFF, 0x00},
393 /* LCD Parameters */
394{VIACR, CR7A, 0xFF, 0x01}, /* LCD Parameter 1 */
395{VIACR, CR7B, 0xFF, 0x02}, /* LCD Parameter 2 */
396{VIACR, CR7C, 0xFF, 0x03}, /* LCD Parameter 3 */
397{VIACR, CR7D, 0xFF, 0x04}, /* LCD Parameter 4 */
398{VIACR, CR7E, 0xFF, 0x07}, /* LCD Parameter 5 */
399{VIACR, CR7F, 0xFF, 0x0A}, /* LCD Parameter 6 */
400{VIACR, CR80, 0xFF, 0x0D}, /* LCD Parameter 7 */
401{VIACR, CR81, 0xFF, 0x13}, /* LCD Parameter 8 */
402{VIACR, CR82, 0xFF, 0x16}, /* LCD Parameter 9 */
403{VIACR, CR83, 0xFF, 0x19}, /* LCD Parameter 10 */
404{VIACR, CR84, 0xFF, 0x1C}, /* LCD Parameter 11 */
405{VIACR, CR85, 0xFF, 0x1D}, /* LCD Parameter 12 */
406{VIACR, CR86, 0xFF, 0x1E}, /* LCD Parameter 13 */
407{VIACR, CR87, 0xFF, 0x1F}, /* LCD Parameter 14 */
408 323
409}; 324};
410 325