13 #include <linux/module.h>
14 #include <linux/slab.h>
29 #define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)
31 static unsigned long clk_fixed_rate_recalc_rate(
struct clk_hw *
hw,
32 unsigned long parent_rate)
38 .recalc_rate = clk_fixed_rate_recalc_rate,
51 const char *parent_name,
unsigned long flags,
52 unsigned long fixed_rate)
54 struct clk_fixed_rate *
fixed;
56 struct clk_init_data init;
59 fixed = kzalloc(
sizeof(
struct clk_fixed_rate),
GFP_KERNEL);
61 pr_err(
"%s: could not allocate fixed clk\n", __func__);
67 init.flags = flags | CLK_IS_BASIC;
68 init.parent_names = (parent_name ? &parent_name:
NULL);
69 init.num_parents = (parent_name ? 1 : 0);
72 fixed->fixed_rate = fixed_rate;
73 fixed->hw.init = &
init;
91 const char *clk_name = node->
name;
94 if (of_property_read_u32(node,
"clock-frequency", &rate))
101 of_clk_add_provider(node, of_clk_src_simple_get, clk);