@@ -59,23 +59,23 @@ struct Stm32Clk {
59
59
struct Stm32Clk * input [CLKTREE_MAX_INPUT ];
60
60
};
61
61
62
- static void stm32clktree_recalc_output_freq (Stm32Clk clk );
62
+ static void stm32_clktree_recalc_output_freq (Stm32Clk clk );
63
63
64
64
65
65
66
66
67
67
/* HELPER FUNCTIONS */
68
68
69
- static Stm32Clk stm32clktree_get_input_clk (Stm32Clk clk )
69
+ static Stm32Clk stm32_clktree_get_input_clk (Stm32Clk clk )
70
70
{
71
71
return clk -> input [clk -> selected_input + 1 ];
72
72
}
73
73
74
74
#ifdef DEBUG_CLKTREE
75
75
76
- static void stm32clktree_print_state (Stm32Clk clk )
76
+ static void stm32_clktree_print_state (Stm32Clk clk )
77
77
{
78
- Stm32Clk input_clk = stm32clktree_get_input_clk (clk );
78
+ Stm32Clk input_clk = stm32_clktree_get_input_clk (clk );
79
79
80
80
printf ("STM32_CLKTREE: %s Output Change (SrcStm32Clk:%s InFreq:%lu OutFreq:%lu Mul:%u Div:%u Enabled:%c)\n" ,
81
81
clk -> name ,
@@ -88,16 +88,16 @@ static void stm32clktree_print_state(Stm32Clk clk)
88
88
}
89
89
#endif
90
90
91
- static void stm32clktree_set_input_freq (Stm32Clk clk , uint32_t input_freq )
91
+ static void stm32_clktree_set_input_freq (Stm32Clk clk , uint32_t input_freq )
92
92
{
93
93
clk -> input_freq = input_freq ;
94
94
95
- stm32clktree_recalc_output_freq (clk );
95
+ stm32_clktree_recalc_output_freq (clk );
96
96
}
97
97
98
98
/* Recalculates the output frequency based on the clock's input_freq variable.
99
99
*/
100
- static void stm32clktree_recalc_output_freq (Stm32Clk clk ) {
100
+ static void stm32_clktree_recalc_output_freq (Stm32Clk clk ) {
101
101
int i ;
102
102
Stm32Clk next_clk , next_clk_input ;
103
103
uint32_t new_output_freq ;
@@ -114,7 +114,7 @@ static void stm32clktree_recalc_output_freq(Stm32Clk clk) {
114
114
clk -> output_freq = new_output_freq ;
115
115
116
116
#ifdef DEBUG_CLKTREE
117
- stm32clktree_print_state (clk );
117
+ stm32_clktree_print_state (clk );
118
118
#endif
119
119
120
120
/* Check the new frequency against the max frequency. */
@@ -139,20 +139,20 @@ static void stm32clktree_recalc_output_freq(Stm32Clk clk) {
139
139
/* Only propagate the change if the child has selected the current
140
140
* clock as input.
141
141
*/
142
- next_clk_input = stm32clktree_get_input_clk (next_clk );
142
+ next_clk_input = stm32_clktree_get_input_clk (next_clk );
143
143
if (next_clk_input == clk ) {
144
144
/* Recursively propagate changes. The clock tree should not be
145
145
* too deep, so we shouldn't have to recurse too many times.
146
146
*/
147
- stm32clktree_set_input_freq (next_clk , new_output_freq );
147
+ stm32_clktree_set_input_freq (next_clk , new_output_freq );
148
148
}
149
149
}
150
150
}
151
151
}
152
152
153
153
154
154
/* Generic create routine used by the public create routines. */
155
- static Stm32Clk stm32clktree_create_generic (
155
+ static Stm32Clk stm32_clktree_create_generic (
156
156
const char * name ,
157
157
uint16_t multiplier ,
158
158
uint16_t divisor ,
@@ -191,17 +191,17 @@ static Stm32Clk stm32clktree_create_generic(
191
191
192
192
193
193
/* PUBLIC FUNCTIONS */
194
- bool stm32clktree_is_enabled (Stm32Clk clk )
194
+ bool stm32_clktree_is_enabled (Stm32Clk clk )
195
195
{
196
196
return clk -> enabled ;
197
197
}
198
198
199
- uint32_t stm32clktree_get_output_freq (Stm32Clk clk )
199
+ uint32_t stm32_clktree_get_output_freq (Stm32Clk clk )
200
200
{
201
201
return clk -> output_freq ;
202
202
}
203
203
204
- void stm32clktree_adduser (Stm32Clk clk , qemu_irq user )
204
+ void stm32_clktree_adduser (Stm32Clk clk , qemu_irq user )
205
205
{
206
206
CLKTREE_ADD_LINK (
207
207
clk -> user ,
@@ -211,22 +211,22 @@ void stm32clktree_adduser(Stm32Clk clk, qemu_irq user)
211
211
}
212
212
213
213
214
- Stm32Clk stm32clktree_create_src_clk (
214
+ Stm32Clk stm32_clktree_create_src_clk (
215
215
const char * name ,
216
216
uint32_t src_freq ,
217
217
bool enabled )
218
218
{
219
219
Stm32Clk clk ;
220
220
221
- clk = stm32clktree_create_generic (name , 1 , 1 , enabled );
221
+ clk = stm32_clktree_create_generic (name , 1 , 1 , enabled );
222
222
223
- stm32clktree_set_input_freq (clk , src_freq );
223
+ stm32_clktree_set_input_freq (clk , src_freq );
224
224
225
225
return clk ;
226
226
}
227
227
228
228
229
- Stm32Clk stm32clktree_create_clk (
229
+ Stm32Clk stm32_clktree_create_clk (
230
230
const char * name ,
231
231
uint16_t multiplier ,
232
232
uint16_t divisor ,
@@ -238,7 +238,7 @@ Stm32Clk stm32clktree_create_clk(
238
238
va_list input_clks ;
239
239
Stm32Clk clk , input_clk ;
240
240
241
- clk = stm32clktree_create_generic (name , multiplier , divisor , enabled );
241
+ clk = stm32_clktree_create_generic (name , multiplier , divisor , enabled );
242
242
243
243
/* Add the input clock connections. */
244
244
va_start (input_clks , selected_input );
@@ -256,30 +256,30 @@ Stm32Clk stm32clktree_create_clk(
256
256
CLKTREE_MAX_OUTPUT );
257
257
}
258
258
259
- stm32clktree_set_selected_input (clk , selected_input );
259
+ stm32_clktree_set_selected_input (clk , selected_input );
260
260
261
261
return clk ;
262
262
}
263
263
264
264
265
- void stm32clktree_set_scale (Stm32Clk clk , uint16_t multiplier , uint16_t divisor )
265
+ void stm32_clktree_set_scale (Stm32Clk clk , uint16_t multiplier , uint16_t divisor )
266
266
{
267
267
clk -> multiplier = multiplier ;
268
268
clk -> divisor = divisor ;
269
269
270
- stm32clktree_recalc_output_freq (clk );
270
+ stm32_clktree_recalc_output_freq (clk );
271
271
}
272
272
273
273
274
- void stm32clktree_set_enabled (Stm32Clk clk , bool enabled )
274
+ void stm32_clktree_set_enabled (Stm32Clk clk , bool enabled )
275
275
{
276
276
clk -> enabled = enabled ;
277
277
278
- stm32clktree_recalc_output_freq (clk );
278
+ stm32_clktree_recalc_output_freq (clk );
279
279
}
280
280
281
281
282
- void stm32clktree_set_selected_input (Stm32Clk clk , int selected_input )
282
+ void stm32_clktree_set_selected_input (Stm32Clk clk , int selected_input )
283
283
{
284
284
uint32_t input_freq ;
285
285
@@ -290,10 +290,10 @@ void stm32clktree_set_selected_input(Stm32Clk clk, int selected_input)
290
290
/* Get the input clock frequency. If there is no input, this should be 0.
291
291
*/
292
292
if (selected_input > -1 ) {
293
- input_freq = stm32clktree_get_input_clk (clk )-> output_freq ;
293
+ input_freq = stm32_clktree_get_input_clk (clk )-> output_freq ;
294
294
} else {
295
295
input_freq = 0 ;
296
296
}
297
297
298
- stm32clktree_set_input_freq (clk , input_freq );
298
+ stm32_clktree_set_input_freq (clk , input_freq );
299
299
}
0 commit comments