diff options
Diffstat (limited to 'include/linux/clk.h')
| -rw-r--r-- | include/linux/clk.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 0dbd0885b2c2..4f750c481b82 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -142,6 +142,27 @@ int clk_set_phase(struct clk *clk, int degrees); | |||
| 142 | int clk_get_phase(struct clk *clk); | 142 | int clk_get_phase(struct clk *clk); |
| 143 | 143 | ||
| 144 | /** | 144 | /** |
| 145 | * clk_set_duty_cycle - adjust the duty cycle ratio of a clock signal | ||
| 146 | * @clk: clock signal source | ||
| 147 | * @num: numerator of the duty cycle ratio to be applied | ||
| 148 | * @den: denominator of the duty cycle ratio to be applied | ||
| 149 | * | ||
| 150 | * Adjust the duty cycle of a clock signal by the specified ratio. Returns 0 on | ||
| 151 | * success, -EERROR otherwise. | ||
| 152 | */ | ||
| 153 | int clk_set_duty_cycle(struct clk *clk, unsigned int num, unsigned int den); | ||
| 154 | |||
| 155 | /** | ||
| 156 | * clk_get_duty_cycle - return the duty cycle ratio of a clock signal | ||
| 157 | * @clk: clock signal source | ||
| 158 | * @scale: scaling factor to be applied to represent the ratio as an integer | ||
| 159 | * | ||
| 160 | * Returns the duty cycle ratio multiplied by the scale provided, otherwise | ||
| 161 | * returns -EERROR. | ||
| 162 | */ | ||
| 163 | int clk_get_scaled_duty_cycle(struct clk *clk, unsigned int scale); | ||
| 164 | |||
| 165 | /** | ||
| 145 | * clk_is_match - check if two clk's point to the same hardware clock | 166 | * clk_is_match - check if two clk's point to the same hardware clock |
| 146 | * @p: clk compared against q | 167 | * @p: clk compared against q |
| 147 | * @q: clk compared against p | 168 | * @q: clk compared against p |
| @@ -183,6 +204,18 @@ static inline long clk_get_phase(struct clk *clk) | |||
| 183 | return -ENOTSUPP; | 204 | return -ENOTSUPP; |
| 184 | } | 205 | } |
| 185 | 206 | ||
| 207 | static inline int clk_set_duty_cycle(struct clk *clk, unsigned int num, | ||
| 208 | unsigned int den) | ||
| 209 | { | ||
| 210 | return -ENOTSUPP; | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline unsigned int clk_get_scaled_duty_cycle(struct clk *clk, | ||
| 214 | unsigned int scale) | ||
| 215 | { | ||
| 216 | return 0; | ||
| 217 | } | ||
| 218 | |||
| 186 | static inline bool clk_is_match(const struct clk *p, const struct clk *q) | 219 | static inline bool clk_is_match(const struct clk *p, const struct clk *q) |
| 187 | { | 220 | { |
| 188 | return p == q; | 221 | return p == q; |
