@@ -78,7 +78,8 @@ static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *
78
78
79
79
static struct clk_hw *
80
80
__clk_hw_register_fixed_factor (struct device * dev , struct device_node * np ,
81
- const char * name , const char * parent_name , int index ,
81
+ const char * name , const char * parent_name ,
82
+ const struct clk_hw * parent_hw , int index ,
82
83
unsigned long flags , unsigned int mult , unsigned int div ,
83
84
bool devm )
84
85
{
@@ -110,6 +111,8 @@ __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
110
111
init .flags = flags ;
111
112
if (parent_name )
112
113
init .parent_names = & parent_name ;
114
+ else if (parent_hw )
115
+ init .parent_hws = & parent_hw ;
113
116
else
114
117
init .parent_data = & pdata ;
115
118
init .num_parents = 1 ;
@@ -148,16 +151,48 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_index(struct device *dev,
148
151
const char * name , unsigned int index , unsigned long flags ,
149
152
unsigned int mult , unsigned int div )
150
153
{
151
- return __clk_hw_register_fixed_factor (dev , NULL , name , NULL , index ,
154
+ return __clk_hw_register_fixed_factor (dev , NULL , name , NULL , NULL , index ,
152
155
flags , mult , div , true);
153
156
}
154
157
EXPORT_SYMBOL_GPL (devm_clk_hw_register_fixed_factor_index );
155
158
159
+ /**
160
+ * devm_clk_hw_register_fixed_factor_parent_hw - Register a fixed factor clock with
161
+ * pointer to parent clock
162
+ * @dev: device that is registering this clock
163
+ * @name: name of this clock
164
+ * @parent_hw: pointer to parent clk
165
+ * @flags: fixed factor flags
166
+ * @mult: multiplier
167
+ * @div: divider
168
+ *
169
+ * Return: Pointer to fixed factor clk_hw structure that was registered or
170
+ * an error pointer.
171
+ */
172
+ struct clk_hw * devm_clk_hw_register_fixed_factor_parent_hw (struct device * dev ,
173
+ const char * name , const struct clk_hw * parent_hw ,
174
+ unsigned long flags , unsigned int mult , unsigned int div )
175
+ {
176
+ return __clk_hw_register_fixed_factor (dev , NULL , name , NULL , parent_hw ,
177
+ -1 , flags , mult , div , true);
178
+ }
179
+ EXPORT_SYMBOL_GPL (devm_clk_hw_register_fixed_factor_parent_hw );
180
+
181
+ struct clk_hw * clk_hw_register_fixed_factor_parent_hw (struct device * dev ,
182
+ const char * name , const struct clk_hw * parent_hw ,
183
+ unsigned long flags , unsigned int mult , unsigned int div )
184
+ {
185
+ return __clk_hw_register_fixed_factor (dev , NULL , name , NULL ,
186
+ parent_hw , -1 , flags , mult , div ,
187
+ false);
188
+ }
189
+ EXPORT_SYMBOL_GPL (clk_hw_register_fixed_factor_parent_hw );
190
+
156
191
struct clk_hw * clk_hw_register_fixed_factor (struct device * dev ,
157
192
const char * name , const char * parent_name , unsigned long flags ,
158
193
unsigned int mult , unsigned int div )
159
194
{
160
- return __clk_hw_register_fixed_factor (dev , NULL , name , parent_name , -1 ,
195
+ return __clk_hw_register_fixed_factor (dev , NULL , name , parent_name , NULL , -1 ,
161
196
flags , mult , div , false);
162
197
}
163
198
EXPORT_SYMBOL_GPL (clk_hw_register_fixed_factor );
@@ -204,7 +239,7 @@ struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev,
204
239
const char * name , const char * parent_name , unsigned long flags ,
205
240
unsigned int mult , unsigned int div )
206
241
{
207
- return __clk_hw_register_fixed_factor (dev , NULL , name , parent_name , -1 ,
242
+ return __clk_hw_register_fixed_factor (dev , NULL , name , parent_name , NULL , -1 ,
208
243
flags , mult , div , true);
209
244
}
210
245
EXPORT_SYMBOL_GPL (devm_clk_hw_register_fixed_factor );
@@ -231,7 +266,7 @@ static struct clk_hw *_of_fixed_factor_clk_setup(struct device_node *node)
231
266
232
267
of_property_read_string (node , "clock-output-names" , & clk_name );
233
268
234
- hw = __clk_hw_register_fixed_factor (NULL , node , clk_name , NULL , 0 ,
269
+ hw = __clk_hw_register_fixed_factor (NULL , node , clk_name , NULL , NULL , 0 ,
235
270
0 , mult , div , false);
236
271
if (IS_ERR (hw )) {
237
272
/*
0 commit comments