]>
Commit | Line | Data |
---|---|---|
d2912cb1 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
39c0cb02 | 2 | /* |
39c0cb02 RK |
3 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. |
4 | * | |
39c0cb02 | 5 | * Support functions for calculating clocks/divisors for the ICST |
50a23e6e | 6 | * clock generators. See http://www.idt.com/ for more information |
39c0cb02 RK |
7 | * on these devices. |
8 | */ | |
ba3fae06 LW |
9 | #ifndef ICST_H |
10 | #define ICST_H | |
39c0cb02 RK |
11 | |
12 | struct icst_params { | |
13 | unsigned long ref; | |
14 | unsigned long vco_max; /* inclusive */ | |
e73a46a3 | 15 | unsigned long vco_min; /* exclusive */ |
39c0cb02 RK |
16 | unsigned short vd_min; /* inclusive */ |
17 | unsigned short vd_max; /* inclusive */ | |
18 | unsigned char rd_min; /* inclusive */ | |
19 | unsigned char rd_max; /* inclusive */ | |
232eaf7f RK |
20 | const unsigned char *s2div; /* chip specific s2div array */ |
21 | const unsigned char *idx2s; /* chip specific idx2s array */ | |
39c0cb02 RK |
22 | }; |
23 | ||
24 | struct icst_vco { | |
25 | unsigned short v; | |
26 | unsigned char r; | |
27 | unsigned char s; | |
28 | }; | |
29 | ||
c5a0adb5 RK |
30 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco); |
31 | struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq); | |
32 | ||
33 | /* | |
34 | * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V). | |
35 | * This frequency is pre-output divider. | |
36 | */ | |
37 | #define ICST307_VCO_MIN 6000000 | |
38 | #define ICST307_VCO_MAX 200000000 | |
39 | ||
40 | extern const unsigned char icst307_s2div[]; | |
41 | extern const unsigned char icst307_idx2s[]; | |
42 | ||
43 | /* | |
44 | * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V). | |
45 | * This frequency is pre-output divider. | |
46 | */ | |
47 | #define ICST525_VCO_MIN 10000000 | |
48 | #define ICST525_VCO_MAX_3V 200000000 | |
49 | #define ICST525_VCO_MAX_5V 320000000 | |
50 | ||
51 | extern const unsigned char icst525_s2div[]; | |
52 | extern const unsigned char icst525_idx2s[]; | |
53 | ||
39c0cb02 | 54 | #endif |