aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-07-27 21:11:41 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-09-23 22:14:38 -0400
commitb002741d174a32f8162b2110ad9757b6fb6afcc3 (patch)
tree498e862bc9c03711ad7df24d2d299260a2e63a9b
parent414d3ce1b34384dd42e31536075583b9edb3cab6 (diff)
viafb: enable second display channel at central place
Move the enabling of the second display channel to the generic output routing function and do it exactly if something is using it. This unifies a zoo of variants how to do it and does no longer disable it if LCD is not on the second display which is much saner as there can be other users who need it. Probably this did not cause any problems so far as we only recently started dual fb support and otherwise there won't be other users and LCD is preferred assigned to second display channel. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
-rw-r--r--drivers/video/via/hw.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index a3db80417593..1ce2c211bd1d 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -733,7 +733,6 @@ static void set_display_channel(void);
733static void device_off(void); 733static void device_off(void);
734static void device_on(void); 734static void device_on(void);
735static void enable_second_display_channel(void); 735static void enable_second_display_channel(void);
736static void disable_second_display_channel(void);
737 736
738void viafb_lock_crt(void) 737void viafb_lock_crt(void)
739{ 738{
@@ -856,6 +855,9 @@ void viafb_set_output_path(int device, int set_iga, int output_interface)
856 set_lcd_output_path(set_iga, output_interface); 855 set_lcd_output_path(set_iga, output_interface);
857 break; 856 break;
858 } 857 }
858
859 if (set_iga == IGA2)
860 enable_second_display_channel();
859} 861}
860 862
861static void set_crt_output_path(int set_iga) 863static void set_crt_output_path(int set_iga)
@@ -867,7 +869,6 @@ static void set_crt_output_path(int set_iga)
867 viafb_write_reg_mask(SR16, VIASR, 0x00, BIT6); 869 viafb_write_reg_mask(SR16, VIASR, 0x00, BIT6);
868 break; 870 break;
869 case IGA2: 871 case IGA2:
870 viafb_write_reg_mask(CR6A, VIACR, 0xC0, BIT6 + BIT7);
871 viafb_write_reg_mask(SR16, VIASR, 0x40, BIT6); 872 viafb_write_reg_mask(SR16, VIASR, 0x40, BIT6);
872 break; 873 break;
873 } 874 }
@@ -1017,7 +1018,6 @@ static void set_dvi_output_path(int set_iga, int output_interface)
1017 } 1018 }
1018 1019
1019 if (set_iga == IGA2) { 1020 if (set_iga == IGA2) {
1020 enable_second_display_channel();
1021 /* Disable LCD Scaling */ 1021 /* Disable LCD Scaling */
1022 viafb_write_reg_mask(CR79, VIACR, 0x00, BIT0); 1022 viafb_write_reg_mask(CR79, VIACR, 0x00, BIT0);
1023 } 1023 }
@@ -1028,21 +1028,9 @@ static void set_lcd_output_path(int set_iga, int output_interface)
1028 DEBUG_MSG(KERN_INFO 1028 DEBUG_MSG(KERN_INFO
1029 "set_lcd_output_path, iga:%d,out_interface:%d\n", 1029 "set_lcd_output_path, iga:%d,out_interface:%d\n",
1030 set_iga, output_interface); 1030 set_iga, output_interface);
1031 switch (set_iga) {
1032 case IGA1:
1033 viafb_write_reg_mask(CR6B, VIACR, 0x00, BIT3);
1034 viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3);
1035 1031
1036 disable_second_display_channel(); 1032 viafb_write_reg_mask(CR6B, VIACR, 0x00, BIT3);
1037 break; 1033 viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3);
1038
1039 case IGA2:
1040 viafb_write_reg_mask(CR6B, VIACR, 0x00, BIT3);
1041 viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3);
1042
1043 enable_second_display_channel();
1044 break;
1045 }
1046 1034
1047 switch (output_interface) { 1035 switch (output_interface) {
1048 case INTERFACE_DVP0: 1036 case INTERFACE_DVP0:
@@ -2480,10 +2468,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2480 viafb_DeviceStatus = CRT_Device; 2468 viafb_DeviceStatus = CRT_Device;
2481 } 2469 }
2482 device_on(); 2470 device_on();
2483
2484 if (viafb_SAMM_ON == 1)
2485 viafb_write_reg_mask(CR6A, VIACR, 0xC0, BIT6 + BIT7);
2486
2487 device_screen_on(); 2471 device_screen_on();
2488 return 1; 2472 return 1;
2489} 2473}
@@ -2557,15 +2541,6 @@ static void enable_second_display_channel(void)
2557 viafb_write_reg_mask(CR6A, VIACR, BIT6, BIT6); 2541 viafb_write_reg_mask(CR6A, VIACR, BIT6, BIT6);
2558} 2542}
2559 2543
2560static void disable_second_display_channel(void)
2561{
2562 /* to disable second display channel. */
2563 viafb_write_reg_mask(CR6A, VIACR, 0x00, BIT6);
2564 viafb_write_reg_mask(CR6A, VIACR, 0x00, BIT7);
2565 viafb_write_reg_mask(CR6A, VIACR, BIT6, BIT6);
2566}
2567
2568
2569void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\ 2544void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
2570 *p_gfx_dpa_setting) 2545 *p_gfx_dpa_setting)
2571{ 2546{