Lines Matching +full:bit0 +full:- +full:7
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
4 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
7 #include <linux/via-core.h>
25 {{CR9F, 0, 1}, {CR77, 0, 7}, {CR79, 4, 5} } },
28 {{CR79, 3, 3}, {CR78, 0, 7}, {CR79, 6, 7} } }
32 {LCD_HOR_SCALING_FACTOR_REG_NUM_CLE, {{CR77, 0, 7}, {CR79, 4, 5} } },
34 {LCD_VER_SCALING_FACTOR_REG_NUM_CLE, {{CR78, 0, 7}, {CR79, 6, 7} } }
75 viaparinfo->lvds_setting_info2->lcd_panel_hres = in viafb_init_lcd_size()
76 viaparinfo->lvds_setting_info->lcd_panel_hres; in viafb_init_lcd_size()
77 viaparinfo->lvds_setting_info2->lcd_panel_vres = in viafb_init_lcd_size()
78 viaparinfo->lvds_setting_info->lcd_panel_vres; in viafb_init_lcd_size()
79 viaparinfo->lvds_setting_info2->device_lcd_dualedge = in viafb_init_lcd_size()
80 viaparinfo->lvds_setting_info->device_lcd_dualedge; in viafb_init_lcd_size()
81 viaparinfo->lvds_setting_info2->LCDDithering = in viafb_init_lcd_size()
82 viaparinfo->lvds_setting_info->LCDDithering; in viafb_init_lcd_size()
91 if (viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { in lvds_identify_integratedlvds()
92 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name = in lvds_identify_integratedlvds()
97 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = in lvds_identify_integratedlvds()
104 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = in lvds_identify_integratedlvds()
106 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name = in lvds_identify_integratedlvds()
113 if (!viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { in lvds_identify_integratedlvds()
114 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = in lvds_identify_integratedlvds()
119 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = in lvds_identify_integratedlvds()
131 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31; in viafb_lvds_trasmitter_identify()
136 viaparinfo->chip_info->lvds_chip_info.i2c_port = in viafb_lvds_trasmitter_identify()
143 if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CX700) in viafb_lvds_trasmitter_identify()
146 if (viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) in viafb_lvds_trasmitter_identify()
149 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = VT1631_LVDS; in viafb_lvds_trasmitter_identify()
150 viaparinfo->chip_info->lvds_chip_info.lvds_chip_target_addr = in viafb_lvds_trasmitter_identify()
156 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name); in viafb_lvds_trasmitter_identify()
158 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name); in viafb_lvds_trasmitter_identify()
162 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = in viafb_lvds_trasmitter_identify()
164 viaparinfo->chip_info->lvds_chip_info.lvds_chip_target_addr = in viafb_lvds_trasmitter_identify()
179 viaparinfo->lvds_setting_info->lcd_panel_hres = 640; in fp_id_to_vindex()
180 viaparinfo->lvds_setting_info->lcd_panel_vres = 480; in fp_id_to_vindex()
181 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
182 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
185 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; in fp_id_to_vindex()
186 viaparinfo->lvds_setting_info->lcd_panel_vres = 600; in fp_id_to_vindex()
187 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
188 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
191 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; in fp_id_to_vindex()
192 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
193 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
194 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
197 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
198 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
199 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
200 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
203 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
204 viaparinfo->lvds_setting_info->lcd_panel_vres = 1024; in fp_id_to_vindex()
205 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
206 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
209 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400; in fp_id_to_vindex()
210 viaparinfo->lvds_setting_info->lcd_panel_vres = 1050; in fp_id_to_vindex()
211 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
212 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
215 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600; in fp_id_to_vindex()
216 viaparinfo->lvds_setting_info->lcd_panel_vres = 1200; in fp_id_to_vindex()
217 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
218 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
221 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; in fp_id_to_vindex()
222 viaparinfo->lvds_setting_info->lcd_panel_vres = 480; in fp_id_to_vindex()
223 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
224 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
227 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; in fp_id_to_vindex()
228 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
229 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
230 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
233 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; in fp_id_to_vindex()
234 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
235 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
236 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
239 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; in fp_id_to_vindex()
240 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
241 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
242 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
245 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
246 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
247 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
248 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
251 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
252 viaparinfo->lvds_setting_info->lcd_panel_vres = 1024; in fp_id_to_vindex()
253 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
254 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
257 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400; in fp_id_to_vindex()
258 viaparinfo->lvds_setting_info->lcd_panel_vres = 1050; in fp_id_to_vindex()
259 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
260 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
263 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600; in fp_id_to_vindex()
264 viaparinfo->lvds_setting_info->lcd_panel_vres = 1200; in fp_id_to_vindex()
265 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
266 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
269 viaparinfo->lvds_setting_info->lcd_panel_hres = 1366; in fp_id_to_vindex()
270 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
271 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
272 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
275 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; in fp_id_to_vindex()
276 viaparinfo->lvds_setting_info->lcd_panel_vres = 600; in fp_id_to_vindex()
277 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
278 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
281 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
282 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
283 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
284 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
287 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
288 viaparinfo->lvds_setting_info->lcd_panel_vres = 800; in fp_id_to_vindex()
289 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
290 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
293 viaparinfo->lvds_setting_info->lcd_panel_hres = 1360; in fp_id_to_vindex()
294 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
295 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
296 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
299 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; in fp_id_to_vindex()
300 viaparinfo->lvds_setting_info->lcd_panel_vres = 768; in fp_id_to_vindex()
301 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; in fp_id_to_vindex()
302 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
305 viaparinfo->lvds_setting_info->lcd_panel_hres = 480; in fp_id_to_vindex()
306 viaparinfo->lvds_setting_info->lcd_panel_vres = 640; in fp_id_to_vindex()
307 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
308 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
311 /* OLPC XO-1.5 panel */ in fp_id_to_vindex()
312 viaparinfo->lvds_setting_info->lcd_panel_hres = 1200; in fp_id_to_vindex()
313 viaparinfo->lvds_setting_info->lcd_panel_vres = 900; in fp_id_to_vindex()
314 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
315 viaparinfo->lvds_setting_info->LCDDithering = 0; in fp_id_to_vindex()
318 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; in fp_id_to_vindex()
319 viaparinfo->lvds_setting_info->lcd_panel_vres = 600; in fp_id_to_vindex()
320 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; in fp_id_to_vindex()
321 viaparinfo->lvds_setting_info->LCDDithering = 1; in fp_id_to_vindex()
330 (u8) viaparinfo->chip_info->lvds_chip_info.lvds_chip_target_addr, in lvds_register_read()
345 viafb_write_reg_mask(CR79, VIACR, 0x07, BIT0 + BIT1 + BIT2); in load_lcd_scaling()
350 switch (viaparinfo->chip_info->gfx_chip_name) { in load_lcd_scaling()
394 switch (viaparinfo->chip_info->gfx_chip_name) { in load_lcd_scaling()
458 cr67 |= (unsigned char)((dwScreenPitch & 0x600) >> 7); in via_pitch_alignment_patch_lcd()
480 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name) { in lcd_patch_skew_dvp0()
481 switch (viaparinfo->chip_info->gfx_chip_name) { in lcd_patch_skew_dvp0()
497 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name) { in lcd_patch_skew_dvp1()
498 switch (viaparinfo->chip_info->gfx_chip_name) { in lcd_patch_skew_dvp1()
510 switch (plvds_chip_info->output_interface) { in lcd_patch_skew()
518 if (UNICHROME_P4M900 == viaparinfo->chip_info->gfx_chip_name) { in lcd_patch_skew()
520 BIT0 + BIT1 + BIT2 + BIT3); in lcd_patch_skew()
531 int set_iga = plvds_setting_info->iga_path; in viafb_lcd_set_mode()
532 int mode_bpp = var->bits_per_pixel; in viafb_lcd_set_mode()
533 int set_hres = cxres ? cxres : var->xres; in viafb_lcd_set_mode()
534 int set_vres = cyres ? cyres : var->yres; in viafb_lcd_set_mode()
535 int panel_hres = plvds_setting_info->lcd_panel_hres; in viafb_lcd_set_mode()
536 int panel_vres = plvds_setting_info->lcd_panel_vres; in viafb_lcd_set_mode()
547 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name) in viafb_lcd_set_mode()
549 clock = PICOS2KHZ(panel_crt_table->pixclock) * 1000; in viafb_lcd_set_mode()
550 plvds_setting_info->vclk = clock; in viafb_lcd_set_mode()
553 && plvds_setting_info->display_method == LCD_EXPANDSION) { in viafb_lcd_set_mode()
561 BIT0 + BIT1 + BIT2); in viafb_lcd_set_mode()
572 if ((viaparinfo->chip_info->gfx_chip_name != UNICHROME_CLE266) in viafb_lcd_set_mode()
573 && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400)) in viafb_lcd_set_mode()
581 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_K800) in viafb_lcd_set_mode()
582 || (UNICHROME_K8M890 == viaparinfo->chip_info->gfx_chip_name)) in viafb_lcd_set_mode()
583 viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); in viafb_lcd_set_mode()
586 via_pitch_alignment_patch_lcd(plvds_setting_info->iga_path, set_hres, in viafb_lcd_set_mode()
587 var->bits_per_pixel); in viafb_lcd_set_mode()
596 if (INTERFACE_LVDS0LVDS1 == plvds_chip_info->output_interface) in integrated_lvds_disable()
598 if (INTERFACE_LVDS0 == plvds_chip_info->output_interface) in integrated_lvds_disable()
600 if (INTERFACE_LVDS1 == plvds_chip_info->output_interface) in integrated_lvds_disable()
622 switch (plvds_chip_info->output_interface) { in integrated_lvds_disable()
648 plvds_chip_info->output_interface); in integrated_lvds_enable()
649 if (plvds_setting_info->lcd_mode == LCD_SPWG) in integrated_lvds_enable()
650 viafb_write_reg_mask(CRD2, VIACR, 0x00, BIT0 + BIT1); in integrated_lvds_enable()
652 viafb_write_reg_mask(CRD2, VIACR, 0x03, BIT0 + BIT1); in integrated_lvds_enable()
654 switch (plvds_chip_info->output_interface) { in integrated_lvds_enable()
659 viafb_write_reg_mask(CR91, VIACR, 0, BIT0); in integrated_lvds_enable()
668 viafb_write_reg_mask(CRD3, VIACR, 0, BIT0); in integrated_lvds_enable()
677 switch (plvds_chip_info->output_interface) { in integrated_lvds_enable()
701 if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) { in viafb_lcd_disable()
705 } else if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CX700) { in viafb_lcd_disable()
708 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name)) in viafb_lcd_disable()
709 integrated_lvds_disable(viaparinfo->lvds_setting_info, in viafb_lcd_disable()
710 &viaparinfo->chip_info->lvds_chip_info2); in viafb_lcd_disable()
712 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) in viafb_lcd_disable()
713 integrated_lvds_disable(viaparinfo->lvds_setting_info, in viafb_lcd_disable()
714 &viaparinfo->chip_info->lvds_chip_info); in viafb_lcd_disable()
715 if (VT1636_LVDS == viaparinfo->chip_info-> in viafb_lcd_disable()
717 viafb_disable_lvds_vt1636(viaparinfo->lvds_setting_info, in viafb_lcd_disable()
718 &viaparinfo->chip_info->lvds_chip_info); in viafb_lcd_disable()
720 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { in viafb_lcd_disable()
721 viafb_disable_lvds_vt1636(viaparinfo->lvds_setting_info, in viafb_lcd_disable()
722 &viaparinfo->chip_info->lvds_chip_info); in viafb_lcd_disable()
740 if ((UNICHROME_K8M890 == viaparinfo->chip_info->gfx_chip_name) in set_lcd_output_path()
742 viaparinfo->chip_info->gfx_chip_name)) in set_lcd_output_path()
744 BIT7 + BIT2 + BIT1 + BIT0); in set_lcd_output_path()
760 set_lcd_output_path(viaparinfo->lvds_setting_info->iga_path, in viafb_lcd_enable()
761 viaparinfo->chip_info->lvds_chip_info.output_interface); in viafb_lcd_enable()
763 set_lcd_output_path(viaparinfo->lvds_setting_info2->iga_path, in viafb_lcd_enable()
764 viaparinfo->chip_info-> in viafb_lcd_enable()
767 if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) { in viafb_lcd_enable()
771 } else if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CX700) { in viafb_lcd_enable()
773 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name)) in viafb_lcd_enable()
774 integrated_lvds_enable(viaparinfo->lvds_setting_info2, \ in viafb_lcd_enable()
775 &viaparinfo->chip_info->lvds_chip_info2); in viafb_lcd_enable()
777 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) in viafb_lcd_enable()
778 integrated_lvds_enable(viaparinfo->lvds_setting_info, in viafb_lcd_enable()
779 &viaparinfo->chip_info->lvds_chip_info); in viafb_lcd_enable()
780 if (VT1636_LVDS == viaparinfo->chip_info-> in viafb_lcd_enable()
782 viafb_enable_lvds_vt1636(viaparinfo-> in viafb_lcd_enable()
783 lvds_setting_info, &viaparinfo->chip_info-> in viafb_lcd_enable()
786 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { in viafb_lcd_enable()
787 viafb_enable_lvds_vt1636(viaparinfo->lvds_setting_info, in viafb_lcd_enable()
788 &viaparinfo->chip_info->lvds_chip_info); in viafb_lcd_enable()
841 if (viaparinfo->lvds_setting_info->device_lcd_dualedge) in fill_lcd_format()
843 if (viaparinfo->lvds_setting_info->LCDDithering) in fill_lcd_format()
844 bdithering = BIT0; in fill_lcd_format()
846 viafb_write_reg_mask(CR88, VIACR, (bdithering | bdual), BIT4 + BIT0); in fill_lcd_format()
858 if (plvds_setting_info->device_lcd_dualedge) { in check_diport_of_integrated_lvds()
859 plvds_chip_info->output_interface = in check_diport_of_integrated_lvds()
862 plvds_chip_info->output_interface = in check_diport_of_integrated_lvds()
871 plvds_chip_info->output_interface = INTERFACE_NONE; in check_diport_of_integrated_lvds()
878 plvds_chip_info->output_interface = in check_diport_of_integrated_lvds()
885 plvds_chip_info->output_interface = INTERFACE_LVDS1; in check_diport_of_integrated_lvds()
891 plvds_chip_info->output_interface = INTERFACE_LVDS1; in check_diport_of_integrated_lvds()
899 plvds_chip_info->output_interface); in check_diport_of_integrated_lvds()
907 if (INTERFACE_NONE != plvds_chip_info->output_interface) { in viafb_init_lvds_output_interface()
912 switch (plvds_chip_info->lvds_chip_name) { in viafb_init_lvds_output_interface()
915 switch (viaparinfo->chip_info->gfx_chip_name) { in viafb_init_lvds_output_interface()
917 plvds_chip_info->output_interface = INTERFACE_DVP1; in viafb_init_lvds_output_interface()
920 plvds_chip_info->output_interface = INTERFACE_DFP_LOW; in viafb_init_lvds_output_interface()
923 plvds_chip_info->output_interface = INTERFACE_DVP0; in viafb_init_lvds_output_interface()
934 switch (viaparinfo->chip_info->gfx_chip_name) { in viafb_init_lvds_output_interface()
938 plvds_chip_info->output_interface = INTERFACE_DFP_LOW; in viafb_init_lvds_output_interface()
941 plvds_chip_info->output_interface = INTERFACE_DFP; in viafb_init_lvds_output_interface()