X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=arch%2Fmips%2Flantiq%2Fclk.c;h=a0706fd4ce0a0f0b3e9a531b31692fd6e1c0342f;hb=62c6d28736e646fcaba8a8882e114ecbfe86123a;hp=3fc2e6d70c7798f98c6b65b26e8a4f3e024584b2;hpb=047dff63f913c21c5228b94118e7996ab998cdc4;p=karo-tx-linux.git diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c index 3fc2e6d70c77..a0706fd4ce0a 100644 --- a/arch/mips/lantiq/clk.c +++ b/arch/mips/lantiq/clk.c @@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL(clk_set_rate); +long clk_round_rate(struct clk *clk, unsigned long rate) +{ + if (unlikely(!clk_good(clk))) + return 0; + if (clk->rates && *clk->rates) { + unsigned long *r = clk->rates; + + while (*r && (*r != rate)) + r++; + if (!*r) { + return clk->rate; + } + } + return rate; +} +EXPORT_SYMBOL(clk_round_rate); + int clk_enable(struct clk *clk) { if (unlikely(!clk_good(clk)))