Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2016 Maxime Ripard. All rights reserved.
0004  */
0005 
0006 #ifndef _CCU_PHASE_H_
0007 #define _CCU_PHASE_H_
0008 
0009 #include <linux/clk-provider.h>
0010 
0011 #include "ccu_common.h"
0012 
0013 struct ccu_phase {
0014     u8          shift;
0015     u8          width;
0016 
0017     struct ccu_common   common;
0018 };
0019 
0020 #define SUNXI_CCU_PHASE(_struct, _name, _parent, _reg, _shift, _width, _flags) \
0021     struct ccu_phase _struct = {                    \
0022         .shift  = _shift,                   \
0023         .width  = _width,                   \
0024         .common = {                     \
0025             .reg        = _reg,             \
0026             .hw.init    = CLK_HW_INIT(_name,        \
0027                               _parent,      \
0028                               &ccu_phase_ops,   \
0029                               _flags),      \
0030         }                           \
0031     }
0032 
0033 static inline struct ccu_phase *hw_to_ccu_phase(struct clk_hw *hw)
0034 {
0035     struct ccu_common *common = hw_to_ccu_common(hw);
0036 
0037     return container_of(common, struct ccu_phase, common);
0038 }
0039 
0040 extern const struct clk_ops ccu_phase_ops;
0041 
0042 #endif /* _CCU_PHASE_H_ */