0001
0002
0003
0004
0005
0006
0007 #ifndef __CLK_BT1_CCU_PLL_H__
0008 #define __CLK_BT1_CCU_PLL_H__
0009
0010 #include <linux/clk-provider.h>
0011 #include <linux/spinlock.h>
0012 #include <linux/regmap.h>
0013 #include <linux/bits.h>
0014 #include <linux/of.h>
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 struct ccu_pll_init_data {
0027 unsigned int id;
0028 const char *name;
0029 const char *parent_name;
0030 unsigned int base;
0031 struct regmap *sys_regs;
0032 struct device_node *np;
0033 unsigned long flags;
0034 };
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 struct ccu_pll {
0046 struct clk_hw hw;
0047 unsigned int id;
0048 unsigned int reg_ctl;
0049 unsigned int reg_ctl1;
0050 struct regmap *sys_regs;
0051 spinlock_t lock;
0052 };
0053 #define to_ccu_pll(_hw) container_of(_hw, struct ccu_pll, hw)
0054
0055 static inline struct clk_hw *ccu_pll_get_clk_hw(struct ccu_pll *pll)
0056 {
0057 return pll ? &pll->hw : NULL;
0058 }
0059
0060 struct ccu_pll *ccu_pll_hw_register(const struct ccu_pll_init_data *init);
0061
0062 void ccu_pll_hw_unregister(struct ccu_pll *pll);
0063
0064 #endif