aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk-private.h20
-rw-r--r--include/linux/clk-provider.h23
2 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index b258532162b8..eb3f84bc5325 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -143,6 +143,26 @@ struct clk {
143 DEFINE_CLK(_name, clk_mux_ops, _flags, _parent_names, \ 143 DEFINE_CLK(_name, clk_mux_ops, _flags, _parent_names, \
144 _parents); 144 _parents);
145 145
146#define DEFINE_CLK_FIXED_FACTOR(_name, _parent_name, \
147 _parent_ptr, _flags, \
148 _mult, _div) \
149 static struct clk _name; \
150 static const char *_name##_parent_names[] = { \
151 _parent_name, \
152 }; \
153 static struct clk *_name##_parents[] = { \
154 _parent_ptr, \
155 }; \
156 static struct clk_fixed_factor _name##_hw = { \
157 .hw = { \
158 .clk = &_name, \
159 }, \
160 .mult = _mult, \
161 .div = _div, \
162 }; \
163 DEFINE_CLK(_name, clk_fixed_factor_ops, _flags, \
164 _name##_parent_names, _name##_parents);
165
146/** 166/**
147 * __clk_init - initialize the data structures in a struct clk 167 * __clk_init - initialize the data structures in a struct clk
148 * @dev: device initializing this clk, placeholder for now 168 * @dev: device initializing this clk, placeholder for now
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 5db3412106b3..c1c23b9ec368 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -277,6 +277,29 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
277 u8 clk_mux_flags, spinlock_t *lock); 277 u8 clk_mux_flags, spinlock_t *lock);
278 278
279/** 279/**
280 * struct clk_fixed_factor - fixed multiplier and divider clock
281 *
282 * @hw: handle between common and hardware-specific interfaces
283 * @mult: multiplier
284 * @div: divider
285 *
286 * Clock with a fixed multiplier and divider. The output frequency is the
287 * parent clock rate divided by div and multiplied by mult.
288 * Implements .recalc_rate, .set_rate and .round_rate
289 */
290
291struct clk_fixed_factor {
292 struct clk_hw hw;
293 unsigned int mult;
294 unsigned int div;
295};
296
297extern struct clk_ops clk_fixed_factor_ops;
298struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
299 const char *parent_name, unsigned long flags,
300 unsigned int mult, unsigned int div);
301
302/**
280 * clk_register - allocate a new clock, register it and return an opaque cookie 303 * clk_register - allocate a new clock, register it and return an opaque cookie
281 * @dev: device that is registering this clock 304 * @dev: device that is registering this clock
282 * @hw: link to hardware-specific clock data 305 * @hw: link to hardware-specific clock data