Lines Matching +full:timing +full:-
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.
12 #include <linux/via-core.h>
18 void via_set_primary_timing(const struct via_display_timing *timing) in via_set_primary_timing() argument
22 raw.hor_total = timing->hor_total / 8 - 5; in via_set_primary_timing()
23 raw.hor_addr = timing->hor_addr / 8 - 1; in via_set_primary_timing()
24 raw.hor_blank_start = timing->hor_blank_start / 8 - 1; in via_set_primary_timing()
25 raw.hor_blank_end = timing->hor_blank_end / 8 - 1; in via_set_primary_timing()
26 raw.hor_sync_start = timing->hor_sync_start / 8; in via_set_primary_timing()
27 raw.hor_sync_end = timing->hor_sync_end / 8; in via_set_primary_timing()
28 raw.ver_total = timing->ver_total - 2; in via_set_primary_timing()
29 raw.ver_addr = timing->ver_addr - 1; in via_set_primary_timing()
30 raw.ver_blank_start = timing->ver_blank_start - 1; in via_set_primary_timing()
31 raw.ver_blank_end = timing->ver_blank_end - 1; in via_set_primary_timing()
32 raw.ver_sync_start = timing->ver_sync_start - 1; in via_set_primary_timing()
33 raw.ver_sync_end = timing->ver_sync_end - 1; in via_set_primary_timing()
35 /* unlock timing registers */ in via_set_primary_timing()
44 | (raw.hor_blank_end << (7 - 5) & 0x80), 0x9F); in via_set_primary_timing()
47 | (raw.ver_addr >> (8 - 1) & 0x02) in via_set_primary_timing()
48 | (raw.ver_sync_start >> (8 - 2) & 0x04) in via_set_primary_timing()
49 | (raw.ver_blank_start >> (8 - 3) & 0x08) in via_set_primary_timing()
50 | (raw.ver_total >> (9 - 5) & 0x20) in via_set_primary_timing()
51 | (raw.ver_addr >> (9 - 6) & 0x40) in via_set_primary_timing()
52 | (raw.ver_sync_start >> (9 - 7) & 0x80), 0xEF); in via_set_primary_timing()
53 via_write_reg_mask(VIACR, 0x09, raw.ver_blank_start >> (9 - 5) & 0x20, in via_set_primary_timing()
60 via_write_reg_mask(VIACR, 0x33, (raw.hor_sync_start >> (8 - 4) & 0x10) in via_set_primary_timing()
61 | (raw.hor_blank_end >> (6 - 5) & 0x20), 0x30); in via_set_primary_timing()
63 | (raw.ver_sync_start >> (10 - 1) & 0x02) in via_set_primary_timing()
64 | (raw.ver_addr >> (10 - 2) & 0x04) in via_set_primary_timing()
65 | (raw.ver_blank_start >> (10 - 3) & 0x08), 0x0F); in via_set_primary_timing()
66 via_write_reg_mask(VIACR, 0x36, raw.hor_total >> (8 - 3) & 0x08, 0x08); in via_set_primary_timing()
68 /* lock timing registers */ in via_set_primary_timing()
71 /* reset timing control */ in via_set_primary_timing()
76 void via_set_secondary_timing(const struct via_display_timing *timing) in via_set_secondary_timing() argument
80 raw.hor_total = timing->hor_total - 1; in via_set_secondary_timing()
81 raw.hor_addr = timing->hor_addr - 1; in via_set_secondary_timing()
82 raw.hor_blank_start = timing->hor_blank_start - 1; in via_set_secondary_timing()
83 raw.hor_blank_end = timing->hor_blank_end - 1; in via_set_secondary_timing()
84 raw.hor_sync_start = timing->hor_sync_start - 1; in via_set_secondary_timing()
85 raw.hor_sync_end = timing->hor_sync_end - 1; in via_set_secondary_timing()
86 raw.ver_total = timing->ver_total - 1; in via_set_secondary_timing()
87 raw.ver_addr = timing->ver_addr - 1; in via_set_secondary_timing()
88 raw.ver_blank_start = timing->ver_blank_start - 1; in via_set_secondary_timing()
89 raw.ver_blank_end = timing->ver_blank_end - 1; in via_set_secondary_timing()
90 raw.ver_sync_start = timing->ver_sync_start - 1; in via_set_secondary_timing()
91 raw.ver_sync_end = timing->ver_sync_end - 1; in via_set_secondary_timing()
98 | (raw.hor_blank_end >> (8 - 3) & 0x38) in via_set_secondary_timing()
99 | (raw.hor_sync_start >> (8 - 6) & 0xC0)); in via_set_secondary_timing()
101 | (raw.hor_addr >> (8 - 4) & 0x70), 0x7F); in via_set_secondary_timing()
109 | (raw.ver_blank_end >> (8 - 3) & 0x38) in via_set_secondary_timing()
110 | (raw.hor_sync_end >> (8 - 6) & 0x40) in via_set_secondary_timing()
111 | (raw.hor_sync_start >> (10 - 7) & 0x80)); in via_set_secondary_timing()
113 | (raw.ver_addr >> (8 - 3) & 0x38) in via_set_secondary_timing()
114 | (raw.hor_blank_end >> (11 - 6) & 0x40) in via_set_secondary_timing()
115 | (raw.hor_sync_start >> (11 - 7) & 0x80)); in via_set_secondary_timing()
118 | (raw.ver_sync_start >> (8 - 5) & 0xE0)); in via_set_secondary_timing()
148 via_write_reg_mask(VIACR, 0x35, (pitch >> (8 - 5)) & 0xE0, 0xE0); in via_set_primary_pitch()
157 via_write_reg_mask(VIACR, 0x71, (pitch >> (10 - 7)) & 0x80, 0x80); in via_set_secondary_pitch()