• Home
  • Raw
  • Download

Lines Matching refs:rate

32 	unsigned long	rate;  member
39 int (*set_rate)(struct clk *clk, unsigned long rate);
45 static int set_keytchclk_rate(struct clk *clk, unsigned long rate);
46 static int set_div_rate(struct clk *clk, unsigned long rate);
47 static int set_i2s_sclk_rate(struct clk *clk, unsigned long rate);
48 static int set_i2s_lrclk_rate(struct clk *clk, unsigned long rate);
51 .rate = EP93XX_EXT_CLK_RATE,
103 .rate = EP93XX_EXT_CLK_RATE,
107 .rate = EP93XX_EXT_CLK_RATE,
307 unsigned long rate = clk_get_rate(clk->parent); in get_uart_rate() local
312 return rate; in get_uart_rate()
314 return rate / 2; in get_uart_rate()
322 return clk->rate; in clk_get_rate()
326 static int set_keytchclk_rate(struct clk *clk, unsigned long rate) in set_keytchclk_rate() argument
342 if (rate == EP93XX_KEYTCHCLK_DIV4) in set_keytchclk_rate()
344 else if (rate == EP93XX_KEYTCHCLK_DIV16) in set_keytchclk_rate()
350 clk->rate = rate; in set_keytchclk_rate()
354 static int calc_clk_div(struct clk *clk, unsigned long rate, in calc_clk_div() argument
362 max_rate = max3(clk_pll1.rate / 4, clk_pll2.rate / 4, clk_xtali.rate / 4); in calc_clk_div()
363 rate = min(rate, max_rate); in calc_clk_div()
381 mclk_rate = mclk->rate * 2; in calc_clk_div()
385 __div = mclk_rate / (rate * __pdiv); in calc_clk_div()
391 if (!found || abs(actual_rate - rate) < rate_err) { in calc_clk_div()
397 clk->rate = actual_rate; in calc_clk_div()
398 rate_err = abs(actual_rate - rate); in calc_clk_div()
410 static int set_div_rate(struct clk *clk, unsigned long rate) in set_div_rate() argument
415 err = calc_clk_div(clk, rate, &psel, &esel, &pdiv, &div); in set_div_rate()
431 static int set_i2s_sclk_rate(struct clk *clk, unsigned long rate) in set_i2s_sclk_rate() argument
435 if (rate == clk_i2s_mclk.rate / 2) in set_i2s_sclk_rate()
438 else if (rate == clk_i2s_mclk.rate / 4) in set_i2s_sclk_rate()
444 clk_i2s_sclk.rate = rate; in set_i2s_sclk_rate()
448 static int set_i2s_lrclk_rate(struct clk *clk, unsigned long rate) in set_i2s_lrclk_rate() argument
453 if (rate == clk_i2s_sclk.rate / 32) in set_i2s_lrclk_rate()
456 else if (rate == clk_i2s_sclk.rate / 64) in set_i2s_lrclk_rate()
459 else if (rate == clk_i2s_sclk.rate / 128) in set_i2s_lrclk_rate()
465 clk_i2s_lrclk.rate = rate; in set_i2s_lrclk_rate()
469 int clk_set_rate(struct clk *clk, unsigned long rate) in clk_set_rate() argument
472 return clk->set_rate(clk, rate); in clk_set_rate()
488 unsigned long long rate; in calc_pll_rate() local
491 rate = clk_xtali.rate; in calc_pll_rate()
492 rate *= ((config_word >> 11) & 0x1f) + 1; /* X1FBD */ in calc_pll_rate()
493 rate *= ((config_word >> 5) & 0x3f) + 1; /* X2FBD */ in calc_pll_rate()
494 do_div(rate, (config_word & 0x1f) + 1); /* X2IPD */ in calc_pll_rate()
496 rate >>= 1; in calc_pll_rate()
498 return (unsigned long)rate; in calc_pll_rate()
503 clk_m2p0.rate = clk_h.rate; in ep93xx_dma_clock_init()
504 clk_m2p1.rate = clk_h.rate; in ep93xx_dma_clock_init()
505 clk_m2p2.rate = clk_h.rate; in ep93xx_dma_clock_init()
506 clk_m2p3.rate = clk_h.rate; in ep93xx_dma_clock_init()
507 clk_m2p4.rate = clk_h.rate; in ep93xx_dma_clock_init()
508 clk_m2p5.rate = clk_h.rate; in ep93xx_dma_clock_init()
509 clk_m2p6.rate = clk_h.rate; in ep93xx_dma_clock_init()
510 clk_m2p7.rate = clk_h.rate; in ep93xx_dma_clock_init()
511 clk_m2p8.rate = clk_h.rate; in ep93xx_dma_clock_init()
512 clk_m2p9.rate = clk_h.rate; in ep93xx_dma_clock_init()
513 clk_m2m0.rate = clk_h.rate; in ep93xx_dma_clock_init()
514 clk_m2m1.rate = clk_h.rate; in ep93xx_dma_clock_init()
524 clk_pll1.rate = clk_xtali.rate; in ep93xx_clock_init()
526 clk_pll1.rate = calc_pll_rate(value); in ep93xx_clock_init()
529 clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; in ep93xx_clock_init()
530 clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; in ep93xx_clock_init()
531 clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; in ep93xx_clock_init()
537 clk_pll2.rate = clk_xtali.rate; in ep93xx_clock_init()
539 clk_pll2.rate = calc_pll_rate(value); in ep93xx_clock_init()
541 clk_pll2.rate = 0; in ep93xx_clock_init()
544 clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); in ep93xx_clock_init()
552 clk_spi.rate /= 2; in ep93xx_clock_init()
555 clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); in ep93xx_clock_init()
557 clk_f.rate / 1000000, clk_h.rate / 1000000, in ep93xx_clock_init()
558 clk_p.rate / 1000000); in ep93xx_clock_init()