.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | // |
---|
3 | 3 | // Spreadtrum multiplexer clock driver |
---|
4 | 4 | // |
---|
.. | .. |
---|
36 | 36 | .table = _table, \ |
---|
37 | 37 | } |
---|
38 | 38 | |
---|
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) \ |
---|
42 | 41 | struct sprd_mux _struct = { \ |
---|
43 | 42 | .mux = _SPRD_MUX_CLK(_shift, _width, _table), \ |
---|
44 | 43 | .common = { \ |
---|
45 | 44 | .regmap = NULL, \ |
---|
46 | 45 | .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), \ |
---|
51 | 48 | } \ |
---|
52 | 49 | } |
---|
| 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) |
---|
53 | 56 | |
---|
54 | 57 | #define SPRD_MUX_CLK(_struct, _name, _parents, _reg, \ |
---|
55 | 58 | _shift, _width, _flags) \ |
---|
56 | 59 | SPRD_MUX_CLK_TABLE(_struct, _name, _parents, NULL, \ |
---|
57 | 60 | _reg, _shift, _width, _flags) |
---|
58 | 61 | |
---|
| 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 | + |
---|
59 | 73 | static inline struct sprd_mux *hw_to_sprd_mux(const struct clk_hw *hw) |
---|
60 | 74 | { |
---|
61 | 75 | struct sprd_clk_common *common = hw_to_sprd_clk_common(hw); |
---|