diff options
| author | Shawn Guo <shawn.guo@linaro.org> | 2012-04-12 08:50:18 -0400 |
|---|---|---|
| committer | Mike Turquette <mturquette@linaro.org> | 2012-04-24 19:37:40 -0400 |
| commit | 1c0035d710dd3bfa86d58f851b8737c7f11a9bbc (patch) | |
| tree | 37ebd1a44c408aecf7df5331d2b5a32e81818baf /include/linux | |
| parent | 81536e072b54e30bbfd1a9a6b8094f7b3dd5321c (diff) | |
clk: pass parent_rate into .set_rate
For most of .set_rate implementation, parent_rate will be used, so just
like passing parent_rate into .recalc_rate, let's pass parent_rate into
.set_rate too.
It also updates the kernel doc for .set_rate ops.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk-provider.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 3323d24a7be4..cb82918d8fe0 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -88,19 +88,11 @@ struct clk_hw { | |||
| 88 | * array index into the value programmed into the hardware. | 88 | * array index into the value programmed into the hardware. |
| 89 | * Returns 0 on success, -EERROR otherwise. | 89 | * Returns 0 on success, -EERROR otherwise. |
| 90 | * | 90 | * |
| 91 | * @set_rate: Change the rate of this clock. If this callback returns | 91 | * @set_rate: Change the rate of this clock. The requested rate is specified |
| 92 | * CLK_SET_RATE_PARENT, the rate change will be propagated to the | 92 | * by the second argument, which should typically be the return |
| 93 | * parent clock (which may propagate again if the parent clock | 93 | * of .round_rate call. The third argument gives the parent rate |
| 94 | * also sets this flag). The requested rate of the parent is | 94 | * which is likely helpful for most .set_rate implementation. |
| 95 | * passed back from the callback in the second 'unsigned long *' | 95 | * Returns 0 on success, -EERROR otherwise. |
| 96 | * argument. Note that it is up to the hardware clock's set_rate | ||
| 97 | * implementation to insure that clocks do not run out of spec | ||
| 98 | * when propgating the call to set_rate up to the parent. One way | ||
| 99 | * to do this is to gate the clock (via clk_disable and/or | ||
| 100 | * clk_unprepare) before calling clk_set_rate, then ungating it | ||
| 101 | * afterward. If your clock also has the CLK_GATE_SET_RATE flag | ||
| 102 | * set then this will insure safety. Returns 0 on success, | ||
| 103 | * -EERROR otherwise. | ||
| 104 | * | 96 | * |
| 105 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow | 97 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow |
| 106 | * implementations to split any work between atomic (enable) and sleepable | 98 | * implementations to split any work between atomic (enable) and sleepable |
| @@ -125,7 +117,8 @@ struct clk_ops { | |||
| 125 | unsigned long *); | 117 | unsigned long *); |
| 126 | int (*set_parent)(struct clk_hw *hw, u8 index); | 118 | int (*set_parent)(struct clk_hw *hw, u8 index); |
| 127 | u8 (*get_parent)(struct clk_hw *hw); | 119 | u8 (*get_parent)(struct clk_hw *hw); |
| 128 | int (*set_rate)(struct clk_hw *hw, unsigned long); | 120 | int (*set_rate)(struct clk_hw *hw, unsigned long, |
| 121 | unsigned long); | ||
| 129 | void (*init)(struct clk_hw *hw); | 122 | void (*init)(struct clk_hw *hw); |
| 130 | }; | 123 | }; |
| 131 | 124 | ||
