xref: /kernel/linux/linux-6.6/sound/pci/oxygen/cs2000.h (revision 62306a36)
162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef CS2000_H_INCLUDED
362306a36Sopenharmony_ci#define CS2000_H_INCLUDED
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#define CS2000_DEV_ID		0x01
662306a36Sopenharmony_ci#define CS2000_DEV_CTRL		0x02
762306a36Sopenharmony_ci#define CS2000_DEV_CFG_1	0x03
862306a36Sopenharmony_ci#define CS2000_DEV_CFG_2	0x04
962306a36Sopenharmony_ci#define CS2000_GLOBAL_CFG	0x05
1062306a36Sopenharmony_ci#define CS2000_RATIO_0		0x06 /* 32 bits, big endian */
1162306a36Sopenharmony_ci#define CS2000_RATIO_1		0x0a
1262306a36Sopenharmony_ci#define CS2000_RATIO_2		0x0e
1362306a36Sopenharmony_ci#define CS2000_RATIO_3		0x12
1462306a36Sopenharmony_ci#define CS2000_FUN_CFG_1	0x16
1562306a36Sopenharmony_ci#define CS2000_FUN_CFG_2	0x17
1662306a36Sopenharmony_ci#define CS2000_FUN_CFG_3	0x1e
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/* DEV_ID */
1962306a36Sopenharmony_ci#define CS2000_DEVICE_MASK		0xf8
2062306a36Sopenharmony_ci#define CS2000_REVISION_MASK		0x07
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/* DEV_CTRL */
2362306a36Sopenharmony_ci#define CS2000_UNLOCK			0x80
2462306a36Sopenharmony_ci#define CS2000_AUX_OUT_DIS		0x02
2562306a36Sopenharmony_ci#define CS2000_CLK_OUT_DIS		0x01
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* DEV_CFG_1 */
2862306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_MASK		0xe0
2962306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_1		0x00
3062306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_2		0x20
3162306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_4		0x40
3262306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_8		0x60
3362306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_1_2		0x80
3462306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_1_4		0xa0
3562306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_1_8		0xc0
3662306a36Sopenharmony_ci#define CS2000_R_MOD_SEL_1_16		0xe0
3762306a36Sopenharmony_ci#define CS2000_R_SEL_MASK		0x18
3862306a36Sopenharmony_ci#define CS2000_R_SEL_SHIFT		3
3962306a36Sopenharmony_ci#define CS2000_AUX_OUT_SRC_MASK		0x06
4062306a36Sopenharmony_ci#define CS2000_AUX_OUT_SRC_REF_CLK	0x00
4162306a36Sopenharmony_ci#define CS2000_AUX_OUT_SRC_CLK_IN	0x02
4262306a36Sopenharmony_ci#define CS2000_AUX_OUT_SRC_CLK_OUT	0x04
4362306a36Sopenharmony_ci#define CS2000_AUX_OUT_SRC_PLL_LOCK	0x06
4462306a36Sopenharmony_ci#define CS2000_EN_DEV_CFG_1		0x01
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* DEV_CFG_2 */
4762306a36Sopenharmony_ci#define CS2000_LOCK_CLK_MASK		0x06
4862306a36Sopenharmony_ci#define CS2000_LOCK_CLK_SHIFT		1
4962306a36Sopenharmony_ci#define CS2000_FRAC_N_SRC_MASK		0x01
5062306a36Sopenharmony_ci#define CS2000_FRAC_N_SRC_STATIC	0x00
5162306a36Sopenharmony_ci#define CS2000_FRAC_N_SRC_DYNAMIC	0x01
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/* GLOBAL_CFG */
5462306a36Sopenharmony_ci#define CS2000_FREEZE			0x08
5562306a36Sopenharmony_ci#define CS2000_EN_DEV_CFG_2		0x01
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci/* FUN_CFG_1 */
5862306a36Sopenharmony_ci#define CS2000_CLK_SKIP_EN		0x80
5962306a36Sopenharmony_ci#define CS2000_AUX_LOCK_CFG_MASK	0x40
6062306a36Sopenharmony_ci#define CS2000_AUX_LOCK_CFG_PP_HIGH	0x00
6162306a36Sopenharmony_ci#define CS2000_AUX_LOCK_CFG_OD_LOW	0x40
6262306a36Sopenharmony_ci#define CS2000_REF_CLK_DIV_MASK		0x18
6362306a36Sopenharmony_ci#define CS2000_REF_CLK_DIV_4		0x00
6462306a36Sopenharmony_ci#define CS2000_REF_CLK_DIV_2		0x08
6562306a36Sopenharmony_ci#define CS2000_REF_CLK_DIV_1		0x10
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci/* FUN_CFG_2 */
6862306a36Sopenharmony_ci#define CS2000_CLK_OUT_UNL		0x10
6962306a36Sopenharmony_ci#define CS2000_L_F_RATIO_CFG_MASK	0x08
7062306a36Sopenharmony_ci#define CS2000_L_F_RATIO_CFG_20_12	0x00
7162306a36Sopenharmony_ci#define CS2000_L_F_RATIO_CFG_12_20	0x08
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* FUN_CFG_3 */
7462306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_MASK		0x70
7562306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_1		0x00
7662306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_2		0x10
7762306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_4		0x20
7862306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_8		0x30
7962306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_16		0x40
8062306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_32		0x50
8162306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_64		0x60
8262306a36Sopenharmony_ci#define CS2000_CLK_IN_BW_128		0x70
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#endif
85