| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | // |
|---|
| 3 | 3 | // Spreadtrum divider clock driver |
|---|
| 4 | 4 | // |
|---|
| .. | .. |
|---|
| 35 | 35 | struct sprd_clk_common common; |
|---|
| 36 | 36 | }; |
|---|
| 37 | 37 | |
|---|
| 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) \ |
|---|
| 40 | 40 | struct sprd_div _struct = { \ |
|---|
| 41 | 41 | .div = _SPRD_DIV_CLK(_shift, _width), \ |
|---|
| 42 | 42 | .common = { \ |
|---|
| 43 | 43 | .regmap = NULL, \ |
|---|
| 44 | 44 | .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), \ |
|---|
| 49 | 47 | } \ |
|---|
| 50 | 48 | } |
|---|
| 51 | 49 | |
|---|
| 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 | + |
|---|
| 52 | 60 | static inline struct sprd_div *hw_to_sprd_div(const struct clk_hw *hw) |
|---|
| 53 | 61 | { |
|---|
| 54 | 62 | struct sprd_clk_common *common = hw_to_sprd_clk_common(hw); |
|---|