diff options
Diffstat (limited to 'include/linux/clk-provider.h')
| -rw-r--r-- | include/linux/clk-provider.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b7cfa037e593..08b1aa70a38d 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | #define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */ | 38 | #define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */ |
| 39 | /* parents need enable during gate/ungate, set rate and re-parent */ | 39 | /* parents need enable during gate/ungate, set rate and re-parent */ |
| 40 | #define CLK_OPS_PARENT_ENABLE BIT(12) | 40 | #define CLK_OPS_PARENT_ENABLE BIT(12) |
| 41 | /* duty cycle call may be forwarded to the parent clock */ | ||
| 42 | #define CLK_DUTY_CYCLE_PARENT BIT(13) | ||
| 41 | 43 | ||
| 42 | struct clk; | 44 | struct clk; |
| 43 | struct clk_hw; | 45 | struct clk_hw; |
| @@ -67,6 +69,17 @@ struct clk_rate_request { | |||
| 67 | }; | 69 | }; |
| 68 | 70 | ||
| 69 | /** | 71 | /** |
| 72 | * struct clk_duty - Struture encoding the duty cycle ratio of a clock | ||
| 73 | * | ||
| 74 | * @num: Numerator of the duty cycle ratio | ||
| 75 | * @den: Denominator of the duty cycle ratio | ||
| 76 | */ | ||
| 77 | struct clk_duty { | ||
| 78 | unsigned int num; | ||
| 79 | unsigned int den; | ||
| 80 | }; | ||
| 81 | |||
| 82 | /** | ||
| 70 | * struct clk_ops - Callback operations for hardware clocks; these are to | 83 | * struct clk_ops - Callback operations for hardware clocks; these are to |
| 71 | * be provided by the clock implementation, and will be called by drivers | 84 | * be provided by the clock implementation, and will be called by drivers |
| 72 | * through the clk_* api. | 85 | * through the clk_* api. |
| @@ -169,6 +182,15 @@ struct clk_rate_request { | |||
| 169 | * by the second argument. Valid values for degrees are | 182 | * by the second argument. Valid values for degrees are |
| 170 | * 0-359. Return 0 on success, otherwise -EERROR. | 183 | * 0-359. Return 0 on success, otherwise -EERROR. |
| 171 | * | 184 | * |
| 185 | * @get_duty_cycle: Queries the hardware to get the current duty cycle ratio | ||
| 186 | * of a clock. Returned values denominator cannot be 0 and must be | ||
| 187 | * superior or equal to the numerator. | ||
| 188 | * | ||
| 189 | * @set_duty_cycle: Apply the duty cycle ratio to this clock signal specified by | ||
| 190 | * the numerator (2nd argurment) and denominator (3rd argument). | ||
| 191 | * Argument must be a valid ratio (denominator > 0 | ||
| 192 | * and >= numerator) Return 0 on success, otherwise -EERROR. | ||
| 193 | * | ||
| 172 | * @init: Perform platform-specific initialization magic. | 194 | * @init: Perform platform-specific initialization magic. |
| 173 | * This is not not used by any of the basic clock types. | 195 | * This is not not used by any of the basic clock types. |
| 174 | * Please consider other ways of solving initialization problems | 196 | * Please consider other ways of solving initialization problems |
| @@ -218,6 +240,10 @@ struct clk_ops { | |||
| 218 | unsigned long parent_accuracy); | 240 | unsigned long parent_accuracy); |
| 219 | int (*get_phase)(struct clk_hw *hw); | 241 | int (*get_phase)(struct clk_hw *hw); |
| 220 | int (*set_phase)(struct clk_hw *hw, int degrees); | 242 | int (*set_phase)(struct clk_hw *hw, int degrees); |
| 243 | int (*get_duty_cycle)(struct clk_hw *hw, | ||
| 244 | struct clk_duty *duty); | ||
| 245 | int (*set_duty_cycle)(struct clk_hw *hw, | ||
| 246 | struct clk_duty *duty); | ||
| 221 | void (*init)(struct clk_hw *hw); | 247 | void (*init)(struct clk_hw *hw); |
| 222 | void (*debug_init)(struct clk_hw *hw, struct dentry *dentry); | 248 | void (*debug_init)(struct clk_hw *hw, struct dentry *dentry); |
| 223 | }; | 249 | }; |
