xref: /linux/sound/soc/samsung/i2s-regs.h (revision 4ca0c0d4784fa82d68733f7793e3487023e12282)
1172a453dSSangbeom Kim /*
2172a453dSSangbeom Kim  * linux/sound/soc/samsung/i2s-regs.h
3172a453dSSangbeom Kim  *
4172a453dSSangbeom Kim  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5172a453dSSangbeom Kim  *		http://www.samsung.com
6172a453dSSangbeom Kim  *
7172a453dSSangbeom Kim  * Samsung I2S driver's register header
8172a453dSSangbeom Kim  *
9172a453dSSangbeom Kim  * This program is free software; you can redistribute  it and/or modify it
10172a453dSSangbeom Kim  * under  the terms of  the GNU General  Public License as published by the
11172a453dSSangbeom Kim  * Free Software Foundation;  either version 2 of the  License, or (at your
12172a453dSSangbeom Kim  * option) any later version.
13172a453dSSangbeom Kim  */
14172a453dSSangbeom Kim 
15172a453dSSangbeom Kim #ifndef __SND_SOC_SAMSUNG_I2S_REGS_H
16172a453dSSangbeom Kim #define __SND_SOC_SAMSUNG_I2S_REGS_H
17172a453dSSangbeom Kim 
18172a453dSSangbeom Kim #define I2SCON		0x0
19172a453dSSangbeom Kim #define I2SMOD		0x4
20172a453dSSangbeom Kim #define I2SFIC		0x8
21172a453dSSangbeom Kim #define I2SPSR		0xc
22172a453dSSangbeom Kim #define I2STXD		0x10
23172a453dSSangbeom Kim #define I2SRXD		0x14
24172a453dSSangbeom Kim #define I2SFICS		0x18
25172a453dSSangbeom Kim #define I2STXDS		0x1c
26766705eeSSangbeom Kim #define I2SAHB		0x20
27766705eeSSangbeom Kim #define I2SSTR0		0x24
28766705eeSSangbeom Kim #define I2SSIZE		0x28
29766705eeSSangbeom Kim #define I2STRNCNT	0x2c
30766705eeSSangbeom Kim #define I2SLVL0ADDR	0x30
31766705eeSSangbeom Kim #define I2SLVL1ADDR	0x34
32766705eeSSangbeom Kim #define I2SLVL2ADDR	0x38
33766705eeSSangbeom Kim #define I2SLVL3ADDR	0x3c
34*4ca0c0d4SPadmavathi Venna #define I2SSTR1		0x40
35*4ca0c0d4SPadmavathi Venna #define I2SVER		0x44
36*4ca0c0d4SPadmavathi Venna #define I2SFIC2		0x48
37*4ca0c0d4SPadmavathi Venna #define I2STDM		0x4c
38172a453dSSangbeom Kim 
39172a453dSSangbeom Kim #define CON_RSTCLR		(1 << 31)
40172a453dSSangbeom Kim #define CON_FRXOFSTATUS		(1 << 26)
41172a453dSSangbeom Kim #define CON_FRXORINTEN		(1 << 25)
42172a453dSSangbeom Kim #define CON_FTXSURSTAT		(1 << 24)
43172a453dSSangbeom Kim #define CON_FTXSURINTEN		(1 << 23)
44172a453dSSangbeom Kim #define CON_TXSDMA_PAUSE	(1 << 20)
45172a453dSSangbeom Kim #define CON_TXSDMA_ACTIVE	(1 << 18)
46172a453dSSangbeom Kim 
47172a453dSSangbeom Kim #define CON_FTXURSTATUS		(1 << 17)
48172a453dSSangbeom Kim #define CON_FTXURINTEN		(1 << 16)
49172a453dSSangbeom Kim #define CON_TXFIFO2_EMPTY	(1 << 15)
50172a453dSSangbeom Kim #define CON_TXFIFO1_EMPTY	(1 << 14)
51172a453dSSangbeom Kim #define CON_TXFIFO2_FULL	(1 << 13)
52172a453dSSangbeom Kim #define CON_TXFIFO1_FULL	(1 << 12)
53172a453dSSangbeom Kim 
54172a453dSSangbeom Kim #define CON_LRINDEX		(1 << 11)
55172a453dSSangbeom Kim #define CON_TXFIFO_EMPTY	(1 << 10)
56172a453dSSangbeom Kim #define CON_RXFIFO_EMPTY	(1 << 9)
57172a453dSSangbeom Kim #define CON_TXFIFO_FULL		(1 << 8)
58172a453dSSangbeom Kim #define CON_RXFIFO_FULL		(1 << 7)
59172a453dSSangbeom Kim #define CON_TXDMA_PAUSE		(1 << 6)
60172a453dSSangbeom Kim #define CON_RXDMA_PAUSE		(1 << 5)
61172a453dSSangbeom Kim #define CON_TXCH_PAUSE		(1 << 4)
62172a453dSSangbeom Kim #define CON_RXCH_PAUSE		(1 << 3)
63172a453dSSangbeom Kim #define CON_TXDMA_ACTIVE	(1 << 2)
64172a453dSSangbeom Kim #define CON_RXDMA_ACTIVE	(1 << 1)
65172a453dSSangbeom Kim #define CON_ACTIVE		(1 << 0)
66172a453dSSangbeom Kim 
67172a453dSSangbeom Kim #define MOD_OPCLK_CDCLK_OUT	(0 << 30)
68172a453dSSangbeom Kim #define MOD_OPCLK_CDCLK_IN	(1 << 30)
69172a453dSSangbeom Kim #define MOD_OPCLK_BCLK_OUT	(2 << 30)
70172a453dSSangbeom Kim #define MOD_OPCLK_PCLK		(3 << 30)
71172a453dSSangbeom Kim #define MOD_OPCLK_MASK		(3 << 30)
72172a453dSSangbeom Kim #define MOD_TXS_IDMA		(1 << 28) /* Sec_TXFIFO use I-DMA */
73172a453dSSangbeom Kim 
74172a453dSSangbeom Kim #define MOD_BLCS_SHIFT		26
75172a453dSSangbeom Kim #define MOD_BLCS_16BIT		(0 << MOD_BLCS_SHIFT)
76172a453dSSangbeom Kim #define MOD_BLCS_8BIT		(1 << MOD_BLCS_SHIFT)
77172a453dSSangbeom Kim #define MOD_BLCS_24BIT		(2 << MOD_BLCS_SHIFT)
78172a453dSSangbeom Kim #define MOD_BLCS_MASK		(3 << MOD_BLCS_SHIFT)
79172a453dSSangbeom Kim #define MOD_BLCP_SHIFT		24
80172a453dSSangbeom Kim #define MOD_BLCP_16BIT		(0 << MOD_BLCP_SHIFT)
81172a453dSSangbeom Kim #define MOD_BLCP_8BIT		(1 << MOD_BLCP_SHIFT)
82172a453dSSangbeom Kim #define MOD_BLCP_24BIT		(2 << MOD_BLCP_SHIFT)
83172a453dSSangbeom Kim #define MOD_BLCP_MASK		(3 << MOD_BLCP_SHIFT)
84172a453dSSangbeom Kim 
85172a453dSSangbeom Kim #define MOD_C2DD_HHALF		(1 << 21) /* Discard Higher-half */
86172a453dSSangbeom Kim #define MOD_C2DD_LHALF		(1 << 20) /* Discard Lower-half */
87172a453dSSangbeom Kim #define MOD_C1DD_HHALF		(1 << 19)
88172a453dSSangbeom Kim #define MOD_C1DD_LHALF		(1 << 18)
89172a453dSSangbeom Kim #define MOD_DC2_EN		(1 << 17)
90172a453dSSangbeom Kim #define MOD_DC1_EN		(1 << 16)
91172a453dSSangbeom Kim #define MOD_BLC_16BIT		(0 << 13)
92172a453dSSangbeom Kim #define MOD_BLC_8BIT		(1 << 13)
93172a453dSSangbeom Kim #define MOD_BLC_24BIT		(2 << 13)
94172a453dSSangbeom Kim #define MOD_BLC_MASK		(3 << 13)
95172a453dSSangbeom Kim 
96172a453dSSangbeom Kim #define MOD_IMS_SYSMUX		(1 << 10)
97172a453dSSangbeom Kim #define MOD_SLAVE		(1 << 11)
98172a453dSSangbeom Kim #define MOD_TXONLY		(0 << 8)
99172a453dSSangbeom Kim #define MOD_RXONLY		(1 << 8)
100172a453dSSangbeom Kim #define MOD_TXRX		(2 << 8)
101172a453dSSangbeom Kim #define MOD_MASK		(3 << 8)
102b60be4aaSPadmavathi Venna #define MOD_LRP_SHIFT		7
103b60be4aaSPadmavathi Venna #define MOD_LR_LLOW		0
104b60be4aaSPadmavathi Venna #define MOD_LR_RLOW		1
105b60be4aaSPadmavathi Venna #define MOD_SDF_SHIFT		5
106b60be4aaSPadmavathi Venna #define MOD_SDF_IIS		0
107b60be4aaSPadmavathi Venna #define MOD_SDF_MSB		1
108b60be4aaSPadmavathi Venna #define MOD_SDF_LSB		2
109b60be4aaSPadmavathi Venna #define MOD_SDF_MASK		3
110b60be4aaSPadmavathi Venna #define MOD_RCLK_SHIFT		3
111b60be4aaSPadmavathi Venna #define MOD_RCLK_256FS		0
112b60be4aaSPadmavathi Venna #define MOD_RCLK_512FS		1
113b60be4aaSPadmavathi Venna #define MOD_RCLK_384FS		2
114b60be4aaSPadmavathi Venna #define MOD_RCLK_768FS		3
115b60be4aaSPadmavathi Venna #define MOD_RCLK_MASK		3
116b60be4aaSPadmavathi Venna #define MOD_BCLK_SHIFT		1
117b60be4aaSPadmavathi Venna #define MOD_BCLK_32FS		0
118b60be4aaSPadmavathi Venna #define MOD_BCLK_48FS		1
119b60be4aaSPadmavathi Venna #define MOD_BCLK_16FS		2
120b60be4aaSPadmavathi Venna #define MOD_BCLK_24FS		3
121b60be4aaSPadmavathi Venna #define MOD_BCLK_MASK		3
122172a453dSSangbeom Kim #define MOD_8BIT		(1 << 0)
123172a453dSSangbeom Kim 
124*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_LRP_SHIFT	15
125*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_SDF_SHIFT	6
126*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_RCLK_SHIFT	4
127*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_SHIFT	0
128*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_64FS	4
129*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_96FS	5
130*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_128FS	6
131*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_192FS	7
132*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_256FS	8
133*4ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_MASK	0xf
134*4ca0c0d4SPadmavathi Venna 
135172a453dSSangbeom Kim #define MOD_CDCLKCON		(1 << 12)
136172a453dSSangbeom Kim 
137172a453dSSangbeom Kim #define PSR_PSREN		(1 << 15)
138172a453dSSangbeom Kim 
139172a453dSSangbeom Kim #define FIC_TX2COUNT(x)		(((x) >>  24) & 0xf)
140172a453dSSangbeom Kim #define FIC_TX1COUNT(x)		(((x) >>  16) & 0xf)
141172a453dSSangbeom Kim 
142172a453dSSangbeom Kim #define FIC_TXFLUSH		(1 << 15)
143172a453dSSangbeom Kim #define FIC_RXFLUSH		(1 << 7)
144766705eeSSangbeom Kim 
145172a453dSSangbeom Kim #define FIC_TXCOUNT(x)		(((x) >>  8) & 0xf)
146172a453dSSangbeom Kim #define FIC_RXCOUNT(x)		(((x) >>  0) & 0xf)
147172a453dSSangbeom Kim #define FICS_TXCOUNT(x)		(((x) >>  8) & 0x7f)
148172a453dSSangbeom Kim 
149766705eeSSangbeom Kim #define AHB_INTENLVL0		(1 << 24)
150766705eeSSangbeom Kim #define AHB_LVL0INT		(1 << 20)
151766705eeSSangbeom Kim #define AHB_CLRLVL0INT		(1 << 16)
152766705eeSSangbeom Kim #define AHB_DMARLD		(1 << 5)
153766705eeSSangbeom Kim #define AHB_INTMASK		(1 << 3)
154766705eeSSangbeom Kim #define AHB_DMAEN		(1 << 0)
155766705eeSSangbeom Kim #define AHB_LVLINTMASK		(0xf << 20)
156766705eeSSangbeom Kim 
157766705eeSSangbeom Kim #define I2SSIZE_TRNMSK		(0xffff)
158766705eeSSangbeom Kim #define I2SSIZE_SHIFT		(16)
159766705eeSSangbeom Kim 
160172a453dSSangbeom Kim #endif /* __SND_SOC_SAMSUNG_I2S_REGS_H */
161172a453dSSangbeom Kim 
162172a453dSSangbeom Kim 
163