• Home
  • Raw
  • Download

Lines Matching refs:rate

141 	unsigned long rate;  member
183 unsigned long rate) in tegra_emc_find_timing() argument
189 if (emc->timings[i].rate >= rate) { in tegra_emc_find_timing()
196 dev_err(emc->dev, "no timing for rate %lu\n", rate); in tegra_emc_find_timing()
203 static int emc_prepare_timing_change(struct tegra_emc *emc, unsigned long rate) in emc_prepare_timing_change() argument
205 struct emc_timing *timing = tegra_emc_find_timing(emc, rate); in emc_prepare_timing_change()
212 __func__, timing->rate, rate); in emc_prepare_timing_change()
285 u32 rate; in load_one_timing_from_dt() local
293 err = of_property_read_u32(node, "clock-frequency", &rate); in load_one_timing_from_dt()
314 timing->rate = rate * 2 * 1000; in load_one_timing_from_dt()
317 __func__, node, timing->rate); in load_one_timing_from_dt()
327 if (a->rate < b->rate) in cmp_timings()
330 if (a->rate > b->rate) in cmp_timings()
373 emc->timings[0].rate / 1000000, in tegra_emc_load_timings_from_dt()
374 emc->timings[emc->num_timings - 1].rate / 1000000); in tegra_emc_load_timings_from_dt()
445 static long emc_round_rate(unsigned long rate, in emc_round_rate() argument
454 min_rate = min(min_rate, emc->timings[emc->num_timings - 1].rate); in emc_round_rate()
457 if (emc->timings[i].rate < rate && i != emc->num_timings - 1) in emc_round_rate()
460 if (emc->timings[i].rate > max_rate) { in emc_round_rate()
463 if (emc->timings[i].rate < min_rate) in emc_round_rate()
467 if (emc->timings[i].rate < min_rate) in emc_round_rate()
476 rate, min_rate, max_rate); in emc_round_rate()
480 return timing->rate; in emc_round_rate()
508 static bool tegra_emc_validate_rate(struct tegra_emc *emc, unsigned long rate) in tegra_emc_validate_rate() argument
513 if (rate == emc->timings[i].rate) in tegra_emc_validate_rate()
526 seq_printf(s, "%s%lu", prefix, emc->timings[i].rate); in tegra_emc_debug_available_rates_show()
549 static int tegra_emc_debug_min_rate_get(void *data, u64 *rate) in tegra_emc_debug_min_rate_get() argument
553 *rate = emc->debugfs.min_rate; in tegra_emc_debug_min_rate_get()
558 static int tegra_emc_debug_min_rate_set(void *data, u64 rate) in tegra_emc_debug_min_rate_set() argument
563 if (!tegra_emc_validate_rate(emc, rate)) in tegra_emc_debug_min_rate_set()
566 err = clk_set_min_rate(emc->clk, rate); in tegra_emc_debug_min_rate_set()
570 emc->debugfs.min_rate = rate; in tegra_emc_debug_min_rate_set()
579 static int tegra_emc_debug_max_rate_get(void *data, u64 *rate) in tegra_emc_debug_max_rate_get() argument
583 *rate = emc->debugfs.max_rate; in tegra_emc_debug_max_rate_get()
588 static int tegra_emc_debug_max_rate_set(void *data, u64 rate) in tegra_emc_debug_max_rate_set() argument
593 if (!tegra_emc_validate_rate(emc, rate)) in tegra_emc_debug_max_rate_set()
596 err = clk_set_max_rate(emc->clk, rate); in tegra_emc_debug_max_rate_set()
600 emc->debugfs.max_rate = rate; in tegra_emc_debug_max_rate_set()
619 if (emc->timings[i].rate < emc->debugfs.min_rate) in tegra_emc_debugfs_init()
620 emc->debugfs.min_rate = emc->timings[i].rate; in tegra_emc_debugfs_init()
622 if (emc->timings[i].rate > emc->debugfs.max_rate) in tegra_emc_debugfs_init()
623 emc->debugfs.max_rate = emc->timings[i].rate; in tegra_emc_debugfs_init()