.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | // |
---|
3 | 3 | // Spreadtrum composite clock driver |
---|
4 | 4 | // |
---|
.. | .. |
---|
18 | 18 | struct sprd_clk_common common; |
---|
19 | 19 | }; |
---|
20 | 20 | |
---|
21 | | -#define SPRD_COMP_CLK_TABLE(_struct, _name, _parent, _reg, _table, \ |
---|
22 | | - _mshift, _mwidth, _dshift, _dwidth, _flags) \ |
---|
| 21 | +#define SPRD_COMP_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, _table, \ |
---|
| 22 | + _mshift, _mwidth, _dshift, _dwidth, \ |
---|
| 23 | + _flags, _fn) \ |
---|
23 | 24 | struct sprd_comp _struct = { \ |
---|
24 | 25 | .mux = _SPRD_MUX_CLK(_mshift, _mwidth, _table), \ |
---|
25 | 26 | .div = _SPRD_DIV_CLK(_dshift, _dwidth), \ |
---|
26 | 27 | .common = { \ |
---|
27 | 28 | .regmap = NULL, \ |
---|
28 | 29 | .reg = _reg, \ |
---|
29 | | - .hw.init = CLK_HW_INIT_PARENTS(_name, \ |
---|
30 | | - _parent, \ |
---|
31 | | - &sprd_comp_ops, \ |
---|
32 | | - _flags), \ |
---|
| 30 | + .hw.init = _fn(_name, _parent, \ |
---|
| 31 | + &sprd_comp_ops, _flags), \ |
---|
33 | 32 | } \ |
---|
34 | 33 | } |
---|
35 | 34 | |
---|
36 | | -#define SPRD_COMP_CLK(_struct, _name, _parent, _reg, _mshift, \ |
---|
37 | | - _mwidth, _dshift, _dwidth, _flags) \ |
---|
38 | | - SPRD_COMP_CLK_TABLE(_struct, _name, _parent, _reg, \ |
---|
39 | | - NULL, _mshift, _mwidth, \ |
---|
40 | | - _dshift, _dwidth, _flags) |
---|
| 35 | +#define SPRD_COMP_CLK_TABLE(_struct, _name, _parent, _reg, _table, \ |
---|
| 36 | + _mshift, _mwidth, _dshift, _dwidth, _flags) \ |
---|
| 37 | + SPRD_COMP_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, _table, \ |
---|
| 38 | + _mshift, _mwidth, _dshift, _dwidth, \ |
---|
| 39 | + _flags, CLK_HW_INIT_PARENTS) |
---|
| 40 | + |
---|
| 41 | +#define SPRD_COMP_CLK(_struct, _name, _parent, _reg, _mshift, \ |
---|
| 42 | + _mwidth, _dshift, _dwidth, _flags) \ |
---|
| 43 | + SPRD_COMP_CLK_TABLE(_struct, _name, _parent, _reg, NULL, \ |
---|
| 44 | + _mshift, _mwidth, _dshift, _dwidth, _flags) |
---|
| 45 | + |
---|
| 46 | +#define SPRD_COMP_CLK_DATA_TABLE(_struct, _name, _parent, _reg, _table, \ |
---|
| 47 | + _mshift, _mwidth, _dshift, \ |
---|
| 48 | + _dwidth, _flags) \ |
---|
| 49 | + SPRD_COMP_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, _table, \ |
---|
| 50 | + _mshift, _mwidth, _dshift, _dwidth, \ |
---|
| 51 | + _flags, CLK_HW_INIT_PARENTS_DATA) |
---|
| 52 | + |
---|
| 53 | +#define SPRD_COMP_CLK_DATA(_struct, _name, _parent, _reg, _mshift, \ |
---|
| 54 | + _mwidth, _dshift, _dwidth, _flags) \ |
---|
| 55 | + SPRD_COMP_CLK_DATA_TABLE(_struct, _name, _parent, _reg, NULL, \ |
---|
| 56 | + _mshift, _mwidth, _dshift, _dwidth, \ |
---|
| 57 | + _flags) |
---|
41 | 58 | |
---|
42 | 59 | static inline struct sprd_comp *hw_to_sprd_comp(const struct clk_hw *hw) |
---|
43 | 60 | { |
---|