Lines Matching refs:gclk_rate
394 static ulong rockchip_i2s_get_clk(struct rockchip_cru *cru, uint gclk_rate) in rockchip_i2s_get_clk() argument
404 rate = (unsigned long long)gclk_rate * n; in rockchip_i2s_get_clk()
410 static ulong rockchip_i2s_set_clk(struct rockchip_cru *cru, uint gclk_rate, in rockchip_i2s_set_clk() argument
417 v = rockchip_clk_gcd(gclk_rate, freq); in rockchip_i2s_set_clk()
418 n = gclk_rate / v; in rockchip_i2s_set_clk()
420 assert(freq == gclk_rate / n * d); in rockchip_i2s_set_clk()
424 return rockchip_i2s_get_clk(cru, gclk_rate); in rockchip_i2s_set_clk()
577 static ulong rockchip_mmc_get_clk(struct rockchip_cru *cru, uint gclk_rate, in rockchip_mmc_get_clk() argument
607 src_rate = mux == EMMC_PLL_SELECT_24MHZ ? OSC_HZ : gclk_rate; in rockchip_mmc_get_clk()
611 static ulong rockchip_mmc_set_clk(struct rockchip_cru *cru, uint gclk_rate, in rockchip_mmc_set_clk() argument
617 debug("%s: gclk_rate=%u\n", __func__, gclk_rate); in rockchip_mmc_set_clk()
619 src_clk_div = DIV_ROUND_UP(gclk_rate / 2, freq); in rockchip_mmc_set_clk()
658 return rockchip_mmc_get_clk(cru, gclk_rate, periph); in rockchip_mmc_set_clk()
661 static ulong rockchip_spi_get_clk(struct rockchip_cru *cru, uint gclk_rate, in rockchip_spi_get_clk() argument
688 return DIV_TO_RATE(gclk_rate, div); in rockchip_spi_get_clk()
691 static ulong rockchip_spi_set_clk(struct rockchip_cru *cru, uint gclk_rate, in rockchip_spi_set_clk() argument
696 debug("%s: clk_general_rate=%u\n", __func__, gclk_rate); in rockchip_spi_set_clk()
697 src_clk_div = DIV_ROUND_UP(gclk_rate, freq) - 1; in rockchip_spi_set_clk()
722 return rockchip_spi_get_clk(cru, gclk_rate, periph); in rockchip_spi_set_clk()
753 ulong new_rate, gclk_rate; in rk3288_clk_get_rate() local
755 gclk_rate = rkclk_pll_get_rate(priv->cru, CLK_GENERAL); in rk3288_clk_get_rate()
766 new_rate = rockchip_mmc_get_clk(priv->cru, gclk_rate, clk->id); in rk3288_clk_get_rate()
771 new_rate = rockchip_spi_get_clk(priv->cru, gclk_rate, clk->id); in rk3288_clk_get_rate()
779 return gclk_rate; in rk3288_clk_get_rate()
796 ulong new_rate, gclk_rate; in rk3288_clk_set_rate() local
798 gclk_rate = rkclk_pll_get_rate(priv->cru, CLK_GENERAL); in rk3288_clk_set_rate()
816 new_rate = rockchip_mmc_set_clk(cru, gclk_rate, clk->id, rate); in rk3288_clk_set_rate()
821 new_rate = rockchip_spi_set_clk(cru, gclk_rate, clk->id, rate); in rk3288_clk_set_rate()
825 new_rate = rockchip_i2s_set_clk(cru, gclk_rate, rate); in rk3288_clk_set_rate()