Lines Matching full:timing

26 static void dsi_dphy_timing_calc_clk_zero(struct msm_dsi_dphy_timing *timing,  in dsi_dphy_timing_calc_clk_zero()  argument
33 temp = 300 * coeff - ((timing->clk_prepare >> 1) + 1) * 2 * ui; in dsi_dphy_timing_calc_clk_zero()
44 temp = (timing->hs_rqst + timing->clk_prepare + clk_z) & 0x7; in dsi_dphy_timing_calc_clk_zero()
45 timing->clk_zero = clk_z + 8 - temp; in dsi_dphy_timing_calc_clk_zero()
48 int msm_dsi_dphy_timing_calc(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc() argument
70 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, true); in msm_dsi_dphy_timing_calc()
74 timing->hs_rqst = temp; in msm_dsi_dphy_timing_calc()
76 timing->hs_rqst = max_t(s32, 0, temp - 2); in msm_dsi_dphy_timing_calc()
79 dsi_dphy_timing_calc_clk_zero(timing, ui, coeff, pcnt2); in msm_dsi_dphy_timing_calc()
84 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, true); in msm_dsi_dphy_timing_calc()
90 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, true); in msm_dsi_dphy_timing_calc()
93 temp = ((timing->hs_prepare >> 1) + 1) * 2 * ui + 2 * ui; in msm_dsi_dphy_timing_calc()
96 timing->hs_zero = linear_inter(tmax, tmin, pcnt2, 24, true); in msm_dsi_dphy_timing_calc()
102 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, true); in msm_dsi_dphy_timing_calc()
106 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, true); in msm_dsi_dphy_timing_calc()
109 temp = ((timing->hs_exit >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
112 timing->shared_timings.clk_post = linear_inter(tmax, tmin, pcnt2, 0, in msm_dsi_dphy_timing_calc()
115 temp = ((timing->clk_prepare >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
116 temp += ((timing->clk_zero >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
121 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc()
122 timing->shared_timings.clk_pre_inc_by_2 = true; in msm_dsi_dphy_timing_calc()
124 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc()
126 timing->shared_timings.clk_pre_inc_by_2 = false; in msm_dsi_dphy_timing_calc()
129 timing->ta_go = 3; in msm_dsi_dphy_timing_calc()
130 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc()
131 timing->ta_get = 4; in msm_dsi_dphy_timing_calc()
134 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc()
135 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc()
136 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc()
137 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc()
138 timing->hs_rqst); in msm_dsi_dphy_timing_calc()
143 int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v2() argument
164 timing->hs_halfbyte_en = 0; in msm_dsi_dphy_timing_calc_v2()
166 timing->hs_halfbyte_en_ckln = 0; in msm_dsi_dphy_timing_calc_v2()
168 timing->hs_prep_dly_ckln = (bit_rate > 100000000) ? 0 : 3; in msm_dsi_dphy_timing_calc_v2()
169 pd_ckln = timing->hs_prep_dly_ckln; in msm_dsi_dphy_timing_calc_v2()
170 timing->hs_prep_dly = (bit_rate > 120000000) ? 0 : 1; in msm_dsi_dphy_timing_calc_v2()
171 pd = timing->hs_prep_dly; in msm_dsi_dphy_timing_calc_v2()
183 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, false); in msm_dsi_dphy_timing_calc_v2()
185 temp = 300 * coeff - ((timing->clk_prepare << 3) + val_ckln) * ui; in msm_dsi_dphy_timing_calc_v2()
188 timing->clk_zero = linear_inter(tmax, tmin, pcnt5, 0, false); in msm_dsi_dphy_timing_calc_v2()
193 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v2()
199 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, false); in msm_dsi_dphy_timing_calc_v2()
201 temp = 145 * coeff + 10 * ui - ((timing->hs_prepare << 3) + val) * ui; in msm_dsi_dphy_timing_calc_v2()
204 timing->hs_zero = linear_inter(tmax, tmin, pcnt4, 0, false); in msm_dsi_dphy_timing_calc_v2()
209 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v2()
212 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v2()
216 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, false); in msm_dsi_dphy_timing_calc_v2()
219 timing->hs_rqst_ckln = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v2()
224 timing->shared_timings.clk_post = in msm_dsi_dphy_timing_calc_v2()
227 temp = 8 * ui + ((timing->clk_prepare << 3) + val_ckln) * ui; in msm_dsi_dphy_timing_calc_v2()
228 temp += (((timing->clk_zero + 3) << 3) + 11 - (pd_ckln << 1)) * ui; in msm_dsi_dphy_timing_calc_v2()
229 temp += hb_en_ckln ? (((timing->hs_rqst_ckln << 3) + 4) * ui) : in msm_dsi_dphy_timing_calc_v2()
230 (((timing->hs_rqst_ckln << 3) + 8) * ui); in msm_dsi_dphy_timing_calc_v2()
235 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc_v2()
236 timing->shared_timings.clk_pre_inc_by_2 = 1; in msm_dsi_dphy_timing_calc_v2()
238 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc_v2()
240 timing->shared_timings.clk_pre_inc_by_2 = 0; in msm_dsi_dphy_timing_calc_v2()
243 timing->ta_go = 3; in msm_dsi_dphy_timing_calc_v2()
244 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc_v2()
245 timing->ta_get = 4; in msm_dsi_dphy_timing_calc_v2()
248 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v2()
249 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc_v2()
250 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v2()
251 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc_v2()
252 timing->hs_rqst, timing->hs_rqst_ckln, timing->hs_halfbyte_en, in msm_dsi_dphy_timing_calc_v2()
253 timing->hs_halfbyte_en_ckln, timing->hs_prep_dly, in msm_dsi_dphy_timing_calc_v2()
254 timing->hs_prep_dly_ckln); in msm_dsi_dphy_timing_calc_v2()
259 int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v3() argument
279 timing->hs_halfbyte_en = 0; in msm_dsi_dphy_timing_calc_v3()
281 timing->hs_halfbyte_en_ckln = 0; in msm_dsi_dphy_timing_calc_v3()
291 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, false); in msm_dsi_dphy_timing_calc_v3()
293 temp = 300 * coeff - (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
296 timing->clk_zero = linear_inter(tmax, tmin, pcnt5, 0, false); in msm_dsi_dphy_timing_calc_v3()
301 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v3()
307 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, false); in msm_dsi_dphy_timing_calc_v3()
309 temp = 145 * coeff + 10 * ui - (timing->hs_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
312 timing->hs_zero = linear_inter(tmax, tmin, pcnt4, 0, false); in msm_dsi_dphy_timing_calc_v3()
317 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v3()
320 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v3()
324 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, false); in msm_dsi_dphy_timing_calc_v3()
327 timing->hs_rqst_ckln = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v3()
332 timing->shared_timings.clk_post = in msm_dsi_dphy_timing_calc_v3()
335 temp = 8 * ui + (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
336 temp += (((timing->clk_zero + 3) << 3) + 11) * ui; in msm_dsi_dphy_timing_calc_v3()
337 temp += hb_en_ckln ? (((timing->hs_rqst_ckln << 3) + 4) * ui) : in msm_dsi_dphy_timing_calc_v3()
338 (((timing->hs_rqst_ckln << 3) + 8) * ui); in msm_dsi_dphy_timing_calc_v3()
343 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc_v3()
344 timing->shared_timings.clk_pre_inc_by_2 = 1; in msm_dsi_dphy_timing_calc_v3()
346 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc_v3()
348 timing->shared_timings.clk_pre_inc_by_2 = 0; in msm_dsi_dphy_timing_calc_v3()
351 timing->ta_go = 3; in msm_dsi_dphy_timing_calc_v3()
352 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc_v3()
353 timing->ta_get = 4; in msm_dsi_dphy_timing_calc_v3()
356 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v3()
357 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc_v3()
358 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v3()
359 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc_v3()
360 timing->hs_rqst, timing->hs_rqst_ckln, timing->hs_halfbyte_en, in msm_dsi_dphy_timing_calc_v3()
361 timing->hs_halfbyte_en_ckln, timing->hs_prep_dly, in msm_dsi_dphy_timing_calc_v3()
362 timing->hs_prep_dly_ckln); in msm_dsi_dphy_timing_calc_v3()
367 int msm_dsi_dphy_timing_calc_v4(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v4() argument
402 timing->clk_prepare = linear_inter(tmax, tmin, pcnt_clk_prep, 0, false); in msm_dsi_dphy_timing_calc_v4()
404 temp = 300 * coeff - (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v4()
407 timing->clk_zero = linear_inter(tmax, tmin, pcnt_clk_zero, 0, false); in msm_dsi_dphy_timing_calc_v4()
412 timing->clk_trail = linear_inter(tmax, tmin, pcnt_clk_trail, 0, false); in msm_dsi_dphy_timing_calc_v4()
418 timing->hs_prepare = linear_inter(tmax, tmin, pcnt_hs_prep, 0, false); in msm_dsi_dphy_timing_calc_v4()
420 temp = 145 * coeff + 10 * ui - (timing->hs_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v4()
423 timing->hs_zero = linear_inter(tmax, tmin, pcnt_hs_zero, 0, false); in msm_dsi_dphy_timing_calc_v4()
428 timing->hs_trail = linear_inter(tmax, tmin, pcnt_hs_trail, 0, false); in msm_dsi_dphy_timing_calc_v4()
431 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v4()
435 timing->hs_exit = linear_inter(tmax, tmin, pcnt_hs_exit, 0, false); in msm_dsi_dphy_timing_calc_v4()
440 temp = 60 * coeff + 52 * ui + + (timing->hs_trail + 1) * ui_x8; in msm_dsi_dphy_timing_calc_v4()
443 timing->shared_timings.clk_post = linear_inter(tmax, tmin, 5, 0, false); in msm_dsi_dphy_timing_calc_v4()
450 temp = 52 * coeff + (timing->clk_prepare + timing->clk_zero + 1) * ui_x8 + 54 * coeff; in msm_dsi_dphy_timing_calc_v4()
453 timing->shared_timings.clk_pre = DIV_ROUND_UP((tmax - tmin) * 125, 10000) + tmin; in msm_dsi_dphy_timing_calc_v4()
456 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v4()
457 timing->clk_zero, timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v4()
458 timing->hs_zero, timing->hs_prepare, timing->hs_trail, timing->hs_rqst); in msm_dsi_dphy_timing_calc_v4()
840 memcpy(shared_timings, &phy->timing.shared_timings, in msm_dsi_phy_get_shared_timings()