Lines Matching refs:clk

4 This document endeavours to explain the common clk framework details,
6 detailed explanation of the clock api in include/linux/clk.h, but
11 The common clk framework is an interface to control the clock nodes
18 clk which unifies the framework-level accounting and infrastructure that
20 is a common implementation of the clk.h api, defined in
21 drivers/clk/clk.c. Finally there is struct clk_ops, whose operations
22 are invoked by the clk api implementation.
34 is defined in struct clk_foo and pointed to within struct clk. This
40 Below is the common struct clk definition from
41 include/linux/clk-private.h, modified for brevity:
43 struct clk {
48 struct clk **parents;
49 struct clk *parent;
55 The members above make up the core of the clk tree topology. The clk
57 struct clk. That api is documented in include/linux/clk.h.
59 Platforms and devices utilizing the common struct clk use the struct
60 clk_ops pointer in struct clk to perform the hardware-specific parts of
61 the operations defined in clk.h:
96 Part 3 - hardware clk implementations
98 The strength of the common struct clk comes from its .ops and .hw pointers
99 which abstract the details of struct clk from the hardware-specific bits, and
100 vice versa. To illustrate consider the simple gateable clk implementation in
101 drivers/clk/clk-gate.c:
111 knowledge about which register and bit controls this clk's gating.
114 framework code and struct clk.
116 Let's walk through enabling this clk from driver code:
118 struct clk *clk;
119 clk = clk_get(NULL, "my_gateable_clk");
121 clk_prepare(clk);
122 clk_enable(clk);
126 clk_enable(clk);
127 clk->ops->enable(clk->hw);
130 [resolves struct clk gate with to_clk_gate(hw)]
146 #define to_clk_gate(_hw) container_of(_hw, struct clk_gate, clk)
151 Part 4 - supporting your own clk hardware
156 #include <linux/clk-provider.h>
158 include/linux/clk.h is included within that header and clk-private.h
162 To construct a clk hardware structure for your platform you must define
171 for your clk:
226 data and then passes the common struct clk parameters to the framework
231 See the basic clock types in drivers/clk/clk-*.c for examples.
237 presents a problem since the definition of struct clk should be hidden
238 from everyone except for the clock core in drivers/clk/clk.c.
240 To get around this problem struct clk's definition is exposed in
241 include/linux/clk-private.h along with some macros for more easily
246 clk-private.h must NEVER be included by code which implements struct
248 around inside of struct clk at run-time. To do so is a layering