xref: /linux/sound/soc/samsung/i2s-regs.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
17d5b1b8aSSylwester Nawrocki /* SPDX-License-Identifier: GPL-2.0+ */
2172a453dSSangbeom Kim /*
3172a453dSSangbeom Kim  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4172a453dSSangbeom Kim  *		http://www.samsung.com
5172a453dSSangbeom Kim  *
6172a453dSSangbeom Kim  * Samsung I2S driver's register header
7172a453dSSangbeom Kim  */
8172a453dSSangbeom Kim 
9172a453dSSangbeom Kim #ifndef __SND_SOC_SAMSUNG_I2S_REGS_H
10172a453dSSangbeom Kim #define __SND_SOC_SAMSUNG_I2S_REGS_H
11172a453dSSangbeom Kim 
12172a453dSSangbeom Kim #define I2SCON		0x0
13172a453dSSangbeom Kim #define I2SMOD		0x4
14172a453dSSangbeom Kim #define I2SFIC		0x8
15172a453dSSangbeom Kim #define I2SPSR		0xc
16172a453dSSangbeom Kim #define I2STXD		0x10
17172a453dSSangbeom Kim #define I2SRXD		0x14
18172a453dSSangbeom Kim #define I2SFICS		0x18
19172a453dSSangbeom Kim #define I2STXDS		0x1c
20766705eeSSangbeom Kim #define I2SAHB		0x20
21766705eeSSangbeom Kim #define I2SSTR0		0x24
22766705eeSSangbeom Kim #define I2SSIZE		0x28
23766705eeSSangbeom Kim #define I2STRNCNT	0x2c
24766705eeSSangbeom Kim #define I2SLVL0ADDR	0x30
25766705eeSSangbeom Kim #define I2SLVL1ADDR	0x34
26766705eeSSangbeom Kim #define I2SLVL2ADDR	0x38
27766705eeSSangbeom Kim #define I2SLVL3ADDR	0x3c
284ca0c0d4SPadmavathi Venna #define I2SSTR1		0x40
294ca0c0d4SPadmavathi Venna #define I2SVER		0x44
30a5a56871SPadmavathi Venna #define I2SFIC1		0x48
314ca0c0d4SPadmavathi Venna #define I2STDM		0x4c
32a5a56871SPadmavathi Venna #define I2SFSTA		0x50
33172a453dSSangbeom Kim 
34172a453dSSangbeom Kim #define CON_RSTCLR		(1 << 31)
35172a453dSSangbeom Kim #define CON_FRXOFSTATUS		(1 << 26)
36172a453dSSangbeom Kim #define CON_FRXORINTEN		(1 << 25)
37172a453dSSangbeom Kim #define CON_FTXSURSTAT		(1 << 24)
38172a453dSSangbeom Kim #define CON_FTXSURINTEN		(1 << 23)
39172a453dSSangbeom Kim #define CON_TXSDMA_PAUSE	(1 << 20)
40172a453dSSangbeom Kim #define CON_TXSDMA_ACTIVE	(1 << 18)
41172a453dSSangbeom Kim 
42172a453dSSangbeom Kim #define CON_FTXURSTATUS		(1 << 17)
43172a453dSSangbeom Kim #define CON_FTXURINTEN		(1 << 16)
44172a453dSSangbeom Kim #define CON_TXFIFO2_EMPTY	(1 << 15)
45172a453dSSangbeom Kim #define CON_TXFIFO1_EMPTY	(1 << 14)
46172a453dSSangbeom Kim #define CON_TXFIFO2_FULL	(1 << 13)
47172a453dSSangbeom Kim #define CON_TXFIFO1_FULL	(1 << 12)
48172a453dSSangbeom Kim 
49172a453dSSangbeom Kim #define CON_LRINDEX		(1 << 11)
50172a453dSSangbeom Kim #define CON_TXFIFO_EMPTY	(1 << 10)
51172a453dSSangbeom Kim #define CON_RXFIFO_EMPTY	(1 << 9)
52172a453dSSangbeom Kim #define CON_TXFIFO_FULL		(1 << 8)
53172a453dSSangbeom Kim #define CON_RXFIFO_FULL		(1 << 7)
54172a453dSSangbeom Kim #define CON_TXDMA_PAUSE		(1 << 6)
55172a453dSSangbeom Kim #define CON_RXDMA_PAUSE		(1 << 5)
56172a453dSSangbeom Kim #define CON_TXCH_PAUSE		(1 << 4)
57172a453dSSangbeom Kim #define CON_RXCH_PAUSE		(1 << 3)
58172a453dSSangbeom Kim #define CON_TXDMA_ACTIVE	(1 << 2)
59172a453dSSangbeom Kim #define CON_RXDMA_ACTIVE	(1 << 1)
60172a453dSSangbeom Kim #define CON_ACTIVE		(1 << 0)
61172a453dSSangbeom Kim 
6245ae70e8SSylwester Nawrocki #define MOD_OPCLK_SHIFT		30
6345ae70e8SSylwester Nawrocki #define MOD_OPCLK_CDCLK_OUT	(0 << MOD_OPCLK_SHIFT)
6445ae70e8SSylwester Nawrocki #define MOD_OPCLK_CDCLK_IN	(1 << MOD_OPCLK_SHIFT)
6545ae70e8SSylwester Nawrocki #define MOD_OPCLK_BCLK_OUT	(2 << MOD_OPCLK_SHIFT)
6645ae70e8SSylwester Nawrocki #define MOD_OPCLK_PCLK		(3 << MOD_OPCLK_SHIFT)
6745ae70e8SSylwester Nawrocki #define MOD_OPCLK_MASK		(3 << MOD_OPCLK_SHIFT)
68172a453dSSangbeom Kim #define MOD_TXS_IDMA		(1 << 28) /* Sec_TXFIFO use I-DMA */
69172a453dSSangbeom Kim 
70172a453dSSangbeom Kim #define MOD_BLCS_SHIFT		26
71172a453dSSangbeom Kim #define MOD_BLCS_16BIT		(0 << MOD_BLCS_SHIFT)
72172a453dSSangbeom Kim #define MOD_BLCS_8BIT		(1 << MOD_BLCS_SHIFT)
73172a453dSSangbeom Kim #define MOD_BLCS_24BIT		(2 << MOD_BLCS_SHIFT)
74172a453dSSangbeom Kim #define MOD_BLCS_MASK		(3 << MOD_BLCS_SHIFT)
75172a453dSSangbeom Kim #define MOD_BLCP_SHIFT		24
76172a453dSSangbeom Kim #define MOD_BLCP_16BIT		(0 << MOD_BLCP_SHIFT)
77172a453dSSangbeom Kim #define MOD_BLCP_8BIT		(1 << MOD_BLCP_SHIFT)
78172a453dSSangbeom Kim #define MOD_BLCP_24BIT		(2 << MOD_BLCP_SHIFT)
79172a453dSSangbeom Kim #define MOD_BLCP_MASK		(3 << MOD_BLCP_SHIFT)
80172a453dSSangbeom Kim 
81172a453dSSangbeom Kim #define MOD_C2DD_HHALF		(1 << 21) /* Discard Higher-half */
82172a453dSSangbeom Kim #define MOD_C2DD_LHALF		(1 << 20) /* Discard Lower-half */
83172a453dSSangbeom Kim #define MOD_C1DD_HHALF		(1 << 19)
84172a453dSSangbeom Kim #define MOD_C1DD_LHALF		(1 << 18)
85172a453dSSangbeom Kim #define MOD_DC2_EN		(1 << 17)
86172a453dSSangbeom Kim #define MOD_DC1_EN		(1 << 16)
87172a453dSSangbeom Kim #define MOD_BLC_16BIT		(0 << 13)
88172a453dSSangbeom Kim #define MOD_BLC_8BIT		(1 << 13)
89172a453dSSangbeom Kim #define MOD_BLC_24BIT		(2 << 13)
90172a453dSSangbeom Kim #define MOD_BLC_MASK		(3 << 13)
91172a453dSSangbeom Kim 
92172a453dSSangbeom Kim #define MOD_TXONLY		(0 << 8)
93172a453dSSangbeom Kim #define MOD_RXONLY		(1 << 8)
94172a453dSSangbeom Kim #define MOD_TXRX		(2 << 8)
95172a453dSSangbeom Kim #define MOD_MASK		(3 << 8)
96b60be4aaSPadmavathi Venna #define MOD_LRP_SHIFT		7
97b60be4aaSPadmavathi Venna #define MOD_LR_LLOW		0
98b60be4aaSPadmavathi Venna #define MOD_LR_RLOW		1
99b60be4aaSPadmavathi Venna #define MOD_SDF_SHIFT		5
100b60be4aaSPadmavathi Venna #define MOD_SDF_IIS		0
101b60be4aaSPadmavathi Venna #define MOD_SDF_MSB		1
102b60be4aaSPadmavathi Venna #define MOD_SDF_LSB		2
103b60be4aaSPadmavathi Venna #define MOD_SDF_MASK		3
104b60be4aaSPadmavathi Venna #define MOD_RCLK_SHIFT		3
105b60be4aaSPadmavathi Venna #define MOD_RCLK_256FS		0
106b60be4aaSPadmavathi Venna #define MOD_RCLK_512FS		1
107b60be4aaSPadmavathi Venna #define MOD_RCLK_384FS		2
108b60be4aaSPadmavathi Venna #define MOD_RCLK_768FS		3
109b60be4aaSPadmavathi Venna #define MOD_RCLK_MASK		3
110b60be4aaSPadmavathi Venna #define MOD_BCLK_SHIFT		1
111b60be4aaSPadmavathi Venna #define MOD_BCLK_32FS		0
112b60be4aaSPadmavathi Venna #define MOD_BCLK_48FS		1
113b60be4aaSPadmavathi Venna #define MOD_BCLK_16FS		2
114b60be4aaSPadmavathi Venna #define MOD_BCLK_24FS		3
115b60be4aaSPadmavathi Venna #define MOD_BCLK_MASK		3
116172a453dSSangbeom Kim #define MOD_8BIT		(1 << 0)
117172a453dSSangbeom Kim 
1184ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_LRP_SHIFT	15
1194ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_SDF_SHIFT	6
1204ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_RCLK_SHIFT	4
1214ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_SHIFT	0
1224ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_64FS	4
1234ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_96FS	5
1244ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_128FS	6
1254ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_192FS	7
1264ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_256FS	8
1274ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_MASK	0xf
1284ca0c0d4SPadmavathi Venna 
129a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_64FS	4
130a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_128FS	5
131a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_96FS	6
132a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_192FS	7
133172a453dSSangbeom Kim 
134172a453dSSangbeom Kim #define PSR_PSREN		(1 << 15)
135*bc36d761SPadmanabhan Rajanbabu #define PSR_PSVAL(x)		((((x) - 1) << 8) & 0x3f00)
136172a453dSSangbeom Kim 
137172a453dSSangbeom Kim #define FIC_TX2COUNT(x)		(((x) >>  24) & 0xf)
138172a453dSSangbeom Kim #define FIC_TX1COUNT(x)		(((x) >>  16) & 0xf)
139172a453dSSangbeom Kim 
140172a453dSSangbeom Kim #define FIC_TXFLUSH		(1 << 15)
141172a453dSSangbeom Kim #define FIC_RXFLUSH		(1 << 7)
142766705eeSSangbeom Kim 
143172a453dSSangbeom Kim #define FIC_TXCOUNT(x)		(((x) >>  8) & 0xf)
144172a453dSSangbeom Kim #define FIC_RXCOUNT(x)		(((x) >>  0) & 0xf)
145172a453dSSangbeom Kim #define FICS_TXCOUNT(x)		(((x) >>  8) & 0x7f)
146172a453dSSangbeom Kim 
147766705eeSSangbeom Kim #define AHB_INTENLVL0		(1 << 24)
148766705eeSSangbeom Kim #define AHB_LVL0INT		(1 << 20)
149766705eeSSangbeom Kim #define AHB_CLRLVL0INT		(1 << 16)
150766705eeSSangbeom Kim #define AHB_DMARLD		(1 << 5)
151766705eeSSangbeom Kim #define AHB_INTMASK		(1 << 3)
152766705eeSSangbeom Kim #define AHB_DMAEN		(1 << 0)
153766705eeSSangbeom Kim #define AHB_LVLINTMASK		(0xf << 20)
154766705eeSSangbeom Kim 
155766705eeSSangbeom Kim #define I2SSIZE_TRNMSK		(0xffff)
156766705eeSSangbeom Kim #define I2SSIZE_SHIFT		(16)
157766705eeSSangbeom Kim 
158172a453dSSangbeom Kim #endif /* __SND_SOC_SAMSUNG_I2S_REGS_H */
159