Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'common/clkfwk' into sh-fixes-for-linus

+11 -85
-4
Documentation/DocBook/sh.tmpl
··· 79 79 </sect2> 80 80 </sect1> 81 81 </chapter> 82 - <chapter id="clk"> 83 - <title>Clock Framework Extensions</title> 84 - !Iinclude/linux/sh_clk.h 85 - </chapter> 86 82 <chapter id="mach"> 87 83 <title>Machine Specific Interfaces</title> 88 84 <sect1 id="dreamcast">
-32
Documentation/sh/clk.txt
··· 1 - Clock framework on SuperH architecture 2 - 3 - The framework on SH extends existing API by the function clk_set_rate_ex, 4 - which prototype is as follows: 5 - 6 - clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id) 7 - 8 - The algo_id parameter is used to specify algorithm used to recalculate clocks, 9 - adjanced to clock, specified as first argument. It is assumed that algo_id==0 10 - means no changes to adjanced clock 11 - 12 - Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, 13 - if it is present in ops structure. The method should set the clock rate and adjust 14 - all needed clocks according to the passed algo_id. 15 - Exact values for algo_id are machine-dependent. For the sh7722, the following 16 - values are defined: 17 - 18 - NO_CHANGE = 0, 19 - IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */ 20 - IUS_322, /* I:U:Sh = 3:2:2 */ 21 - IUS_522, /* I:U:Sh = 5:2:2 */ 22 - IUS_N11, /* I:U:Sh = N:1:1 */ 23 - SB_N1, /* Sh:B = N:1 */ 24 - SB3_N1, /* Sh:B3 = N:1 */ 25 - SB3_32, /* Sh:B3 = 3:2 */ 26 - SB3_43, /* Sh:B3 = 4:3 */ 27 - SB3_54, /* Sh:B3 = 5:4 */ 28 - BP_N1, /* B:P = N:1 */ 29 - IP_N1 /* I:P = N:1 */ 30 - 31 - Each of these constants means relation between clocks that can be set via the FRQCR 32 - register
+2 -4
arch/arm/mach-shmobile/clock-sh7372.c
··· 220 220 __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR); 221 221 } 222 222 223 - static int pllc2_set_rate(struct clk *clk, 224 - unsigned long rate, int algo_id) 223 + static int pllc2_set_rate(struct clk *clk, unsigned long rate) 225 224 { 226 225 unsigned long value; 227 226 int idx; ··· 462 463 return 0; 463 464 } 464 465 465 - static int fsidiv_set_rate(struct clk *clk, 466 - unsigned long rate, int algo_id) 466 + static int fsidiv_set_rate(struct clk *clk, unsigned long rate) 467 467 { 468 468 int idx; 469 469
+1 -1
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
··· 110 110 return 0; 111 111 } 112 112 113 - static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id) 113 + static int shoc_clk_set_rate(struct clk *clk, unsigned long rate) 114 114 { 115 115 unsigned long frqcr3; 116 116 unsigned int tmp;
+3 -10
drivers/sh/clk/core.c
··· 455 455 456 456 int clk_set_rate(struct clk *clk, unsigned long rate) 457 457 { 458 - return clk_set_rate_ex(clk, rate, 0); 459 - } 460 - EXPORT_SYMBOL_GPL(clk_set_rate); 461 - 462 - int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) 463 - { 464 458 int ret = -EOPNOTSUPP; 465 459 unsigned long flags; 466 460 467 461 spin_lock_irqsave(&clock_lock, flags); 468 462 469 463 if (likely(clk->ops && clk->ops->set_rate)) { 470 - ret = clk->ops->set_rate(clk, rate, algo_id); 464 + ret = clk->ops->set_rate(clk, rate); 471 465 if (ret != 0) 472 466 goto out_unlock; 473 467 } else { ··· 479 485 480 486 return ret; 481 487 } 482 - EXPORT_SYMBOL_GPL(clk_set_rate_ex); 488 + EXPORT_SYMBOL_GPL(clk_set_rate); 483 489 484 490 int clk_set_parent(struct clk *clk, struct clk *parent) 485 491 { ··· 647 653 clkp->ops->set_parent(clkp, 648 654 clkp->parent); 649 655 if (likely(clkp->ops->set_rate)) 650 - clkp->ops->set_rate(clkp, 651 - rate, NO_CHANGE); 656 + clkp->ops->set_rate(clkp, rate); 652 657 else if (likely(clkp->ops->recalc)) 653 658 clkp->rate = clkp->ops->recalc(clkp); 654 659 }
+2 -3
drivers/sh/clk/cpg.c
··· 110 110 return 0; 111 111 } 112 112 113 - static int sh_clk_div6_set_rate(struct clk *clk, 114 - unsigned long rate, int algo_id) 113 + static int sh_clk_div6_set_rate(struct clk *clk, unsigned long rate) 115 114 { 116 115 unsigned long value; 117 116 int idx; ··· 252 253 return 0; 253 254 } 254 255 255 - static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate, int algo_id) 256 + static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate) 256 257 { 257 258 struct clk_div4_table *d4t = clk->priv; 258 259 unsigned long value;
+3 -31
include/linux/sh_clk.h
··· 19 19 }; 20 20 21 21 struct clk_ops { 22 + #ifdef CONFIG_SH_CLK_CPG_LEGACY 22 23 void (*init)(struct clk *clk); 24 + #endif 23 25 int (*enable)(struct clk *clk); 24 26 void (*disable)(struct clk *clk); 25 27 unsigned long (*recalc)(struct clk *clk); 26 - int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 28 + int (*set_rate)(struct clk *clk, unsigned long rate); 27 29 int (*set_parent)(struct clk *clk, struct clk *parent); 28 30 long (*round_rate)(struct clk *clk, unsigned long rate); 29 31 }; ··· 68 66 int clk_register(struct clk *); 69 67 void clk_unregister(struct clk *); 70 68 void clk_enable_init_clocks(void); 71 - 72 - /** 73 - * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter 74 - * @clk: clock source 75 - * @rate: desired clock rate in Hz 76 - * @algo_id: algorithm id to be passed down to ops->set_rate 77 - * 78 - * Returns success (0) or negative errno. 79 - */ 80 - int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id); 81 - 82 - enum clk_sh_algo_id { 83 - NO_CHANGE = 0, 84 - 85 - IUS_N1_N1, 86 - IUS_322, 87 - IUS_522, 88 - IUS_N11, 89 - 90 - SB_N1, 91 - 92 - SB3_N1, 93 - SB3_32, 94 - SB3_43, 95 - SB3_54, 96 - 97 - BP_N1, 98 - 99 - IP_N1, 100 - }; 101 69 102 70 struct clk_div_mult_table { 103 71 unsigned int *divisors;