summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2019-05-03 11:58:20 +0800
committerChen-Yu Tsai <wens@csie.org>2019-06-18 19:39:00 +0800
commit8b13a48b891c7c855e9f3a401d91391a946f4ca7 (patch)
tree8f5a9d001ed69b71bb80310274f005fb5a522a46 /include
parent1bef004e2680511ecbb6b5db3954fba430501ecb (diff)
downloadlinux-stable-8b13a48b891c7c855e9f3a401d91391a946f4ca7.tar.gz
linux-stable-8b13a48b891c7c855e9f3a401d91391a946f4ca7.tar.bz2
linux-stable-8b13a48b891c7c855e9f3a401d91391a946f4ca7.zip
clk: fixed-factor: Add CLK_FIXED_FACTOR_FW_NAME for DT clock-names parent
With the new clk parenting code, clk_init_data was expanded to include .parent_data, for clk drivers to specify parents using a combination of device tree clock-names, pointers to struct clk_hw, device tree clocks, and/or fallback global clock names. Add a new macro, CLK_FIXED_FACTOR_FW_NAME, that takes a string to match a clock-names entry in the device tree to specify the clock parent. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk-provider.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 146a6859969e..e5c44f6dd897 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -1011,6 +1011,17 @@ extern struct of_device_id __clk_of_table;
_flags), \
}
+#define CLK_FIXED_FACTOR_FW_NAME(_struct, _name, _parent, \
+ _div, _mult, _flags) \
+ struct clk_fixed_factor _struct = { \
+ .div = _div, \
+ .mult = _mult, \
+ .hw.init = CLK_HW_INIT_FW_NAME(_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,