2 * Clock framework definitions for SPEAr platform
4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.linux@gmail.com>
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
15 #include <linux/clk-provider.h>
16 #include <linux/spinlock_types.h>
17 #include <linux/types.h>
19 /* Auxiliary Synth clk */
21 #define AUX_EQ_SEL_SHIFT 30
22 #define AUX_EQ_SEL_MASK 1
25 #define AUX_XSCALE_SHIFT 16
26 #define AUX_XSCALE_MASK 0xFFF
27 #define AUX_YSCALE_SHIFT 0
28 #define AUX_YSCALE_MASK 0xFFF
29 #define AUX_SYNT_ENB 31
31 struct aux_clk_masks
{
52 struct aux_clk_masks
*masks
;
53 struct aux_rate_tbl
*rtbl
;
58 /* Fractional Synth clk */
59 struct frac_rate_tbl
{
66 struct frac_rate_tbl
*rtbl
;
80 struct gpt_rate_tbl
*rtbl
;
95 void __iomem
*mode_reg
;
96 void __iomem
*cfg_reg
;
97 struct pll_rate_tbl
*rtbl
;
105 const char *parent
[1];
109 typedef unsigned long (*clk_calc_rate
)(struct clk_hw
*hw
, unsigned long prate
,
112 /* clk register routines */
113 struct clk
*clk_register_aux(const char *aux_name
, const char *gate_name
,
114 const char *parent_name
, unsigned long flags
, void __iomem
*reg
,
115 struct aux_clk_masks
*masks
, struct aux_rate_tbl
*rtbl
,
116 u8 rtbl_cnt
, spinlock_t
*lock
, struct clk
**gate_clk
);
117 struct clk
*clk_register_frac(const char *name
, const char *parent_name
,
118 unsigned long flags
, void __iomem
*reg
,
119 struct frac_rate_tbl
*rtbl
, u8 rtbl_cnt
, spinlock_t
*lock
);
120 struct clk
*clk_register_gpt(const char *name
, const char *parent_name
, unsigned
121 long flags
, void __iomem
*reg
, struct gpt_rate_tbl
*rtbl
, u8
122 rtbl_cnt
, spinlock_t
*lock
);
123 struct clk
*clk_register_vco_pll(const char *vco_name
, const char *pll_name
,
124 const char *vco_gate_name
, const char *parent_name
,
125 unsigned long flags
, void __iomem
*mode_reg
, void __iomem
126 *cfg_reg
, struct pll_rate_tbl
*rtbl
, u8 rtbl_cnt
,
127 spinlock_t
*lock
, struct clk
**pll_clk
,
128 struct clk
**vco_gate_clk
);
130 long clk_round_rate_index(struct clk_hw
*hw
, unsigned long drate
,
131 unsigned long parent_rate
, clk_calc_rate calc_rate
, u8 rtbl_cnt
,
134 #endif /* __SPEAR_CLK_H */