1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Clock framework definitions for SPEAr platform
5 * Copyright (C) 2012 ST Microelectronics
6 * Viresh Kumar <vireshk@kernel.org>
12 #include <linux/clk-provider.h>
13 #include <linux/spinlock_types.h>
14 #include <linux/types.h>
16 /* Auxiliary Synth clk */
18 #define AUX_EQ_SEL_SHIFT 30
19 #define AUX_EQ_SEL_MASK 1
22 #define AUX_XSCALE_SHIFT 16
23 #define AUX_XSCALE_MASK 0xFFF
24 #define AUX_YSCALE_SHIFT 0
25 #define AUX_YSCALE_MASK 0xFFF
26 #define AUX_SYNT_ENB 31
28 struct aux_clk_masks
{
49 const struct aux_clk_masks
*masks
;
50 struct aux_rate_tbl
*rtbl
;
55 /* Fractional Synth clk */
56 struct frac_rate_tbl
{
63 struct frac_rate_tbl
*rtbl
;
77 struct gpt_rate_tbl
*rtbl
;
92 void __iomem
*mode_reg
;
93 void __iomem
*cfg_reg
;
94 struct pll_rate_tbl
*rtbl
;
102 const char *parent
[1];
106 typedef unsigned long (*clk_calc_rate
)(struct clk_hw
*hw
, unsigned long prate
,
109 /* clk register routines */
110 struct clk
*clk_register_aux(const char *aux_name
, const char *gate_name
,
111 const char *parent_name
, unsigned long flags
, void __iomem
*reg
,
112 const struct aux_clk_masks
*masks
, struct aux_rate_tbl
*rtbl
,
113 u8 rtbl_cnt
, spinlock_t
*lock
, struct clk
**gate_clk
);
114 struct clk
*clk_register_frac(const char *name
, const char *parent_name
,
115 unsigned long flags
, void __iomem
*reg
,
116 struct frac_rate_tbl
*rtbl
, u8 rtbl_cnt
, spinlock_t
*lock
);
117 struct clk
*clk_register_gpt(const char *name
, const char *parent_name
, unsigned
118 long flags
, void __iomem
*reg
, struct gpt_rate_tbl
*rtbl
, u8
119 rtbl_cnt
, spinlock_t
*lock
);
120 struct clk
*clk_register_vco_pll(const char *vco_name
, const char *pll_name
,
121 const char *vco_gate_name
, const char *parent_name
,
122 unsigned long flags
, void __iomem
*mode_reg
, void __iomem
123 *cfg_reg
, struct pll_rate_tbl
*rtbl
, u8 rtbl_cnt
,
124 spinlock_t
*lock
, struct clk
**pll_clk
,
125 struct clk
**vco_gate_clk
);
127 long clk_round_rate_index(struct clk_hw
*hw
, unsigned long drate
,
128 unsigned long parent_rate
, clk_calc_rate calc_rate
, u8 rtbl_cnt
,
131 #endif /* __SPEAR_CLK_H */