xref: /linux/sound/soc/samsung/i2s-regs.h (revision a5a56871f804edac93a53b5e871c0e9818fb9033)
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
344ca0c0d4SPadmavathi Venna #define I2SSTR1		0x40
354ca0c0d4SPadmavathi Venna #define I2SVER		0x44
36*a5a56871SPadmavathi Venna #define I2SFIC1		0x48
374ca0c0d4SPadmavathi Venna #define I2STDM		0x4c
38*a5a56871SPadmavathi Venna #define I2SFSTA		0x50
39172a453dSSangbeom Kim 
40172a453dSSangbeom Kim #define CON_RSTCLR		(1 << 31)
41172a453dSSangbeom Kim #define CON_FRXOFSTATUS		(1 << 26)
42172a453dSSangbeom Kim #define CON_FRXORINTEN		(1 << 25)
43172a453dSSangbeom Kim #define CON_FTXSURSTAT		(1 << 24)
44172a453dSSangbeom Kim #define CON_FTXSURINTEN		(1 << 23)
45172a453dSSangbeom Kim #define CON_TXSDMA_PAUSE	(1 << 20)
46172a453dSSangbeom Kim #define CON_TXSDMA_ACTIVE	(1 << 18)
47172a453dSSangbeom Kim 
48172a453dSSangbeom Kim #define CON_FTXURSTATUS		(1 << 17)
49172a453dSSangbeom Kim #define CON_FTXURINTEN		(1 << 16)
50172a453dSSangbeom Kim #define CON_TXFIFO2_EMPTY	(1 << 15)
51172a453dSSangbeom Kim #define CON_TXFIFO1_EMPTY	(1 << 14)
52172a453dSSangbeom Kim #define CON_TXFIFO2_FULL	(1 << 13)
53172a453dSSangbeom Kim #define CON_TXFIFO1_FULL	(1 << 12)
54172a453dSSangbeom Kim 
55172a453dSSangbeom Kim #define CON_LRINDEX		(1 << 11)
56172a453dSSangbeom Kim #define CON_TXFIFO_EMPTY	(1 << 10)
57172a453dSSangbeom Kim #define CON_RXFIFO_EMPTY	(1 << 9)
58172a453dSSangbeom Kim #define CON_TXFIFO_FULL		(1 << 8)
59172a453dSSangbeom Kim #define CON_RXFIFO_FULL		(1 << 7)
60172a453dSSangbeom Kim #define CON_TXDMA_PAUSE		(1 << 6)
61172a453dSSangbeom Kim #define CON_RXDMA_PAUSE		(1 << 5)
62172a453dSSangbeom Kim #define CON_TXCH_PAUSE		(1 << 4)
63172a453dSSangbeom Kim #define CON_RXCH_PAUSE		(1 << 3)
64172a453dSSangbeom Kim #define CON_TXDMA_ACTIVE	(1 << 2)
65172a453dSSangbeom Kim #define CON_RXDMA_ACTIVE	(1 << 1)
66172a453dSSangbeom Kim #define CON_ACTIVE		(1 << 0)
67172a453dSSangbeom Kim 
68172a453dSSangbeom Kim #define MOD_OPCLK_CDCLK_OUT	(0 << 30)
69172a453dSSangbeom Kim #define MOD_OPCLK_CDCLK_IN	(1 << 30)
70172a453dSSangbeom Kim #define MOD_OPCLK_BCLK_OUT	(2 << 30)
71172a453dSSangbeom Kim #define MOD_OPCLK_PCLK		(3 << 30)
72172a453dSSangbeom Kim #define MOD_OPCLK_MASK		(3 << 30)
73172a453dSSangbeom Kim #define MOD_TXS_IDMA		(1 << 28) /* Sec_TXFIFO use I-DMA */
74172a453dSSangbeom Kim 
75172a453dSSangbeom Kim #define MOD_BLCS_SHIFT		26
76172a453dSSangbeom Kim #define MOD_BLCS_16BIT		(0 << MOD_BLCS_SHIFT)
77172a453dSSangbeom Kim #define MOD_BLCS_8BIT		(1 << MOD_BLCS_SHIFT)
78172a453dSSangbeom Kim #define MOD_BLCS_24BIT		(2 << MOD_BLCS_SHIFT)
79172a453dSSangbeom Kim #define MOD_BLCS_MASK		(3 << MOD_BLCS_SHIFT)
80172a453dSSangbeom Kim #define MOD_BLCP_SHIFT		24
81172a453dSSangbeom Kim #define MOD_BLCP_16BIT		(0 << MOD_BLCP_SHIFT)
82172a453dSSangbeom Kim #define MOD_BLCP_8BIT		(1 << MOD_BLCP_SHIFT)
83172a453dSSangbeom Kim #define MOD_BLCP_24BIT		(2 << MOD_BLCP_SHIFT)
84172a453dSSangbeom Kim #define MOD_BLCP_MASK		(3 << MOD_BLCP_SHIFT)
85172a453dSSangbeom Kim 
86172a453dSSangbeom Kim #define MOD_C2DD_HHALF		(1 << 21) /* Discard Higher-half */
87172a453dSSangbeom Kim #define MOD_C2DD_LHALF		(1 << 20) /* Discard Lower-half */
88172a453dSSangbeom Kim #define MOD_C1DD_HHALF		(1 << 19)
89172a453dSSangbeom Kim #define MOD_C1DD_LHALF		(1 << 18)
90172a453dSSangbeom Kim #define MOD_DC2_EN		(1 << 17)
91172a453dSSangbeom Kim #define MOD_DC1_EN		(1 << 16)
92172a453dSSangbeom Kim #define MOD_BLC_16BIT		(0 << 13)
93172a453dSSangbeom Kim #define MOD_BLC_8BIT		(1 << 13)
94172a453dSSangbeom Kim #define MOD_BLC_24BIT		(2 << 13)
95172a453dSSangbeom Kim #define MOD_BLC_MASK		(3 << 13)
96172a453dSSangbeom Kim 
97172a453dSSangbeom Kim #define MOD_TXONLY		(0 << 8)
98172a453dSSangbeom Kim #define MOD_RXONLY		(1 << 8)
99172a453dSSangbeom Kim #define MOD_TXRX		(2 << 8)
100172a453dSSangbeom Kim #define MOD_MASK		(3 << 8)
101b60be4aaSPadmavathi Venna #define MOD_LRP_SHIFT		7
102b60be4aaSPadmavathi Venna #define MOD_LR_LLOW		0
103b60be4aaSPadmavathi Venna #define MOD_LR_RLOW		1
104b60be4aaSPadmavathi Venna #define MOD_SDF_SHIFT		5
105b60be4aaSPadmavathi Venna #define MOD_SDF_IIS		0
106b60be4aaSPadmavathi Venna #define MOD_SDF_MSB		1
107b60be4aaSPadmavathi Venna #define MOD_SDF_LSB		2
108b60be4aaSPadmavathi Venna #define MOD_SDF_MASK		3
109b60be4aaSPadmavathi Venna #define MOD_RCLK_SHIFT		3
110b60be4aaSPadmavathi Venna #define MOD_RCLK_256FS		0
111b60be4aaSPadmavathi Venna #define MOD_RCLK_512FS		1
112b60be4aaSPadmavathi Venna #define MOD_RCLK_384FS		2
113b60be4aaSPadmavathi Venna #define MOD_RCLK_768FS		3
114b60be4aaSPadmavathi Venna #define MOD_RCLK_MASK		3
115b60be4aaSPadmavathi Venna #define MOD_BCLK_SHIFT		1
116b60be4aaSPadmavathi Venna #define MOD_BCLK_32FS		0
117b60be4aaSPadmavathi Venna #define MOD_BCLK_48FS		1
118b60be4aaSPadmavathi Venna #define MOD_BCLK_16FS		2
119b60be4aaSPadmavathi Venna #define MOD_BCLK_24FS		3
120b60be4aaSPadmavathi Venna #define MOD_BCLK_MASK		3
121172a453dSSangbeom Kim #define MOD_8BIT		(1 << 0)
122172a453dSSangbeom Kim 
1234ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_LRP_SHIFT	15
1244ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_SDF_SHIFT	6
1254ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_RCLK_SHIFT	4
1264ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_SHIFT	0
1274ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_64FS	4
1284ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_96FS	5
1294ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_128FS	6
1304ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_192FS	7
1314ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_256FS	8
1324ca0c0d4SPadmavathi Venna #define EXYNOS5420_MOD_BCLK_MASK	0xf
1334ca0c0d4SPadmavathi Venna 
134*a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_64FS	4
135*a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_128FS	5
136*a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_96FS	6
137*a5a56871SPadmavathi Venna #define EXYNOS7_MOD_RCLK_192FS	7
138172a453dSSangbeom Kim 
139172a453dSSangbeom Kim #define PSR_PSREN		(1 << 15)
140172a453dSSangbeom Kim 
141172a453dSSangbeom Kim #define FIC_TX2COUNT(x)		(((x) >>  24) & 0xf)
142172a453dSSangbeom Kim #define FIC_TX1COUNT(x)		(((x) >>  16) & 0xf)
143172a453dSSangbeom Kim 
144172a453dSSangbeom Kim #define FIC_TXFLUSH		(1 << 15)
145172a453dSSangbeom Kim #define FIC_RXFLUSH		(1 << 7)
146766705eeSSangbeom Kim 
147172a453dSSangbeom Kim #define FIC_TXCOUNT(x)		(((x) >>  8) & 0xf)
148172a453dSSangbeom Kim #define FIC_RXCOUNT(x)		(((x) >>  0) & 0xf)
149172a453dSSangbeom Kim #define FICS_TXCOUNT(x)		(((x) >>  8) & 0x7f)
150172a453dSSangbeom Kim 
151766705eeSSangbeom Kim #define AHB_INTENLVL0		(1 << 24)
152766705eeSSangbeom Kim #define AHB_LVL0INT		(1 << 20)
153766705eeSSangbeom Kim #define AHB_CLRLVL0INT		(1 << 16)
154766705eeSSangbeom Kim #define AHB_DMARLD		(1 << 5)
155766705eeSSangbeom Kim #define AHB_INTMASK		(1 << 3)
156766705eeSSangbeom Kim #define AHB_DMAEN		(1 << 0)
157766705eeSSangbeom Kim #define AHB_LVLINTMASK		(0xf << 20)
158766705eeSSangbeom Kim 
159766705eeSSangbeom Kim #define I2SSIZE_TRNMSK		(0xffff)
160766705eeSSangbeom Kim #define I2SSIZE_SHIFT		(16)
161766705eeSSangbeom Kim 
162172a453dSSangbeom Kim #endif /* __SND_SOC_SAMSUNG_I2S_REGS_H */
163172a453dSSangbeom Kim 
164172a453dSSangbeom Kim 
165