Skip to content

Commit d791565

Browse files
Ansuelbebarino
authored andcommitted
clk: introduce (devm_)hw_register_mux_parent_data_table API
Introduce (devm_)hw_register_mux_parent_data_table new API. We have basic support for clk_register_mux using parent_data but we lack any API to provide a custom parent_map. Add these 2 new API to correctly handle these special configuration instead of using the generic __(devm_)clk_hw_register_mux API. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20220914144743.17369-1-ansuelsmth@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 8f2fcac commit d791565

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/linux/clk-provider.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,13 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
974974
__clk_hw_register_mux((dev), NULL, (name), (num_parents), NULL, NULL, \
975975
(parent_data), (flags), (reg), (shift), \
976976
BIT((width)) - 1, (clk_mux_flags), NULL, (lock))
977+
#define clk_hw_register_mux_parent_data_table(dev, name, parent_data, \
978+
num_parents, flags, reg, shift, \
979+
width, clk_mux_flags, table, \
980+
lock) \
981+
__clk_hw_register_mux((dev), NULL, (name), (num_parents), NULL, NULL, \
982+
(parent_data), (flags), (reg), (shift), \
983+
BIT((width)) - 1, (clk_mux_flags), table, (lock))
977984
#define devm_clk_hw_register_mux(dev, name, parent_names, num_parents, flags, reg, \
978985
shift, width, clk_mux_flags, lock) \
979986
__devm_clk_hw_register_mux((dev), NULL, (name), (num_parents), \
@@ -987,6 +994,13 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
987994
(parent_hws), NULL, (flags), (reg), \
988995
(shift), BIT((width)) - 1, \
989996
(clk_mux_flags), NULL, (lock))
997+
#define devm_clk_hw_register_mux_parent_data_table(dev, name, parent_data, \
998+
num_parents, flags, reg, shift, \
999+
width, clk_mux_flags, table, \
1000+
lock) \
1001+
__devm_clk_hw_register_mux((dev), NULL, (name), (num_parents), NULL, \
1002+
NULL, (parent_data), (flags), (reg), (shift), \
1003+
BIT((width)) - 1, (clk_mux_flags), table, (lock))
9901004

9911005
int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
9921006
unsigned int val);

0 commit comments

Comments
 (0)