Emilio López | e874a66 | 2013-02-25 11:44:26 -0300 | [diff] [blame] | 1 | #ifndef __MACH_SUNXI_CLK_FACTORS_H |
| 2 | #define __MACH_SUNXI_CLK_FACTORS_H |
| 3 | |
| 4 | #include <linux/clk-provider.h> |
| 5 | #include <linux/clkdev.h> |
| 6 | |
| 7 | #define SUNXI_FACTORS_NOT_APPLICABLE (0) |
| 8 | |
| 9 | struct clk_factors_config { |
| 10 | u8 nshift; |
| 11 | u8 nwidth; |
| 12 | u8 kshift; |
| 13 | u8 kwidth; |
| 14 | u8 mshift; |
| 15 | u8 mwidth; |
| 16 | u8 pshift; |
| 17 | u8 pwidth; |
Chen-Yu Tsai | 9a5e6c7 | 2014-06-26 23:55:41 +0800 | [diff] [blame] | 18 | u8 n_start; |
Emilio López | e874a66 | 2013-02-25 11:44:26 -0300 | [diff] [blame] | 19 | }; |
| 20 | |
Emilio López | 40a5dcb | 2013-12-23 00:32:32 -0300 | [diff] [blame] | 21 | struct clk_factors { |
| 22 | struct clk_hw hw; |
| 23 | void __iomem *reg; |
| 24 | struct clk_factors_config *config; |
| 25 | void (*get_factors) (u32 *rate, u32 parent, u8 *n, u8 *k, u8 *m, u8 *p); |
| 26 | spinlock_t *lock; |
| 27 | }; |
| 28 | |
| 29 | extern const struct clk_ops clk_factors_ops; |
Emilio López | e874a66 | 2013-02-25 11:44:26 -0300 | [diff] [blame] | 30 | #endif |