Lines Matching refs:clk

3  *  linux/include/linux/clk.h
17 struct clk;
22 * DOC: clk notifier callback types
24 * PRE_RATE_CHANGE - called immediately before the clk rate is changed,
32 * the clk will be called with ABORT_RATE_CHANGE. Callbacks must
35 * POST_RATE_CHANGE - called after the clk rate change has successfully
44 * struct clk_notifier - associate a clk with a notifier
45 * @clk: struct clk * to associate the notifier with
46 * @notifier_head: a blocking_notifier_head for this clk
51 * particular @clk. Future notifiers on that @clk are added to the
55 struct clk *clk;
62 * @clk: struct clk * being changed
63 * @old_rate: previous rate of this clk
64 * @new_rate: new rate of this clk
66 * For a pre-notifier, old_rate is the clk's rate before this rate
68 * post-notifier, old_rate and new_rate are both set to the clk's
72 struct clk *clk;
78 * struct clk_bulk_data - Data used for bulk clk operations.
81 * @clk: struct clk * to store the associated clock
89 struct clk *clk;
96 * @clk: clock whose rate we are interested in
103 int clk_notifier_register(struct clk *clk, struct notifier_block *nb);
107 * @clk: clock whose rate we are no longer interested in
110 int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
115 * @clk: clock whose rate we are interested in
120 int devm_clk_notifier_register(struct device *dev, struct clk *clk,
126 * @clk: clock source
131 long clk_get_accuracy(struct clk *clk);
135 * @clk: clock signal source
141 int clk_set_phase(struct clk *clk, int degrees);
145 * @clk: clock signal source
150 int clk_get_phase(struct clk *clk);
154 * @clk: clock signal source
161 int clk_set_duty_cycle(struct clk *clk, unsigned int num, unsigned int den);
165 * @clk: clock signal source
171 int clk_get_scaled_duty_cycle(struct clk *clk, unsigned int scale);
174 * clk_is_match - check if two clk's point to the same hardware clock
175 * @p: clk compared against q
176 * @q: clk compared against p
178 * Returns true if the two struct clk pointers both point to the same hardware
184 bool clk_is_match(const struct clk *p, const struct clk *q);
189 * @clk: clock source
202 int clk_rate_exclusive_get(struct clk *clk);
207 * @clk: clock source
209 * Calls clk_rate_exclusive_get() on @clk and registers a devm cleanup handler
214 int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk);
219 * @clk: clock source
229 void clk_rate_exclusive_put(struct clk *clk);
233 static inline int clk_notifier_register(struct clk *clk,
239 static inline int clk_notifier_unregister(struct clk *clk,
246 struct clk *clk,
252 static inline long clk_get_accuracy(struct clk *clk)
257 static inline long clk_set_phase(struct clk *clk, int phase)
262 static inline long clk_get_phase(struct clk *clk)
267 static inline int clk_set_duty_cycle(struct clk *clk, unsigned int num,
273 static inline unsigned int clk_get_scaled_duty_cycle(struct clk *clk,
279 static inline bool clk_is_match(const struct clk *p, const struct clk *q)
284 static inline int clk_rate_exclusive_get(struct clk *clk)
289 static inline int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk)
294 static inline void clk_rate_exclusive_put(struct clk *clk) {}
301 * @clk: clock source
307 int clk_prepare(struct clk *clk);
313 * @clk: clock source
326 bool clk_is_enabled_when_prepared(struct clk *clk);
328 static inline int clk_prepare(struct clk *clk)
341 static inline bool clk_is_enabled_when_prepared(struct clk *clk)
349 * @clk: clock source
357 void clk_unprepare(struct clk *clk);
360 static inline void clk_unprepare(struct clk *clk)
377 * Returns a struct clk corresponding to the clock producer, or
387 struct clk *clk_get(struct device *dev, const char *id);
395 * This helper function allows drivers to get several clk consumers in one
396 * operation. If any of the clk cannot be acquired then any clks
403 * The clock returned is stored in each @clk_bulk_data.clk field.
417 * This helper function allows drivers to get all clk consumers in one
418 * operation. If any of the clk cannot be acquired then any clks
440 * NULL for a clk for which a clock producer could not be determined.
445 * devm_clk_bulk_get - managed get multiple clk consumers
452 * This helper function allows drivers to get several clk
466 * NULL for given clk. It is assumed all clocks in clk_bulk_data are optional.
469 * successfully or for any clk there was no clk provider available, otherwise
473 * The clock returned is stored in each @clk_bulk_data.clk field.
482 * devm_clk_bulk_get_all - managed get multiple clk consumers
490 * This helper function allows drivers to get several clk
521 * Return: a struct clk corresponding to the clock producer, or
533 struct clk *devm_clk_get(struct device *dev, const char *id);
542 * Return: a struct clk corresponding to the clock producer, or
548 * The returned clk (if valid) is prepared. Drivers must however assume
554 struct clk *devm_clk_get_prepared(struct device *dev, const char *id);
563 * Return: a struct clk corresponding to the clock producer, or
569 * The returned clk (if valid) is prepared and enabled.
574 struct clk *devm_clk_get_enabled(struct device *dev, const char *id);
584 * Return: a struct clk corresponding to the clock producer, or
587 * the clock producer. If no such clk is found, it returns NULL
588 * which serves as a dummy clk. That's the only difference compared
597 struct clk *devm_clk_get_optional(struct device *dev, const char *id);
606 * Return: a struct clk corresponding to the clock producer, or
609 * the clock producer. If no such clk is found, it returns NULL
610 * which serves as a dummy clk. That's the only difference compared
613 * The returned clk (if valid) is prepared. Drivers must however
619 struct clk *devm_clk_get_optional_prepared(struct device *dev, const char *id);
629 * Return: a struct clk corresponding to the clock producer, or
632 * the clock producer. If no such clk is found, it returns NULL
633 * which serves as a dummy clk. That's the only difference compared
636 * The returned clk (if valid) is prepared and enabled.
641 struct clk *devm_clk_get_optional_enabled(struct device *dev, const char *id);
651 * struct clk from the registered list of clock providers by using
657 struct clk *devm_get_clk_from_child(struct device *dev,
662 * @clk: clock source
670 int clk_enable(struct clk *clk);
686 * @clk: clock source
698 void clk_disable(struct clk *clk);
721 * @clk: clock source
723 unsigned long clk_get_rate(struct clk *clk);
727 * @clk: clock source
735 void clk_put(struct clk *clk);
766 * @clk: clock source acquired with devm_clk_get()
774 void devm_clk_put(struct device *dev, struct clk *clk);
783 * @clk: clock source
790 * rate = clk_round_rate(clk, r);
794 * clk_set_rate(clk, r);
795 * rate = clk_get_rate(clk);
802 long clk_round_rate(struct clk *clk, unsigned long rate);
806 * @clk: clock source
814 int clk_set_rate(struct clk *clk, unsigned long rate);
819 * @clk: clock source
831 int clk_set_rate_exclusive(struct clk *clk, unsigned long rate);
835 * @clk: clock source
841 * Returns true if @parent is a possible parent for @clk, false otherwise.
843 bool clk_has_parent(const struct clk *clk, const struct clk *parent);
847 * @clk: clock source
853 int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max);
857 * @clk: clock source
862 int clk_set_min_rate(struct clk *clk, unsigned long rate);
866 * @clk: clock source
871 int clk_set_max_rate(struct clk *clk, unsigned long rate);
875 * @clk: clock source
880 int clk_set_parent(struct clk *clk, struct clk *parent);
884 * @clk: clock source
886 * Returns struct clk corresponding to parent clock source, or
889 struct clk *clk_get_parent(struct clk *clk);
896 * Returns a struct clk corresponding to the clock producer, or
906 struct clk *clk_get_sys(const char *dev_id, const char *con_id);
927 static inline struct clk *clk_get(struct device *dev, const char *id)
950 static inline struct clk *devm_clk_get(struct device *dev, const char *id)
955 static inline struct clk *devm_clk_get_prepared(struct device *dev,
961 static inline struct clk *devm_clk_get_enabled(struct device *dev,
967 static inline struct clk *devm_clk_get_optional(struct device *dev,
973 static inline struct clk *devm_clk_get_optional_prepared(struct device *dev,
979 static inline struct clk *devm_clk_get_optional_enabled(struct device *dev,
1010 static inline struct clk *devm_get_clk_from_child(struct device *dev,
1016 static inline void clk_put(struct clk *clk) {}
1022 static inline void devm_clk_put(struct device *dev, struct clk *clk) {}
1024 static inline int clk_enable(struct clk *clk)
1035 static inline void clk_disable(struct clk *clk) {}
1041 static inline unsigned long clk_get_rate(struct clk *clk)
1046 static inline int clk_set_rate(struct clk *clk, unsigned long rate)
1051 static inline int clk_set_rate_exclusive(struct clk *clk, unsigned long rate)
1056 static inline long clk_round_rate(struct clk *clk, unsigned long rate)
1061 static inline bool clk_has_parent(struct clk *clk, struct clk *parent)
1066 static inline int clk_set_rate_range(struct clk *clk, unsigned long min,
1072 static inline int clk_set_min_rate(struct clk *clk, unsigned long rate)
1077 static inline int clk_set_max_rate(struct clk *clk, unsigned long rate)
1082 static inline int clk_set_parent(struct clk *clk, struct clk *parent)
1087 static inline struct clk *clk_get_parent(struct clk *clk)
1092 static inline struct clk *clk_get_sys(const char *dev_id, const char *con_id)
1107 static inline int clk_prepare_enable(struct clk *clk)
1111 ret = clk_prepare(clk);
1114 ret = clk_enable(clk);
1116 clk_unprepare(clk);
1122 static inline void clk_disable_unprepare(struct clk *clk)
1124 clk_disable(clk);
1125 clk_unprepare(clk);
1152 * @clk: clock source
1156 static inline int clk_drop_range(struct clk *clk)
1158 return clk_set_rate_range(clk, 0, ULONG_MAX);
1170 static inline struct clk *clk_get_optional(struct device *dev, const char *id)
1172 struct clk *clk = clk_get(dev, id);
1174 if (clk == ERR_PTR(-ENOENT))
1177 return clk;
1181 struct clk *of_clk_get(struct device_node *np, int index);
1182 struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
1183 struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
1185 static inline struct clk *of_clk_get(struct device_node *np, int index)
1189 static inline struct clk *of_clk_get_by_name(struct device_node *np,
1194 static inline struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)