forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/clk/sprd/div.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 //
33 // Spreadtrum divider clock driver
44 //
....@@ -35,20 +35,28 @@
3535 struct sprd_clk_common common;
3636 };
3737
38
-#define SPRD_DIV_CLK(_struct, _name, _parent, _reg, \
39
- _shift, _width, _flags) \
38
+#define SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
39
+ _shift, _width, _flags, _fn) \
4040 struct sprd_div _struct = { \
4141 .div = _SPRD_DIV_CLK(_shift, _width), \
4242 .common = { \
4343 .regmap = NULL, \
4444 .reg = _reg, \
45
- .hw.init = CLK_HW_INIT(_name, \
46
- _parent, \
47
- &sprd_div_ops, \
48
- _flags), \
45
+ .hw.init = _fn(_name, _parent, \
46
+ &sprd_div_ops, _flags), \
4947 } \
5048 }
5149
50
+#define SPRD_DIV_CLK(_struct, _name, _parent, _reg, \
51
+ _shift, _width, _flags) \
52
+ SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
53
+ _shift, _width, _flags, CLK_HW_INIT)
54
+
55
+#define SPRD_DIV_CLK_HW(_struct, _name, _parent, _reg, \
56
+ _shift, _width, _flags) \
57
+ SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
58
+ _shift, _width, _flags, CLK_HW_INIT_HW)
59
+
5260 static inline struct sprd_div *hw_to_sprd_div(const struct clk_hw *hw)
5361 {
5462 struct sprd_clk_common *common = hw_to_sprd_clk_common(hw);