aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-04-24 09:17:09 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-04-24 09:17:09 -0400
commit75ec72f8c53b9f981e68704432a2e425a01f79b7 (patch)
tree6099769be8e9c8b22e365768757564c211e5c811
parent567b99f84ea8efe979e020bd382dd735746b526b (diff)
parentcd00b1154d3c7d711e83c3c17b831aafe6377532 (diff)
Merge branch 'viafb-cleanup' into viafb-next
-rw-r--r--drivers/video/via/chip.h6
-rw-r--r--drivers/video/via/dvi.c160
-rw-r--r--drivers/video/via/dvi.h2
-rw-r--r--drivers/video/via/global.c4
-rw-r--r--drivers/video/via/global.h2
-rw-r--r--drivers/video/via/hw.c88
-rw-r--r--drivers/video/via/hw.h1
-rw-r--r--drivers/video/via/lcd.c16
-rw-r--r--drivers/video/via/lcd.h2
-rw-r--r--drivers/video/via/share.h8
-rw-r--r--drivers/video/via/viafbdev.c23
-rw-r--r--drivers/video/via/viafbdev.h4
-rw-r--r--drivers/video/via/viamode.c19
13 files changed, 84 insertions, 251 deletions
diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index 29d70244a21..3ebf20c06ee 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h
@@ -137,17 +137,11 @@ struct chip_information {
137 struct lvds_chip_information lvds_chip_info2; 137 struct lvds_chip_information lvds_chip_info2;
138}; 138};
139 139
140struct crt_setting_information {
141 int iga_path;
142};
143
144struct tmds_setting_information { 140struct tmds_setting_information {
145 int iga_path; 141 int iga_path;
146 int h_active; 142 int h_active;
147 int v_active; 143 int v_active;
148 int max_pixel_clock; 144 int max_pixel_clock;
149 int max_hres;
150 int max_vres;
151}; 145};
152 146
153struct lvds_setting_information { 147struct lvds_setting_information {
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index 41ca198b509..b1f364745ca 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -28,17 +28,11 @@ static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
28static void __devinit dvi_get_panel_size_from_DDCv1( 28static void __devinit dvi_get_panel_size_from_DDCv1(
29 struct tmds_chip_information *tmds_chip, 29 struct tmds_chip_information *tmds_chip,
30 struct tmds_setting_information *tmds_setting); 30 struct tmds_setting_information *tmds_setting);
31static void __devinit dvi_get_panel_size_from_DDCv2(
32 struct tmds_chip_information *tmds_chip,
33 struct tmds_setting_information *tmds_setting);
34static int viafb_dvi_query_EDID(void); 31static int viafb_dvi_query_EDID(void);
35 32
36static int check_tmds_chip(int device_id_subaddr, int device_id) 33static inline bool check_tmds_chip(int device_id_subaddr, int device_id)
37{ 34{
38 if (tmds_register_read(device_id_subaddr) == device_id) 35 return tmds_register_read(device_id_subaddr) == device_id;
39 return OK;
40 else
41 return FAIL;
42} 36}
43 37
44void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, 38void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
@@ -47,22 +41,13 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
47 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n"); 41 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
48 42
49 viafb_dvi_sense(); 43 viafb_dvi_sense();
50 switch (viafb_dvi_query_EDID()) { 44 if (viafb_dvi_query_EDID() == 1)
51 case 1:
52 dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting); 45 dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting);
53 break;
54 case 2:
55 dvi_get_panel_size_from_DDCv2(tmds_chip, tmds_setting);
56 break;
57 default:
58 printk(KERN_WARNING "viafb_init_dvi_size: DVI panel size undetected!\n");
59 break;
60 }
61 46
62 return; 47 return;
63} 48}
64 49
65int __devinit viafb_tmds_trasmitter_identify(void) 50bool __devinit viafb_tmds_trasmitter_identify(void)
66{ 51{
67 unsigned char sr2a = 0, sr1e = 0, sr3e = 0; 52 unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
68 53
@@ -101,7 +86,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
101 viaparinfo->chip_info-> 86 viaparinfo->chip_info->
102 tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; 87 tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
103 viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31; 88 viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31;
104 if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) { 89 if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) {
105 /* 90 /*
106 * Currently only support 12bits,dual edge,add 24bits mode later 91 * Currently only support 12bits,dual edge,add 24bits mode later
107 */ 92 */
@@ -112,11 +97,10 @@ int __devinit viafb_tmds_trasmitter_identify(void)
112 viaparinfo->chip_info->tmds_chip_info.tmds_chip_name); 97 viaparinfo->chip_info->tmds_chip_info.tmds_chip_name);
113 DEBUG_MSG(KERN_INFO "\n %2d", 98 DEBUG_MSG(KERN_INFO "\n %2d",
114 viaparinfo->chip_info->tmds_chip_info.i2c_port); 99 viaparinfo->chip_info->tmds_chip_info.i2c_port);
115 return OK; 100 return true;
116 } else { 101 } else {
117 viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C; 102 viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C;
118 if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) 103 if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) {
119 != FAIL) {
120 tmds_register_write(0x08, 0x3b); 104 tmds_register_write(0x08, 0x3b);
121 DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n"); 105 DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n");
122 DEBUG_MSG(KERN_INFO "\n %2d", 106 DEBUG_MSG(KERN_INFO "\n %2d",
@@ -125,7 +109,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
125 DEBUG_MSG(KERN_INFO "\n %2d", 109 DEBUG_MSG(KERN_INFO "\n %2d",
126 viaparinfo->chip_info-> 110 viaparinfo->chip_info->
127 tmds_chip_info.i2c_port); 111 tmds_chip_info.i2c_port);
128 return OK; 112 return true;
129 } 113 }
130 } 114 }
131 115
@@ -135,7 +119,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
135 ((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) || 119 ((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) ||
136 (viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) { 120 (viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) {
137 DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n"); 121 DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n");
138 return OK; 122 return true;
139 } 123 }
140 124
141 switch (viaparinfo->chip_info->gfx_chip_name) { 125 switch (viaparinfo->chip_info->gfx_chip_name) {
@@ -159,7 +143,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
159 tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER; 143 tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER;
160 viaparinfo->chip_info->tmds_chip_info. 144 viaparinfo->chip_info->tmds_chip_info.
161 tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; 145 tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
162 return FAIL; 146 return false;
163} 147}
164 148
165static void tmds_register_write(int index, u8 data) 149static void tmds_register_write(int index, u8 data)
@@ -306,12 +290,7 @@ static int viafb_dvi_query_EDID(void)
306 return EDID_VERSION_1; /* Found EDID1 Table */ 290 return EDID_VERSION_1; /* Found EDID1 Table */
307 } 291 }
308 292
309 data0 = (u8) tmds_register_read(0x00); 293 return false;
310 viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore;
311 if (data0 == 0x20)
312 return EDID_VERSION_2; /* Found EDID2 Table */
313 else
314 return false;
315} 294}
316 295
317/* Get Panel Size Using EDID1 Table */ 296/* Get Panel Size Using EDID1 Table */
@@ -319,50 +298,15 @@ static void __devinit dvi_get_panel_size_from_DDCv1(
319 struct tmds_chip_information *tmds_chip, 298 struct tmds_chip_information *tmds_chip,
320 struct tmds_setting_information *tmds_setting) 299 struct tmds_setting_information *tmds_setting)
321{ 300{
322 int i, max_h = 0, tmp, restore; 301 int i, restore;
323 unsigned char rData;
324 unsigned char EDID_DATA[18]; 302 unsigned char EDID_DATA[18];
325 303
326 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n"); 304 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n");
327 305
328 restore = tmds_chip->tmds_chip_slave_addr; 306 restore = tmds_chip->tmds_chip_slave_addr;
329 tmds_chip->tmds_chip_slave_addr = 0xA0; 307 tmds_chip->tmds_chip_slave_addr = 0xA0;
330
331 rData = tmds_register_read(0x23);
332 if (rData & 0x3C)
333 max_h = 640;
334 if (rData & 0xC0)
335 max_h = 720;
336 if (rData & 0x03)
337 max_h = 800;
338
339 rData = tmds_register_read(0x24);
340 if (rData & 0xC0)
341 max_h = 800;
342 if (rData & 0x1E)
343 max_h = 1024;
344 if (rData & 0x01)
345 max_h = 1280;
346
347 for (i = 0x25; i < 0x6D; i++) { 308 for (i = 0x25; i < 0x6D; i++) {
348 switch (i) { 309 switch (i) {
349 case 0x26:
350 case 0x28:
351 case 0x2A:
352 case 0x2C:
353 case 0x2E:
354 case 0x30:
355 case 0x32:
356 case 0x34:
357 rData = tmds_register_read(i);
358 if (rData == 1)
359 break;
360 /* data = (data + 31) * 8 */
361 tmp = (rData + 31) << 3;
362 if (tmp > max_h)
363 max_h = tmp;
364 break;
365
366 case 0x36: 310 case 0x36:
367 case 0x48: 311 case 0x48:
368 case 0x5A: 312 case 0x5A:
@@ -383,91 +327,11 @@ static void __devinit dvi_get_panel_size_from_DDCv1(
383 } 327 }
384 } 328 }
385 329
386 tmds_setting->max_hres = max_h;
387 switch (max_h) {
388 case 640:
389 tmds_setting->max_vres = 480;
390 break;
391 case 800:
392 tmds_setting->max_vres = 600;
393 break;
394 case 1024:
395 tmds_setting->max_vres = 768;
396 break;
397 case 1280:
398 tmds_setting->max_vres = 1024;
399 break;
400 case 1400:
401 tmds_setting->max_vres = 1050;
402 break;
403 case 1440:
404 tmds_setting->max_vres = 1050;
405 break;
406 case 1600:
407 tmds_setting->max_vres = 1200;
408 break;
409 case 1920:
410 tmds_setting->max_vres = 1080;
411 break;
412 default:
413 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! "
414 "set default panel size.\n", max_h);
415 break;
416 }
417
418 DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n", 330 DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n",
419 tmds_setting->max_pixel_clock); 331 tmds_setting->max_pixel_clock);
420 tmds_chip->tmds_chip_slave_addr = restore; 332 tmds_chip->tmds_chip_slave_addr = restore;
421} 333}
422 334
423/* Get Panel Size Using EDID2 Table */
424static void __devinit dvi_get_panel_size_from_DDCv2(
425 struct tmds_chip_information *tmds_chip,
426 struct tmds_setting_information *tmds_setting)
427{
428 int restore;
429 unsigned char R_Buffer[2];
430
431 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n");
432
433 restore = tmds_chip->tmds_chip_slave_addr;
434 tmds_chip->tmds_chip_slave_addr = 0xA2;
435
436 /* Horizontal: 0x76, 0x77 */
437 tmds_register_read_bytes(0x76, R_Buffer, 2);
438 tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8);
439
440 switch (tmds_setting->max_hres) {
441 case 640:
442 tmds_setting->max_vres = 480;
443 break;
444 case 800:
445 tmds_setting->max_vres = 600;
446 break;
447 case 1024:
448 tmds_setting->max_vres = 768;
449 break;
450 case 1280:
451 tmds_setting->max_vres = 1024;
452 break;
453 case 1400:
454 tmds_setting->max_vres = 1050;
455 break;
456 case 1440:
457 tmds_setting->max_vres = 1050;
458 break;
459 case 1600:
460 tmds_setting->max_vres = 1200;
461 break;
462 default:
463 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! "
464 "set default panel size.\n", tmds_setting->max_hres);
465 break;
466 }
467
468 tmds_chip->tmds_chip_slave_addr = restore;
469}
470
471/* If Disable DVI, turn off pad */ 335/* If Disable DVI, turn off pad */
472void viafb_dvi_disable(void) 336void viafb_dvi_disable(void)
473{ 337{
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index 2c525c0c1ad..f473dd01097 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -56,7 +56,7 @@
56int viafb_dvi_sense(void); 56int viafb_dvi_sense(void);
57void viafb_dvi_disable(void); 57void viafb_dvi_disable(void);
58void viafb_dvi_enable(void); 58void viafb_dvi_enable(void);
59int __devinit viafb_tmds_trasmitter_identify(void); 59bool __devinit viafb_tmds_trasmitter_identify(void);
60void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, 60void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
61 struct tmds_setting_information *tmds_setting); 61 struct tmds_setting_information *tmds_setting);
62void viafb_dvi_set_mode(struct VideoModeTable *videoMode, int mode_bpp, 62void viafb_dvi_set_mode(struct VideoModeTable *videoMode, int mode_bpp,
diff --git a/drivers/video/via/global.c b/drivers/video/via/global.c
index 1ee511b7330..e10d8249534 100644
--- a/drivers/video/via/global.c
+++ b/drivers/video/via/global.c
@@ -40,10 +40,6 @@ int viafb_hotplug_Yres = 480;
40int viafb_hotplug_bpp = 32; 40int viafb_hotplug_bpp = 32;
41int viafb_hotplug_refresh = 60; 41int viafb_hotplug_refresh = 60;
42int viafb_primary_dev = None_Device; 42int viafb_primary_dev = None_Device;
43unsigned int viafb_second_xres = 640;
44unsigned int viafb_second_yres = 480;
45unsigned int viafb_second_virtual_xres;
46unsigned int viafb_second_virtual_yres;
47int viafb_lcd_panel_id = LCD_PANEL_ID_MAXIMUM + 1; 43int viafb_lcd_panel_id = LCD_PANEL_ID_MAXIMUM + 1;
48struct fb_info *viafbinfo; 44struct fb_info *viafbinfo;
49struct fb_info *viafbinfo1; 45struct fb_info *viafbinfo1;
diff --git a/drivers/video/via/global.h b/drivers/video/via/global.h
index 38ef5ac6695..ff969dc3459 100644
--- a/drivers/video/via/global.h
+++ b/drivers/video/via/global.h
@@ -73,8 +73,6 @@ extern int viafb_hotplug_bpp;
73extern int viafb_hotplug_refresh; 73extern int viafb_hotplug_refresh;
74extern int viafb_primary_dev; 74extern int viafb_primary_dev;
75 75
76extern unsigned int viafb_second_xres;
77extern unsigned int viafb_second_yres;
78extern int viafb_lcd_panel_id; 76extern int viafb_lcd_panel_id;
79 77
80#endif /* __GLOBAL_H__ */ 78#endif /* __GLOBAL_H__ */
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 56ad185b7b2..3308f471b68 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -309,6 +309,42 @@ static struct io_reg scaling_parameters[] = {
309 {VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */ 309 {VIACR, CR87, 0xFF, 0x1F}, /* LCD Scaling Parameter 14 */
310}; 310};
311 311
312static struct io_reg common_vga[] = {
313 {VIACR, CR07, 0x10, 0x10}, /* [0] vertical total (bit 8)
314 [1] vertical display end (bit 8)
315 [2] vertical retrace start (bit 8)
316 [3] start vertical blanking (bit 8)
317 [4] line compare (bit 8)
318 [5] vertical total (bit 9)
319 [6] vertical display end (bit 9)
320 [7] vertical retrace start (bit 9) */
321 {VIACR, CR08, 0xFF, 0x00}, /* [0-4] preset row scan
322 [5-6] byte panning */
323 {VIACR, CR09, 0xDF, 0x40}, /* [0-4] max scan line
324 [5] start vertical blanking (bit 9)
325 [6] line compare (bit 9)
326 [7] scan doubling */
327 {VIACR, CR0A, 0xFF, 0x1E}, /* [0-4] cursor start
328 [5] cursor disable */
329 {VIACR, CR0B, 0xFF, 0x00}, /* [0-4] cursor end
330 [5-6] cursor skew */
331 {VIACR, CR0E, 0xFF, 0x00}, /* [0-7] cursor location (high) */
332 {VIACR, CR0F, 0xFF, 0x00}, /* [0-7] cursor location (low) */
333 {VIACR, CR11, 0xF0, 0x80}, /* [0-3] vertical retrace end
334 [6] memory refresh bandwidth
335 [7] CRTC register protect enable */
336 {VIACR, CR14, 0xFF, 0x00}, /* [0-4] underline location
337 [5] divide memory address clock by 4
338 [6] double word addressing */
339 {VIACR, CR17, 0xFF, 0x63}, /* [0-1] mapping of display address 13-14
340 [2] divide scan line clock by 2
341 [3] divide memory address clock by 2
342 [5] address wrap
343 [6] byte mode select
344 [7] sync enable */
345 {VIACR, CR18, 0xFF, 0xFF}, /* [0-7] line compare */
346};
347
312static struct fifo_depth_select display_fifo_depth_reg = { 348static struct fifo_depth_select display_fifo_depth_reg = {
313 /* IGA1 FIFO Depth_Select */ 349 /* IGA1 FIFO Depth_Select */
314 {IGA1_FIFO_DEPTH_SELECT_REG_NUM, {{SR17, 0, 7} } }, 350 {IGA1_FIFO_DEPTH_SELECT_REG_NUM, {{SR17, 0, 7} } },
@@ -771,13 +807,14 @@ static u32 get_lcd_devices(int output_interface)
771/*Set IGA path for each device*/ 807/*Set IGA path for each device*/
772void viafb_set_iga_path(void) 808void viafb_set_iga_path(void)
773{ 809{
810 int crt_iga_path = 0;
774 811
775 if (viafb_SAMM_ON == 1) { 812 if (viafb_SAMM_ON == 1) {
776 if (viafb_CRT_ON) { 813 if (viafb_CRT_ON) {
777 if (viafb_primary_dev == CRT_Device) 814 if (viafb_primary_dev == CRT_Device)
778 viaparinfo->crt_setting_info->iga_path = IGA1; 815 crt_iga_path = IGA1;
779 else 816 else
780 viaparinfo->crt_setting_info->iga_path = IGA2; 817 crt_iga_path = IGA2;
781 } 818 }
782 819
783 if (viafb_DVI_ON) { 820 if (viafb_DVI_ON) {
@@ -794,8 +831,7 @@ void viafb_set_iga_path(void)
794 UNICHROME_CLE266)) { 831 UNICHROME_CLE266)) {
795 viaparinfo-> 832 viaparinfo->
796 lvds_setting_info->iga_path = IGA2; 833 lvds_setting_info->iga_path = IGA2;
797 viaparinfo-> 834 crt_iga_path = IGA1;
798 crt_setting_info->iga_path = IGA1;
799 viaparinfo-> 835 viaparinfo->
800 tmds_setting_info->iga_path = IGA1; 836 tmds_setting_info->iga_path = IGA1;
801 } else 837 } else
@@ -815,10 +851,10 @@ void viafb_set_iga_path(void)
815 viafb_SAMM_ON = 0; 851 viafb_SAMM_ON = 0;
816 852
817 if (viafb_CRT_ON && viafb_LCD_ON) { 853 if (viafb_CRT_ON && viafb_LCD_ON) {
818 viaparinfo->crt_setting_info->iga_path = IGA1; 854 crt_iga_path = IGA1;
819 viaparinfo->lvds_setting_info->iga_path = IGA2; 855 viaparinfo->lvds_setting_info->iga_path = IGA2;
820 } else if (viafb_CRT_ON && viafb_DVI_ON) { 856 } else if (viafb_CRT_ON && viafb_DVI_ON) {
821 viaparinfo->crt_setting_info->iga_path = IGA1; 857 crt_iga_path = IGA1;
822 viaparinfo->tmds_setting_info->iga_path = IGA2; 858 viaparinfo->tmds_setting_info->iga_path = IGA2;
823 } else if (viafb_LCD_ON && viafb_DVI_ON) { 859 } else if (viafb_LCD_ON && viafb_DVI_ON) {
824 viaparinfo->tmds_setting_info->iga_path = IGA1; 860 viaparinfo->tmds_setting_info->iga_path = IGA1;
@@ -827,7 +863,7 @@ void viafb_set_iga_path(void)
827 viaparinfo->lvds_setting_info->iga_path = IGA2; 863 viaparinfo->lvds_setting_info->iga_path = IGA2;
828 viaparinfo->lvds_setting_info2->iga_path = IGA2; 864 viaparinfo->lvds_setting_info2->iga_path = IGA2;
829 } else if (viafb_CRT_ON) { 865 } else if (viafb_CRT_ON) {
830 viaparinfo->crt_setting_info->iga_path = IGA1; 866 crt_iga_path = IGA1;
831 } else if (viafb_LCD_ON) { 867 } else if (viafb_LCD_ON) {
832 viaparinfo->lvds_setting_info->iga_path = IGA2; 868 viaparinfo->lvds_setting_info->iga_path = IGA2;
833 } else if (viafb_DVI_ON) { 869 } else if (viafb_DVI_ON) {
@@ -838,7 +874,7 @@ void viafb_set_iga_path(void)
838 viaparinfo->shared->iga1_devices = 0; 874 viaparinfo->shared->iga1_devices = 0;
839 viaparinfo->shared->iga2_devices = 0; 875 viaparinfo->shared->iga2_devices = 0;
840 if (viafb_CRT_ON) { 876 if (viafb_CRT_ON) {
841 if (viaparinfo->crt_setting_info->iga_path == IGA1) 877 if (crt_iga_path == IGA1)
842 viaparinfo->shared->iga1_devices |= VIA_CRT; 878 viaparinfo->shared->iga1_devices |= VIA_CRT;
843 else 879 else
844 viaparinfo->shared->iga2_devices |= VIA_CRT; 880 viaparinfo->shared->iga2_devices |= VIA_CRT;
@@ -1167,25 +1203,17 @@ void via_odev_to_seq(struct seq_file *m, u32 odev)
1167 1203
1168static void load_fix_bit_crtc_reg(void) 1204static void load_fix_bit_crtc_reg(void)
1169{ 1205{
1206 viafb_unlock_crt();
1207
1170 /* always set to 1 */ 1208 /* always set to 1 */
1171 viafb_write_reg_mask(CR03, VIACR, 0x80, BIT7); 1209 viafb_write_reg_mask(CR03, VIACR, 0x80, BIT7);
1172 /* line compare should set all bits = 1 (extend modes) */ 1210 /* line compare should set all bits = 1 (extend modes) */
1173 viafb_write_reg(CR18, VIACR, 0xff);
1174 /* line compare should set all bits = 1 (extend modes) */
1175 viafb_write_reg_mask(CR07, VIACR, 0x10, BIT4);
1176 /* line compare should set all bits = 1 (extend modes) */
1177 viafb_write_reg_mask(CR09, VIACR, 0x40, BIT6);
1178 /* line compare should set all bits = 1 (extend modes) */
1179 viafb_write_reg_mask(CR35, VIACR, 0x10, BIT4); 1211 viafb_write_reg_mask(CR35, VIACR, 0x10, BIT4);
1180 /* line compare should set all bits = 1 (extend modes) */ 1212 /* line compare should set all bits = 1 (extend modes) */
1181 viafb_write_reg_mask(CR33, VIACR, 0x06, BIT0 + BIT1 + BIT2); 1213 viafb_write_reg_mask(CR33, VIACR, 0x06, BIT0 + BIT1 + BIT2);
1182 /*viafb_write_reg_mask(CR32, VIACR, 0x01, BIT0); */ 1214 /*viafb_write_reg_mask(CR32, VIACR, 0x01, BIT0); */
1183 /* extend mode always set to e3h */ 1215
1184 viafb_write_reg(CR17, VIACR, 0xe3); 1216 viafb_lock_crt();
1185 /* extend mode always set to 0h */
1186 viafb_write_reg(CR08, VIACR, 0x00);
1187 /* extend mode always set to 0h */
1188 viafb_write_reg(CR14, VIACR, 0x00);
1189 1217
1190 /* If K8M800, enable Prefetch Mode. */ 1218 /* If K8M800, enable Prefetch Mode. */
1191 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_K800) 1219 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_K800)
@@ -2038,8 +2066,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
2038 v_addr = crt_reg.ver_addr; 2066 v_addr = crt_reg.ver_addr;
2039 if (set_iga == IGA1) { 2067 if (set_iga == IGA1) {
2040 viafb_unlock_crt(); 2068 viafb_unlock_crt();
2041 viafb_write_reg(CR09, VIACR, 0x00); /*initial CR09=0 */
2042 viafb_write_reg_mask(CR11, VIACR, 0x00, BIT4 + BIT5 + BIT6);
2043 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7); 2069 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7);
2044 } 2070 }
2045 2071
@@ -2052,7 +2078,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
2052 break; 2078 break;
2053 } 2079 }
2054 2080
2055 load_fix_bit_crtc_reg();
2056 viafb_lock_crt(); 2081 viafb_lock_crt();
2057 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7); 2082 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7);
2058 viafb_load_fetch_count_reg(h_addr, bpp_byte, set_iga); 2083 viafb_load_fetch_count_reg(h_addr, bpp_byte, set_iga);
@@ -2076,8 +2101,6 @@ void __devinit viafb_init_chip_info(int chip_type)
2076 init_tmds_chip_info(); 2101 init_tmds_chip_info();
2077 init_lvds_chip_info(); 2102 init_lvds_chip_info();
2078 2103
2079 viaparinfo->crt_setting_info->iga_path = IGA1;
2080
2081 /*Set IGA path for each device */ 2104 /*Set IGA path for each device */
2082 viafb_set_iga_path(); 2105 viafb_set_iga_path();
2083 2106
@@ -2359,6 +2382,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2359 outb(0x00, VIAAR); 2382 outb(0x00, VIAAR);
2360 2383
2361 /* Write Common Setting for Video Mode */ 2384 /* Write Common Setting for Video Mode */
2385 viafb_write_regx(common_vga, ARRAY_SIZE(common_vga));
2362 switch (viaparinfo->chip_info->gfx_chip_name) { 2386 switch (viaparinfo->chip_info->gfx_chip_name) {
2363 case UNICHROME_CLE266: 2387 case UNICHROME_CLE266:
2364 viafb_write_regx(CLE266_ModeXregs, NUM_TOTAL_CLE266_ModeXregs); 2388 viafb_write_regx(CLE266_ModeXregs, NUM_TOTAL_CLE266_ModeXregs);
@@ -2405,9 +2429,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2405 2429
2406 viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2); 2430 viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2);
2407 2431
2408 /* Write CRTC */
2409 viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1);
2410
2411 /* Write Graphic Controller */ 2432 /* Write Graphic Controller */
2412 for (i = 0; i < StdGR; i++) 2433 for (i = 0; i < StdGR; i++)
2413 via_write_reg(VIAGR, i, VPIT.GR[i]); 2434 via_write_reg(VIAGR, i, VPIT.GR[i]);
@@ -2437,6 +2458,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2437 } 2458 }
2438 } 2459 }
2439 2460
2461 load_fix_bit_crtc_reg();
2440 via_set_primary_pitch(viafbinfo->fix.line_length); 2462 via_set_primary_pitch(viafbinfo->fix.line_length);
2441 via_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length 2463 via_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length
2442 : viafbinfo->fix.line_length); 2464 : viafbinfo->fix.line_length);
@@ -2456,15 +2478,15 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2456 2478
2457 /* CRT set mode */ 2479 /* CRT set mode */
2458 if (viafb_CRT_ON) { 2480 if (viafb_CRT_ON) {
2459 if (viafb_SAMM_ON && (viaparinfo->crt_setting_info->iga_path == 2481 if (viafb_SAMM_ON &&
2460 IGA2)) { 2482 viaparinfo->shared->iga2_devices & VIA_CRT) {
2461 viafb_fill_crtc_timing(crt_timing1, vmode_tbl1, 2483 viafb_fill_crtc_timing(crt_timing1, vmode_tbl1,
2462 video_bpp1 / 8, 2484 video_bpp1 / 8, IGA2);
2463 viaparinfo->crt_setting_info->iga_path);
2464 } else { 2485 } else {
2465 viafb_fill_crtc_timing(crt_timing, vmode_tbl, 2486 viafb_fill_crtc_timing(crt_timing, vmode_tbl,
2466 video_bpp / 8, 2487 video_bpp / 8,
2467 viaparinfo->crt_setting_info->iga_path); 2488 (viaparinfo->shared->iga1_devices & VIA_CRT)
2489 ? IGA1 : IGA2);
2468 } 2490 }
2469 2491
2470 /* Patch if set_hres is not 8 alignment (1366) to viafb_setmode 2492 /* Patch if set_hres is not 8 alignment (1366) to viafb_setmode
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 8858593405a..090d167863a 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -910,7 +910,6 @@ struct via_device_mapping {
910 const char *name; 910 const char *name;
911}; 911};
912 912
913extern unsigned int viafb_second_virtual_xres;
914extern int viafb_SAMM_ON; 913extern int viafb_SAMM_ON;
915extern int viafb_dual_fb; 914extern int viafb_dual_fb;
916extern int viafb_LCD2_ON; 915extern int viafb_LCD2_ON;
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 64bc7e76310..6984046c6ee 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -48,7 +48,6 @@ static struct _lcd_scaling_factor lcd_scaling_factor_CLE = {
48 {LCD_VER_SCALING_FACTOR_REG_NUM_CLE, {{CR78, 0, 7}, {CR79, 6, 7} } } 48 {LCD_VER_SCALING_FACTOR_REG_NUM_CLE, {{CR78, 0, 7}, {CR79, 6, 7} } }
49}; 49};
50 50
51static int check_lvds_chip(int device_id_subaddr, int device_id);
52static bool lvds_identify_integratedlvds(void); 51static bool lvds_identify_integratedlvds(void);
53static void __devinit fp_id_to_vindex(int panel_id); 52static void __devinit fp_id_to_vindex(int panel_id);
54static int lvds_register_read(int index); 53static int lvds_register_read(int index);
@@ -84,12 +83,9 @@ static struct display_timing lcd_centering_timging(struct display_timing
84 mode_crt_reg, 83 mode_crt_reg,
85 struct display_timing panel_crt_reg); 84 struct display_timing panel_crt_reg);
86 85
87static int check_lvds_chip(int device_id_subaddr, int device_id) 86static inline bool check_lvds_chip(int device_id_subaddr, int device_id)
88{ 87{
89 if (lvds_register_read(device_id_subaddr) == device_id) 88 return lvds_register_read(device_id_subaddr) == device_id;
90 return OK;
91 else
92 return FAIL;
93} 89}
94 90
95void __devinit viafb_init_lcd_size(void) 91void __devinit viafb_init_lcd_size(void)
@@ -150,7 +146,7 @@ static bool lvds_identify_integratedlvds(void)
150 return true; 146 return true;
151} 147}
152 148
153int __devinit viafb_lvds_trasmitter_identify(void) 149bool __devinit viafb_lvds_trasmitter_identify(void)
154{ 150{
155 if (viafb_lvds_identify_vt1636(VIA_PORT_31)) { 151 if (viafb_lvds_identify_vt1636(VIA_PORT_31)) {
156 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31; 152 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31;
@@ -175,20 +171,20 @@ int __devinit viafb_lvds_trasmitter_identify(void)
175 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr = 171 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr =
176 VT1631_LVDS_I2C_ADDR; 172 VT1631_LVDS_I2C_ADDR;
177 173
178 if (check_lvds_chip(VT1631_DEVICE_ID_REG, VT1631_DEVICE_ID) != FAIL) { 174 if (check_lvds_chip(VT1631_DEVICE_ID_REG, VT1631_DEVICE_ID)) {
179 DEBUG_MSG(KERN_INFO "\n VT1631 LVDS ! \n"); 175 DEBUG_MSG(KERN_INFO "\n VT1631 LVDS ! \n");
180 DEBUG_MSG(KERN_INFO "\n %2d", 176 DEBUG_MSG(KERN_INFO "\n %2d",
181 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name); 177 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name);
182 DEBUG_MSG(KERN_INFO "\n %2d", 178 DEBUG_MSG(KERN_INFO "\n %2d",
183 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name); 179 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name);
184 return OK; 180 return true;
185 } 181 }
186 182
187 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = 183 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name =
188 NON_LVDS_TRANSMITTER; 184 NON_LVDS_TRANSMITTER;
189 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr = 185 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr =
190 VT1631_LVDS_I2C_ADDR; 186 VT1631_LVDS_I2C_ADDR;
191 return FAIL; 187 return false;
192} 188}
193 189
194static void __devinit fp_id_to_vindex(int panel_id) 190static void __devinit fp_id_to_vindex(int panel_id)
diff --git a/drivers/video/via/lcd.h b/drivers/video/via/lcd.h
index c7909fe2955..75f60a655b0 100644
--- a/drivers/video/via/lcd.h
+++ b/drivers/video/via/lcd.h
@@ -79,7 +79,7 @@ void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
79void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, 79void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
80 struct lvds_setting_information *plvds_setting_info, 80 struct lvds_setting_information *plvds_setting_info,
81 struct lvds_chip_information *plvds_chip_info); 81 struct lvds_chip_information *plvds_chip_info);
82int __devinit viafb_lvds_trasmitter_identify(void); 82bool __devinit viafb_lvds_trasmitter_identify(void);
83void viafb_init_lvds_output_interface(struct lvds_chip_information 83void viafb_init_lvds_output_interface(struct lvds_chip_information
84 *plvds_chip_info, 84 *plvds_chip_info,
85 struct lvds_setting_information 85 struct lvds_setting_information
diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h
index 62bed2b12d6..8b93e2f6fea 100644
--- a/drivers/video/via/share.h
+++ b/drivers/video/via/share.h
@@ -22,14 +22,6 @@
22#ifndef __SHARE_H__ 22#ifndef __SHARE_H__
23#define __SHARE_H__ 23#define __SHARE_H__
24 24
25/* Define Return Value */
26#define FAIL -1
27#define OK 1
28
29#ifndef NULL
30#define NULL 0
31#endif
32
33/* Define Bit Field */ 25/* Define Bit Field */
34#define BIT0 0x01 26#define BIT0 0x01
35#define BIT1 0x02 27#define BIT1 0x02
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 9d9bb9b4ed3..eace9a4257f 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -37,6 +37,8 @@ static char *viafb_mode1;
37static int viafb_bpp = 32; 37static int viafb_bpp = 32;
38static int viafb_bpp1 = 32; 38static int viafb_bpp1 = 32;
39 39
40static unsigned int viafb_second_xres = 640;
41static unsigned int viafb_second_yres = 480;
40static unsigned int viafb_second_offset; 42static unsigned int viafb_second_offset;
41static int viafb_second_size; 43static int viafb_second_size;
42 44
@@ -440,8 +442,8 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
440 if (viafb_SAMM_ON == 1) { 442 if (viafb_SAMM_ON == 1) {
441 u.viamode.xres_sec = viafb_second_xres; 443 u.viamode.xres_sec = viafb_second_xres;
442 u.viamode.yres_sec = viafb_second_yres; 444 u.viamode.yres_sec = viafb_second_yres;
443 u.viamode.virtual_xres_sec = viafb_second_virtual_xres; 445 u.viamode.virtual_xres_sec = viafb_dual_fb ? viafbinfo1->var.xres_virtual : viafbinfo->var.xres_virtual;
444 u.viamode.virtual_yres_sec = viafb_second_virtual_yres; 446 u.viamode.virtual_yres_sec = viafb_dual_fb ? viafbinfo1->var.yres_virtual : viafbinfo->var.yres_virtual;
445 u.viamode.refresh_sec = viafb_refresh1; 447 u.viamode.refresh_sec = viafb_refresh1;
446 u.viamode.bpp_sec = viafb_bpp1; 448 u.viamode.bpp_sec = viafb_bpp1;
447 } else { 449 } else {
@@ -930,10 +932,8 @@ static int get_primary_device(void)
930 /* Rule: device on iga1 path are the primary device. */ 932 /* Rule: device on iga1 path are the primary device. */
931 if (viafb_SAMM_ON) { 933 if (viafb_SAMM_ON) {
932 if (viafb_CRT_ON) { 934 if (viafb_CRT_ON) {
933 if (viaparinfo->crt_setting_info->iga_path == IGA1) { 935 if (viaparinfo->shared->iga1_devices & VIA_CRT) {
934 DEBUG_MSG(KERN_INFO "CRT IGA Path:%d\n", 936 DEBUG_MSG(KERN_INFO "CRT IGA Path:%d\n", IGA1);
935 viaparinfo->
936 crt_setting_info->iga_path);
937 primary_device = CRT_Device; 937 primary_device = CRT_Device;
938 } 938 }
939 } 939 }
@@ -1746,7 +1746,6 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
1746 viaparinfo->lvds_setting_info = &viaparinfo->shared->lvds_setting_info; 1746 viaparinfo->lvds_setting_info = &viaparinfo->shared->lvds_setting_info;
1747 viaparinfo->lvds_setting_info2 = 1747 viaparinfo->lvds_setting_info2 =
1748 &viaparinfo->shared->lvds_setting_info2; 1748 &viaparinfo->shared->lvds_setting_info2;
1749 viaparinfo->crt_setting_info = &viaparinfo->shared->crt_setting_info;
1750 viaparinfo->chip_info = &viaparinfo->shared->chip_info; 1749 viaparinfo->chip_info = &viaparinfo->shared->chip_info;
1751 1750
1752 if (viafb_dual_fb) 1751 if (viafb_dual_fb)
@@ -1793,14 +1792,10 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
1793 1792
1794 parse_mode(viafb_mode, &default_xres, &default_yres); 1793 parse_mode(viafb_mode, &default_xres, &default_yres);
1795 vmode_entry = viafb_get_mode(default_xres, default_yres); 1794 vmode_entry = viafb_get_mode(default_xres, default_yres);
1796 if (viafb_SAMM_ON == 1) { 1795 if (viafb_SAMM_ON == 1)
1797 parse_mode(viafb_mode1, &viafb_second_xres, 1796 parse_mode(viafb_mode1, &viafb_second_xres,
1798 &viafb_second_yres); 1797 &viafb_second_yres);
1799 1798
1800 viafb_second_virtual_xres = viafb_second_xres;
1801 viafb_second_virtual_yres = viafb_second_yres;
1802 }
1803
1804 default_var.xres = default_xres; 1799 default_var.xres = default_xres;
1805 default_var.yres = default_yres; 1800 default_var.yres = default_yres;
1806 default_var.xres_virtual = default_xres; 1801 default_var.xres_virtual = default_xres;
@@ -1844,8 +1839,8 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
1844 1839
1845 default_var.xres = viafb_second_xres; 1840 default_var.xres = viafb_second_xres;
1846 default_var.yres = viafb_second_yres; 1841 default_var.yres = viafb_second_yres;
1847 default_var.xres_virtual = viafb_second_virtual_xres; 1842 default_var.xres_virtual = viafb_second_xres;
1848 default_var.yres_virtual = viafb_second_virtual_yres; 1843 default_var.yres_virtual = viafb_second_yres;
1849 default_var.bits_per_pixel = viafb_bpp1; 1844 default_var.bits_per_pixel = viafb_bpp1;
1850 viafb_fill_var_timing_info(&default_var, viafb_get_refresh( 1845 viafb_fill_var_timing_info(&default_var, viafb_get_refresh(
1851 default_var.xres, default_var.yres, viafb_refresh1), 1846 default_var.xres, default_var.yres, viafb_refresh1),
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h
index d66f963e930..59e40d1bd61 100644
--- a/drivers/video/via/viafbdev.h
+++ b/drivers/video/via/viafbdev.h
@@ -50,7 +50,6 @@ struct viafb_shared {
50 50
51 /* All the information will be needed to set engine */ 51 /* All the information will be needed to set engine */
52 struct tmds_setting_information tmds_setting_info; 52 struct tmds_setting_information tmds_setting_info;
53 struct crt_setting_information crt_setting_info;
54 struct lvds_setting_information lvds_setting_info; 53 struct lvds_setting_information lvds_setting_info;
55 struct lvds_setting_information lvds_setting_info2; 54 struct lvds_setting_information lvds_setting_info2;
56 struct chip_information chip_info; 55 struct chip_information chip_info;
@@ -79,14 +78,11 @@ struct viafb_par {
79 /* All the information will be needed to set engine */ 78 /* All the information will be needed to set engine */
80 /* depreciated, use the ones in shared directly */ 79 /* depreciated, use the ones in shared directly */
81 struct tmds_setting_information *tmds_setting_info; 80 struct tmds_setting_information *tmds_setting_info;
82 struct crt_setting_information *crt_setting_info;
83 struct lvds_setting_information *lvds_setting_info; 81 struct lvds_setting_information *lvds_setting_info;
84 struct lvds_setting_information *lvds_setting_info2; 82 struct lvds_setting_information *lvds_setting_info2;
85 struct chip_information *chip_info; 83 struct chip_information *chip_info;
86}; 84};
87 85
88extern unsigned int viafb_second_virtual_yres;
89extern unsigned int viafb_second_virtual_xres;
90extern int viafb_SAMM_ON; 86extern int viafb_SAMM_ON;
91extern int viafb_dual_fb; 87extern int viafb_dual_fb;
92extern int viafb_LCD2_ON; 88extern int viafb_LCD2_ON;
diff --git a/drivers/video/via/viamode.c b/drivers/video/via/viamode.c
index ccb5eec6324..f84c9b03b6b 100644
--- a/drivers/video/via/viamode.c
+++ b/drivers/video/via/viamode.c
@@ -30,10 +30,6 @@ struct io_reg CN400_ModeXregs[] = { {VIASR, SR10, 0xFF, 0x01},
30{VIASR, SR1A, 0xFB, 0x08}, 30{VIASR, SR1A, 0xFB, 0x08},
31{VIASR, SR1E, 0x0F, 0x01}, 31{VIASR, SR1E, 0x0F, 0x01},
32{VIASR, SR2A, 0xFF, 0x00}, 32{VIASR, SR2A, 0xFF, 0x00},
33{VIACR, CR0A, 0xFF, 0x1E}, /* Cursor Start */
34{VIACR, CR0B, 0xFF, 0x00}, /* Cursor End */
35{VIACR, CR0E, 0xFF, 0x00}, /* Cursor Location High */
36{VIACR, CR0F, 0xFF, 0x00}, /* Cursor Localtion Low */
37{VIACR, CR32, 0xFF, 0x00}, 33{VIACR, CR32, 0xFF, 0x00},
38{VIACR, CR33, 0xFF, 0x00}, 34{VIACR, CR33, 0xFF, 0x00},
39{VIACR, CR35, 0xFF, 0x00}, 35{VIACR, CR35, 0xFF, 0x00},
@@ -125,10 +121,6 @@ struct io_reg KM400_ModeXregs[] = {
125 {VIASR, SR2A, 0xFF, 0x00}, /* Power Management Control 5 */ 121 {VIASR, SR2A, 0xFF, 0x00}, /* Power Management Control 5 */
126 {VIASR, SR2D, 0xFF, 0xFF}, /* Power Management Control 1 */ 122 {VIASR, SR2D, 0xFF, 0xFF}, /* Power Management Control 1 */
127 {VIASR, SR2E, 0xFF, 0xFF}, /* Power Management Control 2 */ 123 {VIASR, SR2E, 0xFF, 0xFF}, /* Power Management Control 2 */
128 {VIACR, CR0A, 0xFF, 0x1E}, /* Cursor Start */
129 {VIACR, CR0B, 0xFF, 0x00}, /* Cursor End */
130 {VIACR, CR0E, 0xFF, 0x00}, /* Cursor Location High */
131 {VIACR, CR0F, 0xFF, 0x00}, /* Cursor Localtion Low */
132 {VIACR, CR33, 0xFF, 0x00}, 124 {VIACR, CR33, 0xFF, 0x00},
133 {VIACR, CR55, 0x80, 0x00}, 125 {VIACR, CR55, 0x80, 0x00},
134 {VIACR, CR5D, 0x80, 0x00}, 126 {VIACR, CR5D, 0x80, 0x00},
@@ -162,10 +154,6 @@ struct io_reg CX700_ModeXregs[] = { {VIASR, SR10, 0xFF, 0x01},
162{VIASR, SR1E, 0xFF, 0x01}, 154{VIASR, SR1E, 0xFF, 0x01},
163{VIASR, SR2A, 0xFF, 0x00}, 155{VIASR, SR2A, 0xFF, 0x00},
164{VIASR, SR2D, 0xFF, 0xFF}, /* VCK and LCK PLL power on. */ 156{VIASR, SR2D, 0xFF, 0xFF}, /* VCK and LCK PLL power on. */
165{VIACR, CR0A, 0xFF, 0x1E}, /* Cursor Start */
166{VIACR, CR0B, 0xFF, 0x00}, /* Cursor End */
167{VIACR, CR0E, 0xFF, 0x00}, /* Cursor Location High */
168{VIACR, CR0F, 0xFF, 0x00}, /* Cursor Localtion Low */
169{VIACR, CR32, 0xFF, 0x00}, 157{VIACR, CR32, 0xFF, 0x00},
170{VIACR, CR33, 0xFF, 0x00}, 158{VIACR, CR33, 0xFF, 0x00},
171{VIACR, CR35, 0xFF, 0x00}, 159{VIACR, CR35, 0xFF, 0x00},
@@ -205,13 +193,6 @@ struct io_reg VX855_ModeXregs[] = {
205{VIASR, SR58, 0xFF, 0x00}, 193{VIASR, SR58, 0xFF, 0x00},
206{VIASR, SR59, 0xFF, 0x00}, 194{VIASR, SR59, 0xFF, 0x00},
207{VIASR, SR2D, 0xFF, 0xFF}, /* VCK and LCK PLL power on. */ 195{VIASR, SR2D, 0xFF, 0xFF}, /* VCK and LCK PLL power on. */
208{VIACR, CR09, 0xFF, 0x00}, /* Initial CR09=0*/
209{VIACR, CR11, 0x8F, 0x00}, /* IGA1 initial Vertical end */
210{VIACR, CR17, 0x7F, 0x00}, /* IGA1 CRT Mode control init */
211{VIACR, CR0A, 0xFF, 0x1E}, /* Cursor Start */
212{VIACR, CR0B, 0xFF, 0x00}, /* Cursor End */
213{VIACR, CR0E, 0xFF, 0x00}, /* Cursor Location High */
214{VIACR, CR0F, 0xFF, 0x00}, /* Cursor Localtion Low */
215{VIACR, CR32, 0xFF, 0x00}, 196{VIACR, CR32, 0xFF, 0x00},
216{VIACR, CR33, 0x7F, 0x00}, 197{VIACR, CR33, 0x7F, 0x00},
217{VIACR, CR35, 0xFF, 0x00}, 198{VIACR, CR35, 0xFF, 0x00},