18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2011 Samsung Electronics Co., Ltd.
48c2ecf20Sopenharmony_ci *		http://www.samsung.com
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Samsung I2S driver's register header
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __SND_SOC_SAMSUNG_I2S_REGS_H
108c2ecf20Sopenharmony_ci#define __SND_SOC_SAMSUNG_I2S_REGS_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define I2SCON		0x0
138c2ecf20Sopenharmony_ci#define I2SMOD		0x4
148c2ecf20Sopenharmony_ci#define I2SFIC		0x8
158c2ecf20Sopenharmony_ci#define I2SPSR		0xc
168c2ecf20Sopenharmony_ci#define I2STXD		0x10
178c2ecf20Sopenharmony_ci#define I2SRXD		0x14
188c2ecf20Sopenharmony_ci#define I2SFICS		0x18
198c2ecf20Sopenharmony_ci#define I2STXDS		0x1c
208c2ecf20Sopenharmony_ci#define I2SAHB		0x20
218c2ecf20Sopenharmony_ci#define I2SSTR0		0x24
228c2ecf20Sopenharmony_ci#define I2SSIZE		0x28
238c2ecf20Sopenharmony_ci#define I2STRNCNT	0x2c
248c2ecf20Sopenharmony_ci#define I2SLVL0ADDR	0x30
258c2ecf20Sopenharmony_ci#define I2SLVL1ADDR	0x34
268c2ecf20Sopenharmony_ci#define I2SLVL2ADDR	0x38
278c2ecf20Sopenharmony_ci#define I2SLVL3ADDR	0x3c
288c2ecf20Sopenharmony_ci#define I2SSTR1		0x40
298c2ecf20Sopenharmony_ci#define I2SVER		0x44
308c2ecf20Sopenharmony_ci#define I2SFIC1		0x48
318c2ecf20Sopenharmony_ci#define I2STDM		0x4c
328c2ecf20Sopenharmony_ci#define I2SFSTA		0x50
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define CON_RSTCLR		(1 << 31)
358c2ecf20Sopenharmony_ci#define CON_FRXOFSTATUS		(1 << 26)
368c2ecf20Sopenharmony_ci#define CON_FRXORINTEN		(1 << 25)
378c2ecf20Sopenharmony_ci#define CON_FTXSURSTAT		(1 << 24)
388c2ecf20Sopenharmony_ci#define CON_FTXSURINTEN		(1 << 23)
398c2ecf20Sopenharmony_ci#define CON_TXSDMA_PAUSE	(1 << 20)
408c2ecf20Sopenharmony_ci#define CON_TXSDMA_ACTIVE	(1 << 18)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define CON_FTXURSTATUS		(1 << 17)
438c2ecf20Sopenharmony_ci#define CON_FTXURINTEN		(1 << 16)
448c2ecf20Sopenharmony_ci#define CON_TXFIFO2_EMPTY	(1 << 15)
458c2ecf20Sopenharmony_ci#define CON_TXFIFO1_EMPTY	(1 << 14)
468c2ecf20Sopenharmony_ci#define CON_TXFIFO2_FULL	(1 << 13)
478c2ecf20Sopenharmony_ci#define CON_TXFIFO1_FULL	(1 << 12)
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define CON_LRINDEX		(1 << 11)
508c2ecf20Sopenharmony_ci#define CON_TXFIFO_EMPTY	(1 << 10)
518c2ecf20Sopenharmony_ci#define CON_RXFIFO_EMPTY	(1 << 9)
528c2ecf20Sopenharmony_ci#define CON_TXFIFO_FULL		(1 << 8)
538c2ecf20Sopenharmony_ci#define CON_RXFIFO_FULL		(1 << 7)
548c2ecf20Sopenharmony_ci#define CON_TXDMA_PAUSE		(1 << 6)
558c2ecf20Sopenharmony_ci#define CON_RXDMA_PAUSE		(1 << 5)
568c2ecf20Sopenharmony_ci#define CON_TXCH_PAUSE		(1 << 4)
578c2ecf20Sopenharmony_ci#define CON_RXCH_PAUSE		(1 << 3)
588c2ecf20Sopenharmony_ci#define CON_TXDMA_ACTIVE	(1 << 2)
598c2ecf20Sopenharmony_ci#define CON_RXDMA_ACTIVE	(1 << 1)
608c2ecf20Sopenharmony_ci#define CON_ACTIVE		(1 << 0)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define MOD_OPCLK_SHIFT		30
638c2ecf20Sopenharmony_ci#define MOD_OPCLK_CDCLK_OUT	(0 << MOD_OPCLK_SHIFT)
648c2ecf20Sopenharmony_ci#define MOD_OPCLK_CDCLK_IN	(1 << MOD_OPCLK_SHIFT)
658c2ecf20Sopenharmony_ci#define MOD_OPCLK_BCLK_OUT	(2 << MOD_OPCLK_SHIFT)
668c2ecf20Sopenharmony_ci#define MOD_OPCLK_PCLK		(3 << MOD_OPCLK_SHIFT)
678c2ecf20Sopenharmony_ci#define MOD_OPCLK_MASK		(3 << MOD_OPCLK_SHIFT)
688c2ecf20Sopenharmony_ci#define MOD_TXS_IDMA		(1 << 28) /* Sec_TXFIFO use I-DMA */
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define MOD_BLCS_SHIFT		26
718c2ecf20Sopenharmony_ci#define MOD_BLCS_16BIT		(0 << MOD_BLCS_SHIFT)
728c2ecf20Sopenharmony_ci#define MOD_BLCS_8BIT		(1 << MOD_BLCS_SHIFT)
738c2ecf20Sopenharmony_ci#define MOD_BLCS_24BIT		(2 << MOD_BLCS_SHIFT)
748c2ecf20Sopenharmony_ci#define MOD_BLCS_MASK		(3 << MOD_BLCS_SHIFT)
758c2ecf20Sopenharmony_ci#define MOD_BLCP_SHIFT		24
768c2ecf20Sopenharmony_ci#define MOD_BLCP_16BIT		(0 << MOD_BLCP_SHIFT)
778c2ecf20Sopenharmony_ci#define MOD_BLCP_8BIT		(1 << MOD_BLCP_SHIFT)
788c2ecf20Sopenharmony_ci#define MOD_BLCP_24BIT		(2 << MOD_BLCP_SHIFT)
798c2ecf20Sopenharmony_ci#define MOD_BLCP_MASK		(3 << MOD_BLCP_SHIFT)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define MOD_C2DD_HHALF		(1 << 21) /* Discard Higher-half */
828c2ecf20Sopenharmony_ci#define MOD_C2DD_LHALF		(1 << 20) /* Discard Lower-half */
838c2ecf20Sopenharmony_ci#define MOD_C1DD_HHALF		(1 << 19)
848c2ecf20Sopenharmony_ci#define MOD_C1DD_LHALF		(1 << 18)
858c2ecf20Sopenharmony_ci#define MOD_DC2_EN		(1 << 17)
868c2ecf20Sopenharmony_ci#define MOD_DC1_EN		(1 << 16)
878c2ecf20Sopenharmony_ci#define MOD_BLC_16BIT		(0 << 13)
888c2ecf20Sopenharmony_ci#define MOD_BLC_8BIT		(1 << 13)
898c2ecf20Sopenharmony_ci#define MOD_BLC_24BIT		(2 << 13)
908c2ecf20Sopenharmony_ci#define MOD_BLC_MASK		(3 << 13)
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define MOD_TXONLY		(0 << 8)
938c2ecf20Sopenharmony_ci#define MOD_RXONLY		(1 << 8)
948c2ecf20Sopenharmony_ci#define MOD_TXRX		(2 << 8)
958c2ecf20Sopenharmony_ci#define MOD_MASK		(3 << 8)
968c2ecf20Sopenharmony_ci#define MOD_LRP_SHIFT		7
978c2ecf20Sopenharmony_ci#define MOD_LR_LLOW		0
988c2ecf20Sopenharmony_ci#define MOD_LR_RLOW		1
998c2ecf20Sopenharmony_ci#define MOD_SDF_SHIFT		5
1008c2ecf20Sopenharmony_ci#define MOD_SDF_IIS		0
1018c2ecf20Sopenharmony_ci#define MOD_SDF_MSB		1
1028c2ecf20Sopenharmony_ci#define MOD_SDF_LSB		2
1038c2ecf20Sopenharmony_ci#define MOD_SDF_MASK		3
1048c2ecf20Sopenharmony_ci#define MOD_RCLK_SHIFT		3
1058c2ecf20Sopenharmony_ci#define MOD_RCLK_256FS		0
1068c2ecf20Sopenharmony_ci#define MOD_RCLK_512FS		1
1078c2ecf20Sopenharmony_ci#define MOD_RCLK_384FS		2
1088c2ecf20Sopenharmony_ci#define MOD_RCLK_768FS		3
1098c2ecf20Sopenharmony_ci#define MOD_RCLK_MASK		3
1108c2ecf20Sopenharmony_ci#define MOD_BCLK_SHIFT		1
1118c2ecf20Sopenharmony_ci#define MOD_BCLK_32FS		0
1128c2ecf20Sopenharmony_ci#define MOD_BCLK_48FS		1
1138c2ecf20Sopenharmony_ci#define MOD_BCLK_16FS		2
1148c2ecf20Sopenharmony_ci#define MOD_BCLK_24FS		3
1158c2ecf20Sopenharmony_ci#define MOD_BCLK_MASK		3
1168c2ecf20Sopenharmony_ci#define MOD_8BIT		(1 << 0)
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_LRP_SHIFT	15
1198c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_SDF_SHIFT	6
1208c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_RCLK_SHIFT	4
1218c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_SHIFT	0
1228c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_64FS	4
1238c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_96FS	5
1248c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_128FS	6
1258c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_192FS	7
1268c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_256FS	8
1278c2ecf20Sopenharmony_ci#define EXYNOS5420_MOD_BCLK_MASK	0xf
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define EXYNOS7_MOD_RCLK_64FS	4
1308c2ecf20Sopenharmony_ci#define EXYNOS7_MOD_RCLK_128FS	5
1318c2ecf20Sopenharmony_ci#define EXYNOS7_MOD_RCLK_96FS	6
1328c2ecf20Sopenharmony_ci#define EXYNOS7_MOD_RCLK_192FS	7
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci#define PSR_PSREN		(1 << 15)
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define FIC_TX2COUNT(x)		(((x) >>  24) & 0xf)
1378c2ecf20Sopenharmony_ci#define FIC_TX1COUNT(x)		(((x) >>  16) & 0xf)
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define FIC_TXFLUSH		(1 << 15)
1408c2ecf20Sopenharmony_ci#define FIC_RXFLUSH		(1 << 7)
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci#define FIC_TXCOUNT(x)		(((x) >>  8) & 0xf)
1438c2ecf20Sopenharmony_ci#define FIC_RXCOUNT(x)		(((x) >>  0) & 0xf)
1448c2ecf20Sopenharmony_ci#define FICS_TXCOUNT(x)		(((x) >>  8) & 0x7f)
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#define AHB_INTENLVL0		(1 << 24)
1478c2ecf20Sopenharmony_ci#define AHB_LVL0INT		(1 << 20)
1488c2ecf20Sopenharmony_ci#define AHB_CLRLVL0INT		(1 << 16)
1498c2ecf20Sopenharmony_ci#define AHB_DMARLD		(1 << 5)
1508c2ecf20Sopenharmony_ci#define AHB_INTMASK		(1 << 3)
1518c2ecf20Sopenharmony_ci#define AHB_DMAEN		(1 << 0)
1528c2ecf20Sopenharmony_ci#define AHB_LVLINTMASK		(0xf << 20)
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci#define I2SSIZE_TRNMSK		(0xffff)
1558c2ecf20Sopenharmony_ci#define I2SSIZE_SHIFT		(16)
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#endif /* __SND_SOC_SAMSUNG_I2S_REGS_H */
158