clk: fixed-factor: Add CLK_FIXED_FACTOR_HW which takes clk_hw pointer as parent
authorChen-Yu Tsai <wens@csie.org>
Sun, 21 Apr 2019 23:19:46 +0000 (07:19 +0800)
committerChen-Yu Tsai <wens@csie.org>
Tue, 18 Jun 2019 11:39:00 +0000 (19:39 +0800)
With the new clk parenting code, clk_init_data was expanded to include
.parent_hws, for clk drivers to directly reference parents by clk_hw.

Add a new macro, CLK_FIXED_FACTOR_HW, that can take a struct clk_hw
pointer, instead of a string, as its parent.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
include/linux/clk-provider.h

index 0fd14c4874d6a09ce350a603d1a99a7ad0e3cef0..c85e9f3809f25293ab51846cfb7c271b151931c6 100644 (file)
@@ -985,6 +985,17 @@ extern struct of_device_id __clk_of_table;
                                              _flags),                  \
        }
 
+#define CLK_FIXED_FACTOR_HW(_struct, _name, _parent,                   \
+                           _div, _mult, _flags)                        \
+       struct clk_fixed_factor _struct = {                             \
+               .div            = _div,                                 \
+               .mult           = _mult,                                \
+               .hw.init        = CLK_HW_INIT_HW(_name,                 \
+                                                _parent,               \
+                                                &clk_fixed_factor_ops, \
+                                                _flags),               \
+       }
+
 #ifdef CONFIG_OF
 int of_clk_add_provider(struct device_node *np,
                        struct clk *(*clk_src_get)(struct of_phandle_args *args,