mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
clk: fixed-factor: Add CLK_FIXED_FACTOR_HWS which takes list of struct clk_hw *
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_HWS, that can take an array of pointers to struct clk_hw, instead of a string, as its parent. Taking an array instead of a direct pointer allows the reuse of the array for multiple clks, rather than having one compound literal with the same contents allocated for each clk declaration. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
This commit is contained in:
parent
d7b15114ab
commit
1bef004e26
1 changed files with 15 additions and 0 deletions
|
@ -996,6 +996,21 @@ extern struct of_device_id __clk_of_table;
|
||||||
_flags), \
|
_flags), \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This macro allows the driver to reuse the _parent array for multiple
|
||||||
|
* fixed factor clk declarations.
|
||||||
|
*/
|
||||||
|
#define CLK_FIXED_FACTOR_HWS(_struct, _name, _parent, \
|
||||||
|
_div, _mult, _flags) \
|
||||||
|
struct clk_fixed_factor _struct = { \
|
||||||
|
.div = _div, \
|
||||||
|
.mult = _mult, \
|
||||||
|
.hw.init = CLK_HW_INIT_HWS(_name, \
|
||||||
|
_parent, \
|
||||||
|
&clk_fixed_factor_ops, \
|
||||||
|
_flags), \
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
int of_clk_add_provider(struct device_node *np,
|
int of_clk_add_provider(struct device_node *np,
|
||||||
struct clk *(*clk_src_get)(struct of_phandle_args *args,
|
struct clk *(*clk_src_get)(struct of_phandle_args *args,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue