Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / clk / sunxi-ng / ccu_phase.h
blob1268b9e081dd4d5b6e181eeef9984c54d012a50a
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (c) 2016 Maxime Ripard. All rights reserved.
4 */
6 #ifndef _CCU_PHASE_H_
7 #define _CCU_PHASE_H_
9 #include <linux/clk-provider.h>
11 #include "ccu_common.h"
13 struct ccu_phase {
14 u8 shift;
15 u8 width;
17 struct ccu_common common;
20 #define SUNXI_CCU_PHASE(_struct, _name, _parent, _reg, _shift, _width, _flags) \
21 struct ccu_phase _struct = { \
22 .shift = _shift, \
23 .width = _width, \
24 .common = { \
25 .reg = _reg, \
26 .hw.init = CLK_HW_INIT(_name, \
27 _parent, \
28 &ccu_phase_ops, \
29 _flags), \
30 } \
33 static inline struct ccu_phase *hw_to_ccu_phase(struct clk_hw *hw)
35 struct ccu_common *common = hw_to_ccu_common(hw);
37 return container_of(common, struct ccu_phase, common);
40 extern const struct clk_ops ccu_phase_ops;
42 #endif /* _CCU_PHASE_H_ */