Lines Matching +full:timing +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0
11 #define AWG_DELAY (-5)
14 #define AWG_MAX_ARG 0x3ff
34 u32 instruction = 0; in awg_generate_instr()
35 u32 mux = (mux_sel << 8) & 0x1ff; in awg_generate_instr()
36 u32 data_enable = (data_en << 9) & 0x2ff; in awg_generate_instr()
46 while (arg_tmp > 0) { in awg_generate_instr()
48 if (fwparams->instruction_offset >= AWG_MAX_INST) { in awg_generate_instr()
50 return -EINVAL; in awg_generate_instr()
57 arg--; /* pixel adjustment */ in awg_generate_instr()
58 arg_tmp--; in awg_generate_instr()
60 if (arg < 0) { in awg_generate_instr()
62 return 0; in awg_generate_instr()
65 if (arg == 0) { in awg_generate_instr()
66 /* SKIP 0 not permitted but we want to skip 1 in awg_generate_instr()
73 mux = 0; in awg_generate_instr()
74 data_enable = 0; in awg_generate_instr()
79 if (arg == 0) { in awg_generate_instr()
81 return 0; in awg_generate_instr()
84 mux = 0; in awg_generate_instr()
85 data_enable = 0; in awg_generate_instr()
89 mux = 0; in awg_generate_instr()
90 data_enable = 0; in awg_generate_instr()
91 arg |= 0x40; /* for jump instruction 7th bit is 1 */ in awg_generate_instr()
95 arg = 0; in awg_generate_instr()
101 arg &= (0x0ff); in awg_generate_instr()
105 return -EINVAL; in awg_generate_instr()
108 arg_tmp = arg_tmp - arg; in awg_generate_instr()
113 fwparams->ram_code[fwparams->instruction_offset] = in awg_generate_instr()
114 instruction & (0x3fff); in awg_generate_instr()
115 fwparams->instruction_offset++; in awg_generate_instr()
117 return 0; in awg_generate_instr()
122 struct awg_timing *timing) in awg_generate_line_signal() argument
125 int ret = 0; in awg_generate_line_signal()
127 if (timing->trailing_pixels > 0) { in awg_generate_line_signal()
129 val = timing->blanking_level; in awg_generate_line_signal()
130 ret |= awg_generate_instr(RPLSET, val, 0, 0, fwparams); in awg_generate_line_signal()
132 val = timing->trailing_pixels - 1 + AWG_DELAY; in awg_generate_line_signal()
133 ret |= awg_generate_instr(SKIP, val, 0, 0, fwparams); in awg_generate_line_signal()
137 val = timing->blanking_level; in awg_generate_line_signal()
138 ret |= awg_generate_instr((timing->trailing_pixels > 0) ? SET : RPLSET, in awg_generate_line_signal()
139 val, 0, 1, fwparams); in awg_generate_line_signal()
141 if (timing->blanking_pixels > 0) { in awg_generate_line_signal()
143 val = timing->active_pixels - 1; in awg_generate_line_signal()
144 ret |= awg_generate_instr(SKIP, val, 0, 1, fwparams); in awg_generate_line_signal()
147 val = timing->blanking_level; in awg_generate_line_signal()
148 ret |= awg_generate_instr(SET, val, 0, 0, fwparams); in awg_generate_line_signal()
156 struct awg_timing *timing) in sti_awg_generate_code_data_enable_mode() argument
159 int ret = 0; in sti_awg_generate_code_data_enable_mode()
161 if (timing->trailing_lines > 0) { in sti_awg_generate_code_data_enable_mode()
163 val = timing->blanking_level; in sti_awg_generate_code_data_enable_mode()
164 ret |= awg_generate_instr(RPLSET, val, 0, 0, fwparams); in sti_awg_generate_code_data_enable_mode()
166 val = timing->trailing_lines - 1; in sti_awg_generate_code_data_enable_mode()
167 ret |= awg_generate_instr(REPLAY, val, 0, 0, fwparams); in sti_awg_generate_code_data_enable_mode()
170 tmp_val = timing->active_lines - 1; in sti_awg_generate_code_data_enable_mode()
172 while (tmp_val > 0) { in sti_awg_generate_code_data_enable_mode()
174 ret |= awg_generate_line_signal(fwparams, timing); in sti_awg_generate_code_data_enable_mode()
178 0, 0, fwparams); in sti_awg_generate_code_data_enable_mode()
179 tmp_val -= AWG_MAX_ARG; in sti_awg_generate_code_data_enable_mode()
182 if (timing->blanking_lines > 0) { in sti_awg_generate_code_data_enable_mode()
184 val = timing->blanking_level; in sti_awg_generate_code_data_enable_mode()
185 ret |= awg_generate_instr(RPLSET, val, 0, 0, fwparams); in sti_awg_generate_code_data_enable_mode()
187 val = timing->blanking_lines - 1; in sti_awg_generate_code_data_enable_mode()
188 ret |= awg_generate_instr(REPLAY, val, 0, 0, fwparams); in sti_awg_generate_code_data_enable_mode()