1 /* 2 * Low level clock header file for Telechips TCC architecture 3 * (C) 2010 Hans J. Koch <hjk@linutronix.de> 4 * 5 * Licensed under the GPL v2. 6 */ 7 8 #ifndef __ASM_ARCH_TCC_CLOCK_H__ 9 #define __ASM_ARCH_TCC_CLOCK_H__ 10 11 #ifndef __ASSEMBLY__ 12 13 struct clk { 14 struct clk *parent; 15 /* id number of a root clock, 0 for normal clocks */ 16 int root_id; 17 /* Reference count of clock enable/disable */ 18 int refcount; 19 /* Address of associated BCLKCTRx register. Must be set. */ 20 void __iomem *bclkctr; 21 /* Bit position for BCLKCTRx. Must be set. */ 22 int bclk_shift; 23 /* Address of ACLKxxx register, if any. */ 24 void __iomem *aclkreg; 25 /* get the current clock rate (always a fresh value) */ 26 unsigned long (*get_rate) (struct clk *); 27 /* Function ptr to set the clock to a new rate. The rate must match a 28 supported rate returned from round_rate. Leave blank if clock is not 29 programmable */ 30 int (*set_rate) (struct clk *, unsigned long); 31 /* Function ptr to round the requested clock rate to the nearest 32 supported rate that is less than or equal to the requested rate. */ 33 unsigned long (*round_rate) (struct clk *, unsigned long); 34 /* Function ptr to enable the clock. Leave blank if clock can not 35 be gated. */ 36 int (*enable) (struct clk *); 37 /* Function ptr to disable the clock. Leave blank if clock can not 38 be gated. */ 39 void (*disable) (struct clk *); 40 /* Function ptr to set the parent clock of the clock. */ 41 int (*set_parent) (struct clk *, struct clk *); 42 }; 43 44 int clk_register(struct clk *clk); 45 void clk_unregister(struct clk *clk); 46 47 #endif /* __ASSEMBLY__ */ 48 #endif /* __ASM_ARCH_MXC_CLOCK_H__ */ 49