Go to the documentation of this file.
11 #ifndef __LINUX_CLK_PRIVATE_H
12 #define __LINUX_CLK_PRIVATE_H
15 #include <linux/list.h>
26 #ifdef CONFIG_COMMON_CLK
33 const char **parent_names;
37 unsigned long new_rate;
39 unsigned int enable_count;
40 unsigned int prepare_count;
43 unsigned int notifier_count;
44 #ifdef CONFIG_COMMON_CLK_DEBUG
58 #define DEFINE_CLK(_name, _ops, _flags, _parent_names, \
60 static struct clk _name = { \
63 .hw = &_name##_hw.hw, \
64 .parent_names = _parent_names, \
65 .num_parents = ARRAY_SIZE(_parent_names), \
66 .parents = _parents, \
67 .flags = _flags | CLK_IS_BASIC, \
70 #define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \
72 static struct clk _name; \
73 static const char *_name##_parent_names[] = {}; \
74 static struct clk_fixed_rate _name##_hw = { \
78 .fixed_rate = _rate, \
79 .flags = _fixed_rate_flags, \
81 DEFINE_CLK(_name, clk_fixed_rate_ops, _flags, \
82 _name##_parent_names, NULL);
84 #define DEFINE_CLK_GATE(_name, _parent_name, _parent_ptr, \
85 _flags, _reg, _bit_idx, \
87 static struct clk _name; \
88 static const char *_name##_parent_names[] = { \
91 static struct clk *_name##_parents[] = { \
94 static struct clk_gate _name##_hw = { \
99 .bit_idx = _bit_idx, \
100 .flags = _gate_flags, \
103 DEFINE_CLK(_name, clk_gate_ops, _flags, \
104 _name##_parent_names, _name##_parents);
106 #define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
107 _flags, _reg, _shift, _width, \
108 _divider_flags, _table, _lock) \
109 static struct clk _name; \
110 static const char *_name##_parent_names[] = { \
113 static struct clk *_name##_parents[] = { \
116 static struct clk_divider _name##_hw = { \
123 .flags = _divider_flags, \
127 DEFINE_CLK(_name, clk_divider_ops, _flags, \
128 _name##_parent_names, _name##_parents);
130 #define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
131 _flags, _reg, _shift, _width, \
132 _divider_flags, _lock) \
133 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
134 _flags, _reg, _shift, _width, \
135 _divider_flags, NULL, _lock)
137 #define DEFINE_CLK_DIVIDER_TABLE(_name, _parent_name, \
138 _parent_ptr, _flags, _reg, \
139 _shift, _width, _divider_flags, \
141 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
142 _flags, _reg, _shift, _width, \
143 _divider_flags, _table, _lock) \
145 #define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \
146 _reg, _shift, _width, \
148 static struct clk _name; \
149 static struct clk_mux _name##_hw = { \
156 .flags = _mux_flags, \
159 DEFINE_CLK(_name, clk_mux_ops, _flags, _parent_names, \
162 #define DEFINE_CLK_FIXED_FACTOR(_name, _parent_name, \
163 _parent_ptr, _flags, \
165 static struct clk _name; \
166 static const char *_name##_parent_names[] = { \
169 static struct clk *_name##_parents[] = { \
172 static struct clk_fixed_factor _name##_hw = { \
179 DEFINE_CLK(_name, clk_fixed_factor_ops, _flags, \
180 _name##_parent_names, _name##_parents);