forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/clk/sprd/mux.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 //
33 // Spreadtrum multiplexer clock driver
44 //
....@@ -36,26 +36,40 @@
3636 .table = _table, \
3737 }
3838
39
-#define SPRD_MUX_CLK_TABLE(_struct, _name, _parents, _table, \
40
- _reg, _shift, _width, \
41
- _flags) \
39
+#define SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table, \
40
+ _reg, _shift, _width, _flags, _fn) \
4241 struct sprd_mux _struct = { \
4342 .mux = _SPRD_MUX_CLK(_shift, _width, _table), \
4443 .common = { \
4544 .regmap = NULL, \
4645 .reg = _reg, \
47
- .hw.init = CLK_HW_INIT_PARENTS(_name, \
48
- _parents, \
49
- &sprd_mux_ops, \
50
- _flags), \
46
+ .hw.init = _fn(_name, _parents, \
47
+ &sprd_mux_ops, _flags), \
5148 } \
5249 }
50
+
51
+#define SPRD_MUX_CLK_TABLE(_struct, _name, _parents, _table, \
52
+ _reg, _shift, _width, _flags) \
53
+ SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table, \
54
+ _reg, _shift, _width, _flags, \
55
+ CLK_HW_INIT_PARENTS)
5356
5457 #define SPRD_MUX_CLK(_struct, _name, _parents, _reg, \
5558 _shift, _width, _flags) \
5659 SPRD_MUX_CLK_TABLE(_struct, _name, _parents, NULL, \
5760 _reg, _shift, _width, _flags)
5861
62
+#define SPRD_MUX_CLK_DATA_TABLE(_struct, _name, _parents, _table, \
63
+ _reg, _shift, _width, _flags) \
64
+ SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table, \
65
+ _reg, _shift, _width, _flags, \
66
+ CLK_HW_INIT_PARENTS_DATA)
67
+
68
+#define SPRD_MUX_CLK_DATA(_struct, _name, _parents, _reg, \
69
+ _shift, _width, _flags) \
70
+ SPRD_MUX_CLK_DATA_TABLE(_struct, _name, _parents, NULL, \
71
+ _reg, _shift, _width, _flags)
72
+
5973 static inline struct sprd_mux *hw_to_sprd_mux(const struct clk_hw *hw)
6074 {
6175 struct sprd_clk_common *common = hw_to_sprd_clk_common(hw);