| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 |
| 2 | * |
| 3 | * Copyright (c) 2019 MediaTek Inc. |
| 4 | */ |
| 5 | |
| 6 | #ifndef __DRV_CLK_FIXUP_DIV_H |
| 7 | #define __DRV_CLK_FIXUP_DIV_H |
| 8 | |
| 9 | #include <linux/clk-provider.h> |
| 10 | |
| 11 | struct clk; |
| 12 | |
| 13 | struct clk_fixup_div { |
| 14 | int id; |
| 15 | const char *name; |
| 16 | const char *parent_name; |
| 17 | |
| 18 | void __iomem *reg_fixup; |
| 19 | const struct clk_div_table *clk_div_table; |
| 20 | |
| 21 | struct clk_divider divider; |
| 22 | const struct clk_ops *ops; |
| 23 | |
| 24 | }; |
| 25 | |
| 26 | static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw) |
| 27 | { |
| 28 | struct clk_divider *divider = to_clk_divider(hw); |
| 29 | |
| 30 | return container_of(divider, struct clk_fixup_div, divider); |
| 31 | } |
| 32 | |
| 33 | struct clk *mtk_clk_fixup_divider( |
| 34 | const char *name, |
| 35 | const char *parent, |
| 36 | unsigned long flags, |
| 37 | void __iomem *reg, |
| 38 | void __iomem *reg_fixup, |
| 39 | u8 shift, |
| 40 | u8 width, |
| 41 | u8 clk_divider_flags, |
| 42 | spinlock_t *lock); |
| 43 | |
| 44 | #endif /* __DRV_CLK_FIXUP_DIV_H */ |