Lines Matching full:timing

47  * When we change the timing to a timing with a parent that has the same
49 * timing that has a different clock source.
116 struct emc_timing *timing = NULL; in emc_determine_rate() local
132 timing = tegra->timings + i; in emc_determine_rate()
134 if (timing->rate < req->rate && i != t - 1) in emc_determine_rate()
137 if (timing->rate > req->max_rate) { in emc_determine_rate()
143 if (timing->rate < req->min_rate) in emc_determine_rate()
146 req->rate = timing->rate; in emc_determine_rate()
150 if (timing) { in emc_determine_rate()
151 req->rate = timing->rate; in emc_determine_rate()
202 struct emc_timing *timing) in emc_set_timing() argument
213 pr_debug("going to rate %ld prate %ld p %s\n", timing->rate, in emc_set_timing()
214 timing->parent_rate, __clk_get_name(timing->parent)); in emc_set_timing()
216 if (emc_get_parent(&tegra->hw) == timing->parent_index && in emc_set_timing()
217 clk_get_rate(timing->parent) != timing->parent_rate) { in emc_set_timing()
219 __clk_get_name(timing->parent), in emc_set_timing()
220 clk_get_rate(timing->parent), in emc_set_timing()
221 timing->parent_rate); in emc_set_timing()
227 err = clk_set_rate(timing->parent, timing->parent_rate); in emc_set_timing()
230 __clk_get_name(timing->parent), timing->parent_rate, in emc_set_timing()
236 err = clk_prepare_enable(timing->parent); in emc_set_timing()
242 div = timing->parent_rate / (timing->rate / 2) - 2; in emc_set_timing()
244 err = tegra_emc_prepare_timing_change(emc, timing->rate); in emc_set_timing()
253 car_value |= CLK_SOURCE_EMC_EMC_2X_CLK_SRC(timing->parent_index); in emc_set_timing()
262 tegra_emc_complete_timing_change(emc, timing->rate); in emc_set_timing()
264 clk_hw_reparent(&tegra->hw, __clk_get_hw(timing->parent)); in emc_set_timing()
267 tegra->prev_parent = timing->parent; in emc_set_timing()
274 * Get backup timing to use as an intermediate step when a change between
276 * find a timing with a higher clock rate to avoid a rate below any set rate
284 struct emc_timing *timing; in get_backup_timing() local
287 timing = tegra->timings + i; in get_backup_timing()
288 if (timing->ram_code != ram_code) in get_backup_timing()
291 if (emc_parent_clk_sources[timing->parent_index] != in get_backup_timing()
294 return timing; in get_backup_timing()
298 timing = tegra->timings + i; in get_backup_timing()
299 if (timing->ram_code != ram_code) in get_backup_timing()
302 if (emc_parent_clk_sources[timing->parent_index] != in get_backup_timing()
305 return timing; in get_backup_timing()
315 struct emc_timing *timing = NULL; in emc_set_rate() local
335 timing = tegra->timings + i; in emc_set_rate()
340 if (!timing) { in emc_set_rate()
346 emc_parent_clk_sources[timing->parent_index] && in emc_set_rate()
347 clk_get_rate(timing->parent) != timing->parent_rate) { in emc_set_rate()
357 pr_err("cannot find backup timing\n"); in emc_set_rate()
366 pr_err("cannot set backup timing: %d\n", err); in emc_set_rate()
371 return emc_set_timing(tegra, timing); in emc_set_rate()
377 struct emc_timing *timing, in load_one_timing_from_dt() argument
385 pr_err("timing %pOF: failed to read rate\n", node); in load_one_timing_from_dt()
389 timing->rate = tmp; in load_one_timing_from_dt()
393 pr_err("timing %pOF: failed to read parent rate\n", node); in load_one_timing_from_dt()
397 timing->parent_rate = tmp; in load_one_timing_from_dt()
399 timing->parent = of_clk_get_by_name(node, "emc-parent"); in load_one_timing_from_dt()
400 if (IS_ERR(timing->parent)) { in load_one_timing_from_dt()
401 pr_err("timing %pOF: failed to get parent clock\n", node); in load_one_timing_from_dt()
402 return PTR_ERR(timing->parent); in load_one_timing_from_dt()
405 timing->parent_index = 0xff; in load_one_timing_from_dt()
407 __clk_get_name(timing->parent)); in load_one_timing_from_dt()
409 pr_err("timing %pOF: %s is not a valid parent\n", in load_one_timing_from_dt()
410 node, __clk_get_name(timing->parent)); in load_one_timing_from_dt()
411 clk_put(timing->parent); in load_one_timing_from_dt()
415 timing->parent_index = i; in load_one_timing_from_dt()
452 struct emc_timing *timing = timings_ptr + (i++); in load_timings_from_dt() local
454 err = load_one_timing_from_dt(tegra, timing, child); in load_timings_from_dt()
460 timing->ram_code = ram_code; in load_timings_from_dt()