xref: /linux/sound/pci/oxygen/cs2000.h (revision 95298d63c67673c654c08952672d016212b26054)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef CS2000_H_INCLUDED
3 #define CS2000_H_INCLUDED
4 
5 #define CS2000_DEV_ID		0x01
6 #define CS2000_DEV_CTRL		0x02
7 #define CS2000_DEV_CFG_1	0x03
8 #define CS2000_DEV_CFG_2	0x04
9 #define CS2000_GLOBAL_CFG	0x05
10 #define CS2000_RATIO_0		0x06 /* 32 bits, big endian */
11 #define CS2000_RATIO_1		0x0a
12 #define CS2000_RATIO_2		0x0e
13 #define CS2000_RATIO_3		0x12
14 #define CS2000_FUN_CFG_1	0x16
15 #define CS2000_FUN_CFG_2	0x17
16 #define CS2000_FUN_CFG_3	0x1e
17 
18 /* DEV_ID */
19 #define CS2000_DEVICE_MASK		0xf8
20 #define CS2000_REVISION_MASK		0x07
21 
22 /* DEV_CTRL */
23 #define CS2000_UNLOCK			0x80
24 #define CS2000_AUX_OUT_DIS		0x02
25 #define CS2000_CLK_OUT_DIS		0x01
26 
27 /* DEV_CFG_1 */
28 #define CS2000_R_MOD_SEL_MASK		0xe0
29 #define CS2000_R_MOD_SEL_1		0x00
30 #define CS2000_R_MOD_SEL_2		0x20
31 #define CS2000_R_MOD_SEL_4		0x40
32 #define CS2000_R_MOD_SEL_8		0x60
33 #define CS2000_R_MOD_SEL_1_2		0x80
34 #define CS2000_R_MOD_SEL_1_4		0xa0
35 #define CS2000_R_MOD_SEL_1_8		0xc0
36 #define CS2000_R_MOD_SEL_1_16		0xe0
37 #define CS2000_R_SEL_MASK		0x18
38 #define CS2000_R_SEL_SHIFT		3
39 #define CS2000_AUX_OUT_SRC_MASK		0x06
40 #define CS2000_AUX_OUT_SRC_REF_CLK	0x00
41 #define CS2000_AUX_OUT_SRC_CLK_IN	0x02
42 #define CS2000_AUX_OUT_SRC_CLK_OUT	0x04
43 #define CS2000_AUX_OUT_SRC_PLL_LOCK	0x06
44 #define CS2000_EN_DEV_CFG_1		0x01
45 
46 /* DEV_CFG_2 */
47 #define CS2000_LOCK_CLK_MASK		0x06
48 #define CS2000_LOCK_CLK_SHIFT		1
49 #define CS2000_FRAC_N_SRC_MASK		0x01
50 #define CS2000_FRAC_N_SRC_STATIC	0x00
51 #define CS2000_FRAC_N_SRC_DYNAMIC	0x01
52 
53 /* GLOBAL_CFG */
54 #define CS2000_FREEZE			0x08
55 #define CS2000_EN_DEV_CFG_2		0x01
56 
57 /* FUN_CFG_1 */
58 #define CS2000_CLK_SKIP_EN		0x80
59 #define CS2000_AUX_LOCK_CFG_MASK	0x40
60 #define CS2000_AUX_LOCK_CFG_PP_HIGH	0x00
61 #define CS2000_AUX_LOCK_CFG_OD_LOW	0x40
62 #define CS2000_REF_CLK_DIV_MASK		0x18
63 #define CS2000_REF_CLK_DIV_4		0x00
64 #define CS2000_REF_CLK_DIV_2		0x08
65 #define CS2000_REF_CLK_DIV_1		0x10
66 
67 /* FUN_CFG_2 */
68 #define CS2000_CLK_OUT_UNL		0x10
69 #define CS2000_L_F_RATIO_CFG_MASK	0x08
70 #define CS2000_L_F_RATIO_CFG_20_12	0x00
71 #define CS2000_L_F_RATIO_CFG_12_20	0x08
72 
73 /* FUN_CFG_3 */
74 #define CS2000_CLK_IN_BW_MASK		0x70
75 #define CS2000_CLK_IN_BW_1		0x00
76 #define CS2000_CLK_IN_BW_2		0x10
77 #define CS2000_CLK_IN_BW_4		0x20
78 #define CS2000_CLK_IN_BW_8		0x30
79 #define CS2000_CLK_IN_BW_16		0x40
80 #define CS2000_CLK_IN_BW_32		0x50
81 #define CS2000_CLK_IN_BW_64		0x60
82 #define CS2000_CLK_IN_BW_128		0x70
83 
84 #endif
85