Lines Matching full:timing
28 static void dsi_dphy_timing_calc_clk_zero(struct msm_dsi_dphy_timing *timing, in dsi_dphy_timing_calc_clk_zero() argument
35 temp = 300 * coeff - ((timing->clk_prepare >> 1) + 1) * 2 * ui; in dsi_dphy_timing_calc_clk_zero()
46 temp = (timing->hs_rqst + timing->clk_prepare + clk_z) & 0x7; in dsi_dphy_timing_calc_clk_zero()
47 timing->clk_zero = clk_z + 8 - temp; in dsi_dphy_timing_calc_clk_zero()
50 int msm_dsi_dphy_timing_calc(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc() argument
72 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, true); in msm_dsi_dphy_timing_calc()
76 timing->hs_rqst = temp; in msm_dsi_dphy_timing_calc()
78 timing->hs_rqst = max_t(s32, 0, temp - 2); in msm_dsi_dphy_timing_calc()
81 dsi_dphy_timing_calc_clk_zero(timing, ui, coeff, pcnt2); in msm_dsi_dphy_timing_calc()
86 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, true); in msm_dsi_dphy_timing_calc()
92 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, true); in msm_dsi_dphy_timing_calc()
95 temp = ((timing->hs_prepare >> 1) + 1) * 2 * ui + 2 * ui; in msm_dsi_dphy_timing_calc()
98 timing->hs_zero = linear_inter(tmax, tmin, pcnt2, 24, true); in msm_dsi_dphy_timing_calc()
104 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, true); in msm_dsi_dphy_timing_calc()
108 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, true); in msm_dsi_dphy_timing_calc()
111 temp = ((timing->hs_exit >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
114 timing->shared_timings.clk_post = linear_inter(tmax, tmin, pcnt2, 0, in msm_dsi_dphy_timing_calc()
117 temp = ((timing->clk_prepare >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
118 temp += ((timing->clk_zero >> 1) + 1) * 2 * ui; in msm_dsi_dphy_timing_calc()
123 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc()
124 timing->shared_timings.clk_pre_inc_by_2 = true; in msm_dsi_dphy_timing_calc()
126 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc()
128 timing->shared_timings.clk_pre_inc_by_2 = false; in msm_dsi_dphy_timing_calc()
131 timing->ta_go = 3; in msm_dsi_dphy_timing_calc()
132 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc()
133 timing->ta_get = 4; in msm_dsi_dphy_timing_calc()
136 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc()
137 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc()
138 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc()
139 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc()
140 timing->hs_rqst); in msm_dsi_dphy_timing_calc()
145 int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v2() argument
166 timing->hs_halfbyte_en = 0; in msm_dsi_dphy_timing_calc_v2()
168 timing->hs_halfbyte_en_ckln = 0; in msm_dsi_dphy_timing_calc_v2()
170 timing->hs_prep_dly_ckln = (bit_rate > 100000000) ? 0 : 3; in msm_dsi_dphy_timing_calc_v2()
171 pd_ckln = timing->hs_prep_dly_ckln; in msm_dsi_dphy_timing_calc_v2()
172 timing->hs_prep_dly = (bit_rate > 120000000) ? 0 : 1; in msm_dsi_dphy_timing_calc_v2()
173 pd = timing->hs_prep_dly; in msm_dsi_dphy_timing_calc_v2()
185 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, false); in msm_dsi_dphy_timing_calc_v2()
187 temp = 300 * coeff - ((timing->clk_prepare << 3) + val_ckln) * ui; in msm_dsi_dphy_timing_calc_v2()
190 timing->clk_zero = linear_inter(tmax, tmin, pcnt5, 0, false); in msm_dsi_dphy_timing_calc_v2()
195 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v2()
201 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, false); in msm_dsi_dphy_timing_calc_v2()
203 temp = 145 * coeff + 10 * ui - ((timing->hs_prepare << 3) + val) * ui; in msm_dsi_dphy_timing_calc_v2()
206 timing->hs_zero = linear_inter(tmax, tmin, pcnt4, 0, false); in msm_dsi_dphy_timing_calc_v2()
211 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v2()
214 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v2()
218 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, false); in msm_dsi_dphy_timing_calc_v2()
221 timing->hs_rqst_ckln = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v2()
226 timing->shared_timings.clk_post = in msm_dsi_dphy_timing_calc_v2()
229 temp = 8 * ui + ((timing->clk_prepare << 3) + val_ckln) * ui; in msm_dsi_dphy_timing_calc_v2()
230 temp += (((timing->clk_zero + 3) << 3) + 11 - (pd_ckln << 1)) * ui; in msm_dsi_dphy_timing_calc_v2()
231 temp += hb_en_ckln ? (((timing->hs_rqst_ckln << 3) + 4) * ui) : in msm_dsi_dphy_timing_calc_v2()
232 (((timing->hs_rqst_ckln << 3) + 8) * ui); in msm_dsi_dphy_timing_calc_v2()
237 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc_v2()
238 timing->shared_timings.clk_pre_inc_by_2 = 1; in msm_dsi_dphy_timing_calc_v2()
240 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc_v2()
242 timing->shared_timings.clk_pre_inc_by_2 = 0; in msm_dsi_dphy_timing_calc_v2()
245 timing->ta_go = 3; in msm_dsi_dphy_timing_calc_v2()
246 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc_v2()
247 timing->ta_get = 4; in msm_dsi_dphy_timing_calc_v2()
250 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v2()
251 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc_v2()
252 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v2()
253 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc_v2()
254 timing->hs_rqst, timing->hs_rqst_ckln, timing->hs_halfbyte_en, in msm_dsi_dphy_timing_calc_v2()
255 timing->hs_halfbyte_en_ckln, timing->hs_prep_dly, in msm_dsi_dphy_timing_calc_v2()
256 timing->hs_prep_dly_ckln); in msm_dsi_dphy_timing_calc_v2()
261 int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v3() argument
281 timing->hs_halfbyte_en = 0; in msm_dsi_dphy_timing_calc_v3()
283 timing->hs_halfbyte_en_ckln = 0; in msm_dsi_dphy_timing_calc_v3()
293 timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, false); in msm_dsi_dphy_timing_calc_v3()
295 temp = 300 * coeff - (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
298 timing->clk_zero = linear_inter(tmax, tmin, pcnt5, 0, false); in msm_dsi_dphy_timing_calc_v3()
303 timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v3()
309 timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, false); in msm_dsi_dphy_timing_calc_v3()
311 temp = 145 * coeff + 10 * ui - (timing->hs_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
314 timing->hs_zero = linear_inter(tmax, tmin, pcnt4, 0, false); in msm_dsi_dphy_timing_calc_v3()
319 timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, false); in msm_dsi_dphy_timing_calc_v3()
322 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v3()
326 timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, false); in msm_dsi_dphy_timing_calc_v3()
329 timing->hs_rqst_ckln = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v3()
334 timing->shared_timings.clk_post = in msm_dsi_dphy_timing_calc_v3()
337 temp = 8 * ui + (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v3()
338 temp += (((timing->clk_zero + 3) << 3) + 11) * ui; in msm_dsi_dphy_timing_calc_v3()
339 temp += hb_en_ckln ? (((timing->hs_rqst_ckln << 3) + 4) * ui) : in msm_dsi_dphy_timing_calc_v3()
340 (((timing->hs_rqst_ckln << 3) + 8) * ui); in msm_dsi_dphy_timing_calc_v3()
345 timing->shared_timings.clk_pre = temp >> 1; in msm_dsi_dphy_timing_calc_v3()
346 timing->shared_timings.clk_pre_inc_by_2 = 1; in msm_dsi_dphy_timing_calc_v3()
348 timing->shared_timings.clk_pre = in msm_dsi_dphy_timing_calc_v3()
350 timing->shared_timings.clk_pre_inc_by_2 = 0; in msm_dsi_dphy_timing_calc_v3()
353 timing->shared_timings.byte_intf_clk_div_2 = true; in msm_dsi_dphy_timing_calc_v3()
355 timing->ta_go = 3; in msm_dsi_dphy_timing_calc_v3()
356 timing->ta_sure = 0; in msm_dsi_dphy_timing_calc_v3()
357 timing->ta_get = 4; in msm_dsi_dphy_timing_calc_v3()
360 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v3()
361 timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero, in msm_dsi_dphy_timing_calc_v3()
362 timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v3()
363 timing->hs_zero, timing->hs_prepare, timing->hs_trail, in msm_dsi_dphy_timing_calc_v3()
364 timing->hs_rqst, timing->hs_rqst_ckln, timing->hs_halfbyte_en, in msm_dsi_dphy_timing_calc_v3()
365 timing->hs_halfbyte_en_ckln, timing->hs_prep_dly, in msm_dsi_dphy_timing_calc_v3()
366 timing->hs_prep_dly_ckln); in msm_dsi_dphy_timing_calc_v3()
371 int msm_dsi_dphy_timing_calc_v4(struct msm_dsi_dphy_timing *timing, in msm_dsi_dphy_timing_calc_v4() argument
406 timing->clk_prepare = linear_inter(tmax, tmin, pcnt_clk_prep, 0, false); in msm_dsi_dphy_timing_calc_v4()
408 temp = 300 * coeff - (timing->clk_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v4()
411 timing->clk_zero = linear_inter(tmax, tmin, pcnt_clk_zero, 0, false); in msm_dsi_dphy_timing_calc_v4()
416 timing->clk_trail = linear_inter(tmax, tmin, pcnt_clk_trail, 0, false); in msm_dsi_dphy_timing_calc_v4()
422 timing->hs_prepare = linear_inter(tmax, tmin, pcnt_hs_prep, 0, false); in msm_dsi_dphy_timing_calc_v4()
424 temp = 145 * coeff + 10 * ui - (timing->hs_prepare << 3) * ui; in msm_dsi_dphy_timing_calc_v4()
427 timing->hs_zero = linear_inter(tmax, tmin, pcnt_hs_zero, 0, false); in msm_dsi_dphy_timing_calc_v4()
432 timing->hs_trail = linear_inter(tmax, tmin, pcnt_hs_trail, 0, false); in msm_dsi_dphy_timing_calc_v4()
435 timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8); in msm_dsi_dphy_timing_calc_v4()
439 timing->hs_exit = linear_inter(tmax, tmin, pcnt_hs_exit, 0, false); in msm_dsi_dphy_timing_calc_v4()
444 temp = 60 * coeff + 52 * ui + + (timing->hs_trail + 1) * ui_x8; in msm_dsi_dphy_timing_calc_v4()
447 timing->shared_timings.clk_post = linear_inter(tmax, tmin, 5, 0, false); in msm_dsi_dphy_timing_calc_v4()
454 temp = 52 * coeff + (timing->clk_prepare + timing->clk_zero + 1) * ui_x8 + 54 * coeff; in msm_dsi_dphy_timing_calc_v4()
457 timing->shared_timings.clk_pre = DIV_ROUND_UP((tmax - tmin) * 125, 10000) + tmin; in msm_dsi_dphy_timing_calc_v4()
459 timing->shared_timings.byte_intf_clk_div_2 = true; in msm_dsi_dphy_timing_calc_v4()
462 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_dphy_timing_calc_v4()
463 timing->clk_zero, timing->clk_trail, timing->clk_prepare, timing->hs_exit, in msm_dsi_dphy_timing_calc_v4()
464 timing->hs_zero, timing->hs_prepare, timing->hs_trail, timing->hs_rqst); in msm_dsi_dphy_timing_calc_v4()
469 int msm_dsi_cphy_timing_calc_v4(struct msm_dsi_dphy_timing *timing, in msm_dsi_cphy_timing_calc_v4() argument
489 timing->clk_prepare = linear_inter(tmax, tmin, 50, 0, false); in msm_dsi_cphy_timing_calc_v4()
493 timing->hs_rqst = linear_inter(tmax, tmin, 1, 0, false); in msm_dsi_cphy_timing_calc_v4()
497 timing->hs_exit = linear_inter(tmax, tmin, 10, 0, false); in msm_dsi_cphy_timing_calc_v4()
501 timing->shared_timings.clk_post = linear_inter(tmax, tmin, 80, 0, false); in msm_dsi_cphy_timing_calc_v4()
505 timing->shared_timings.clk_pre = linear_inter(tmax, tmin, 20, 0, false); in msm_dsi_cphy_timing_calc_v4()
508 timing->shared_timings.clk_pre, timing->shared_timings.clk_post, in msm_dsi_cphy_timing_calc_v4()
509 timing->clk_prepare, timing->hs_exit, timing->hs_rqst); in msm_dsi_cphy_timing_calc_v4()
779 memcpy(shared_timings, &phy->timing.shared_timings, in msm_dsi_phy_enable()