0001
0002
0003
0004
0005
0006 #ifndef _CCU_FRAC_H_
0007 #define _CCU_FRAC_H_
0008
0009 #include <linux/clk-provider.h>
0010
0011 #include "ccu_common.h"
0012
0013 struct ccu_frac_internal {
0014 u32 enable;
0015 u32 select;
0016
0017 unsigned long rates[2];
0018 };
0019
0020 #define _SUNXI_CCU_FRAC(_enable, _select, _rate1, _rate2) \
0021 { \
0022 .enable = _enable, \
0023 .select = _select, \
0024 .rates = { _rate1, _rate2 }, \
0025 }
0026
0027 bool ccu_frac_helper_is_enabled(struct ccu_common *common,
0028 struct ccu_frac_internal *cf);
0029 void ccu_frac_helper_enable(struct ccu_common *common,
0030 struct ccu_frac_internal *cf);
0031 void ccu_frac_helper_disable(struct ccu_common *common,
0032 struct ccu_frac_internal *cf);
0033
0034 bool ccu_frac_helper_has_rate(struct ccu_common *common,
0035 struct ccu_frac_internal *cf,
0036 unsigned long rate);
0037
0038 unsigned long ccu_frac_helper_read_rate(struct ccu_common *common,
0039 struct ccu_frac_internal *cf);
0040
0041 int ccu_frac_helper_set_rate(struct ccu_common *common,
0042 struct ccu_frac_internal *cf,
0043 unsigned long rate, u32 lock);
0044
0045 #endif