Lines Matching refs:rate
28 static int rate_to_idx(struct clk_zx_pll *zx_pll, unsigned long rate) in rate_to_idx() argument
34 if (config[i].rate > rate) in rate_to_idx()
37 if (config[i].rate == rate) in rate_to_idx()
78 return zx_pll->lookup_table[idx].rate; in zx_pll_recalc_rate()
81 static long zx_pll_round_rate(struct clk_hw *hw, unsigned long rate, in zx_pll_round_rate() argument
87 idx = rate_to_idx(zx_pll, rate); in zx_pll_round_rate()
89 return zx_pll->lookup_table[idx].rate; in zx_pll_round_rate()
92 static int zx_pll_set_rate(struct clk_hw *hw, unsigned long rate, in zx_pll_set_rate() argument
100 idx = rate_to_idx(zx_pll, rate); in zx_pll_set_rate()
192 static u32 calc_reg(u32 parent_rate, u32 rate) in calc_reg() argument
197 do_div(tmp64, rate); in calc_reg()
244 static long zx_audio_round_rate(struct clk_hw *hw, unsigned long rate, in zx_audio_round_rate() argument
249 if (rate * 2 > *prate) in zx_audio_round_rate()
252 reg = calc_reg(*prate, rate); in zx_audio_round_rate()
256 static int zx_audio_set_rate(struct clk_hw *hw, unsigned long rate, in zx_audio_set_rate() argument
262 reg = calc_reg(parent_rate, rate); in zx_audio_set_rate()
337 unsigned long rate; member
348 unsigned long rate, m, n; in audio_calc_rate() local
354 rate = (parent_rate * n) / m; in audio_calc_rate()
356 return rate; in audio_calc_rate()
361 unsigned long rate, unsigned long parent_rate) in audio_calc_reg() argument
366 reg_int = parent_rate / rate; in audio_calc_reg()
372 m = parent_rate - rate * reg_int; in audio_calc_reg()
373 n = rate; in audio_calc_reg()
390 div_table->rate = parent_rate * n / (reg_int * n + m); in audio_calc_reg()
407 static long zx_audio_div_round_rate(struct clk_hw *hw, unsigned long rate, in zx_audio_div_round_rate() argument
413 audio_calc_reg(zx_audio_div, &divt, rate, *prate); in zx_audio_div_round_rate()
418 static int zx_audio_div_set_rate(struct clk_hw *hw, unsigned long rate, in zx_audio_div_set_rate() argument
425 audio_calc_reg(zx_audio_div, &divt, rate, parent_rate); in zx_audio_div_set_rate()
426 if (divt.rate != rate) in zx_audio_div_set_rate()
427 pr_debug("the real rate is:%ld", divt.rate); in zx_audio_div_set_rate()