18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * fsl_ssi.h - ALSA SSI interface for the Freescale MPC8610 and i.MX SoC
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Author: Timur Tabi <timur@freescale.com>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright 2007-2008 Freescale Semiconductor, Inc.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _MPC8610_I2S_H
118c2ecf20Sopenharmony_ci#define _MPC8610_I2S_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* -- SSI Register Map -- */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* SSI Transmit Data Register 0 */
168c2ecf20Sopenharmony_ci#define REG_SSI_STX0			0x00
178c2ecf20Sopenharmony_ci/* SSI Transmit Data Register 1 */
188c2ecf20Sopenharmony_ci#define REG_SSI_STX1			0x04
198c2ecf20Sopenharmony_ci/* SSI Receive Data Register 0 */
208c2ecf20Sopenharmony_ci#define REG_SSI_SRX0			0x08
218c2ecf20Sopenharmony_ci/* SSI Receive Data Register 1 */
228c2ecf20Sopenharmony_ci#define REG_SSI_SRX1			0x0c
238c2ecf20Sopenharmony_ci/* SSI Control Register */
248c2ecf20Sopenharmony_ci#define REG_SSI_SCR			0x10
258c2ecf20Sopenharmony_ci/* SSI Interrupt Status Register */
268c2ecf20Sopenharmony_ci#define REG_SSI_SISR			0x14
278c2ecf20Sopenharmony_ci/* SSI Interrupt Enable Register */
288c2ecf20Sopenharmony_ci#define REG_SSI_SIER			0x18
298c2ecf20Sopenharmony_ci/* SSI Transmit Configuration Register */
308c2ecf20Sopenharmony_ci#define REG_SSI_STCR			0x1c
318c2ecf20Sopenharmony_ci/* SSI Receive Configuration Register */
328c2ecf20Sopenharmony_ci#define REG_SSI_SRCR			0x20
338c2ecf20Sopenharmony_ci#define REG_SSI_SxCR(tx)		((tx) ? REG_SSI_STCR : REG_SSI_SRCR)
348c2ecf20Sopenharmony_ci/* SSI Transmit Clock Control Register */
358c2ecf20Sopenharmony_ci#define REG_SSI_STCCR			0x24
368c2ecf20Sopenharmony_ci/* SSI Receive Clock Control Register */
378c2ecf20Sopenharmony_ci#define REG_SSI_SRCCR			0x28
388c2ecf20Sopenharmony_ci#define REG_SSI_SxCCR(tx)		((tx) ? REG_SSI_STCCR : REG_SSI_SRCCR)
398c2ecf20Sopenharmony_ci/* SSI FIFO Control/Status Register */
408c2ecf20Sopenharmony_ci#define REG_SSI_SFCSR			0x2c
418c2ecf20Sopenharmony_ci/*
428c2ecf20Sopenharmony_ci * SSI Test Register (Intended for debugging purposes only)
438c2ecf20Sopenharmony_ci *
448c2ecf20Sopenharmony_ci * Note: STR is not documented in recent IMX datasheet, but
458c2ecf20Sopenharmony_ci * is described in IMX51 reference manual at section 56.3.3.14
468c2ecf20Sopenharmony_ci */
478c2ecf20Sopenharmony_ci#define REG_SSI_STR			0x30
488c2ecf20Sopenharmony_ci/*
498c2ecf20Sopenharmony_ci * SSI Option Register (Intended for internal use only)
508c2ecf20Sopenharmony_ci *
518c2ecf20Sopenharmony_ci * Note: SOR is not documented in recent IMX datasheet, but
528c2ecf20Sopenharmony_ci * is described in IMX51 reference manual at section 56.3.3.15
538c2ecf20Sopenharmony_ci */
548c2ecf20Sopenharmony_ci#define REG_SSI_SOR			0x34
558c2ecf20Sopenharmony_ci/* SSI AC97 Control Register */
568c2ecf20Sopenharmony_ci#define REG_SSI_SACNT			0x38
578c2ecf20Sopenharmony_ci/* SSI AC97 Command Address Register */
588c2ecf20Sopenharmony_ci#define REG_SSI_SACADD			0x3c
598c2ecf20Sopenharmony_ci/* SSI AC97 Command Data Register */
608c2ecf20Sopenharmony_ci#define REG_SSI_SACDAT			0x40
618c2ecf20Sopenharmony_ci/* SSI AC97 Tag Register */
628c2ecf20Sopenharmony_ci#define REG_SSI_SATAG			0x44
638c2ecf20Sopenharmony_ci/* SSI Transmit Time Slot Mask Register */
648c2ecf20Sopenharmony_ci#define REG_SSI_STMSK			0x48
658c2ecf20Sopenharmony_ci/* SSI  Receive Time Slot Mask Register */
668c2ecf20Sopenharmony_ci#define REG_SSI_SRMSK			0x4c
678c2ecf20Sopenharmony_ci#define REG_SSI_SxMSK(tx)		((tx) ? REG_SSI_STMSK : REG_SSI_SRMSK)
688c2ecf20Sopenharmony_ci/*
698c2ecf20Sopenharmony_ci * SSI AC97 Channel Status Register
708c2ecf20Sopenharmony_ci *
718c2ecf20Sopenharmony_ci * The status could be changed by:
728c2ecf20Sopenharmony_ci * 1) Writing a '1' bit at some position in SACCEN sets relevant bit in SACCST
738c2ecf20Sopenharmony_ci * 2) Writing a '1' bit at some position in SACCDIS unsets the relevant bit
748c2ecf20Sopenharmony_ci * 3) Receivng a '1' in SLOTREQ bit from external CODEC via AC Link
758c2ecf20Sopenharmony_ci */
768c2ecf20Sopenharmony_ci#define REG_SSI_SACCST			0x50
778c2ecf20Sopenharmony_ci/* SSI AC97 Channel Enable Register -- Set bits in SACCST */
788c2ecf20Sopenharmony_ci#define REG_SSI_SACCEN			0x54
798c2ecf20Sopenharmony_ci/* SSI AC97 Channel Disable Register -- Clear bits in SACCST */
808c2ecf20Sopenharmony_ci#define REG_SSI_SACCDIS			0x58
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* -- SSI Register Field Maps -- */
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci/* SSI Control Register -- REG_SSI_SCR 0x10 */
858c2ecf20Sopenharmony_ci#define SSI_SCR_SYNC_TX_FS		0x00001000
868c2ecf20Sopenharmony_ci#define SSI_SCR_RFR_CLK_DIS		0x00000800
878c2ecf20Sopenharmony_ci#define SSI_SCR_TFR_CLK_DIS		0x00000400
888c2ecf20Sopenharmony_ci#define SSI_SCR_TCH_EN			0x00000100
898c2ecf20Sopenharmony_ci#define SSI_SCR_SYS_CLK_EN		0x00000080
908c2ecf20Sopenharmony_ci#define SSI_SCR_I2S_MODE_MASK		0x00000060
918c2ecf20Sopenharmony_ci#define SSI_SCR_I2S_MODE_NORMAL		0x00000000
928c2ecf20Sopenharmony_ci#define SSI_SCR_I2S_MODE_MASTER		0x00000020
938c2ecf20Sopenharmony_ci#define SSI_SCR_I2S_MODE_SLAVE		0x00000040
948c2ecf20Sopenharmony_ci#define SSI_SCR_SYN			0x00000010
958c2ecf20Sopenharmony_ci#define SSI_SCR_NET			0x00000008
968c2ecf20Sopenharmony_ci#define SSI_SCR_I2S_NET_MASK		(SSI_SCR_NET | SSI_SCR_I2S_MODE_MASK)
978c2ecf20Sopenharmony_ci#define SSI_SCR_RE			0x00000004
988c2ecf20Sopenharmony_ci#define SSI_SCR_TE			0x00000002
998c2ecf20Sopenharmony_ci#define SSI_SCR_SSIEN			0x00000001
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/* SSI Interrupt Status Register -- REG_SSI_SISR 0x14 */
1028c2ecf20Sopenharmony_ci#define SSI_SISR_RFRC			0x01000000
1038c2ecf20Sopenharmony_ci#define SSI_SISR_TFRC			0x00800000
1048c2ecf20Sopenharmony_ci#define SSI_SISR_CMDAU			0x00040000
1058c2ecf20Sopenharmony_ci#define SSI_SISR_CMDDU			0x00020000
1068c2ecf20Sopenharmony_ci#define SSI_SISR_RXT			0x00010000
1078c2ecf20Sopenharmony_ci#define SSI_SISR_RDR1			0x00008000
1088c2ecf20Sopenharmony_ci#define SSI_SISR_RDR0			0x00004000
1098c2ecf20Sopenharmony_ci#define SSI_SISR_TDE1			0x00002000
1108c2ecf20Sopenharmony_ci#define SSI_SISR_TDE0			0x00001000
1118c2ecf20Sopenharmony_ci#define SSI_SISR_ROE1			0x00000800
1128c2ecf20Sopenharmony_ci#define SSI_SISR_ROE0			0x00000400
1138c2ecf20Sopenharmony_ci#define SSI_SISR_TUE1			0x00000200
1148c2ecf20Sopenharmony_ci#define SSI_SISR_TUE0			0x00000100
1158c2ecf20Sopenharmony_ci#define SSI_SISR_TFS			0x00000080
1168c2ecf20Sopenharmony_ci#define SSI_SISR_RFS			0x00000040
1178c2ecf20Sopenharmony_ci#define SSI_SISR_TLS			0x00000020
1188c2ecf20Sopenharmony_ci#define SSI_SISR_RLS			0x00000010
1198c2ecf20Sopenharmony_ci#define SSI_SISR_RFF1			0x00000008
1208c2ecf20Sopenharmony_ci#define SSI_SISR_RFF0			0x00000004
1218c2ecf20Sopenharmony_ci#define SSI_SISR_TFE1			0x00000002
1228c2ecf20Sopenharmony_ci#define SSI_SISR_TFE0			0x00000001
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* SSI Interrupt Enable Register -- REG_SSI_SIER 0x18 */
1258c2ecf20Sopenharmony_ci#define SSI_SIER_RFRC_EN		0x01000000
1268c2ecf20Sopenharmony_ci#define SSI_SIER_TFRC_EN		0x00800000
1278c2ecf20Sopenharmony_ci#define SSI_SIER_RDMAE			0x00400000
1288c2ecf20Sopenharmony_ci#define SSI_SIER_RIE			0x00200000
1298c2ecf20Sopenharmony_ci#define SSI_SIER_TDMAE			0x00100000
1308c2ecf20Sopenharmony_ci#define SSI_SIER_TIE			0x00080000
1318c2ecf20Sopenharmony_ci#define SSI_SIER_CMDAU_EN		0x00040000
1328c2ecf20Sopenharmony_ci#define SSI_SIER_CMDDU_EN		0x00020000
1338c2ecf20Sopenharmony_ci#define SSI_SIER_RXT_EN			0x00010000
1348c2ecf20Sopenharmony_ci#define SSI_SIER_RDR1_EN		0x00008000
1358c2ecf20Sopenharmony_ci#define SSI_SIER_RDR0_EN		0x00004000
1368c2ecf20Sopenharmony_ci#define SSI_SIER_TDE1_EN		0x00002000
1378c2ecf20Sopenharmony_ci#define SSI_SIER_TDE0_EN		0x00001000
1388c2ecf20Sopenharmony_ci#define SSI_SIER_ROE1_EN		0x00000800
1398c2ecf20Sopenharmony_ci#define SSI_SIER_ROE0_EN		0x00000400
1408c2ecf20Sopenharmony_ci#define SSI_SIER_TUE1_EN		0x00000200
1418c2ecf20Sopenharmony_ci#define SSI_SIER_TUE0_EN		0x00000100
1428c2ecf20Sopenharmony_ci#define SSI_SIER_TFS_EN			0x00000080
1438c2ecf20Sopenharmony_ci#define SSI_SIER_RFS_EN			0x00000040
1448c2ecf20Sopenharmony_ci#define SSI_SIER_TLS_EN			0x00000020
1458c2ecf20Sopenharmony_ci#define SSI_SIER_RLS_EN			0x00000010
1468c2ecf20Sopenharmony_ci#define SSI_SIER_RFF1_EN		0x00000008
1478c2ecf20Sopenharmony_ci#define SSI_SIER_RFF0_EN		0x00000004
1488c2ecf20Sopenharmony_ci#define SSI_SIER_TFE1_EN		0x00000002
1498c2ecf20Sopenharmony_ci#define SSI_SIER_TFE0_EN		0x00000001
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci/* SSI Transmit Configuration Register -- REG_SSI_STCR 0x1C */
1528c2ecf20Sopenharmony_ci#define SSI_STCR_TXBIT0			0x00000200
1538c2ecf20Sopenharmony_ci#define SSI_STCR_TFEN1			0x00000100
1548c2ecf20Sopenharmony_ci#define SSI_STCR_TFEN0			0x00000080
1558c2ecf20Sopenharmony_ci#define SSI_STCR_TFDIR			0x00000040
1568c2ecf20Sopenharmony_ci#define SSI_STCR_TXDIR			0x00000020
1578c2ecf20Sopenharmony_ci#define SSI_STCR_TSHFD			0x00000010
1588c2ecf20Sopenharmony_ci#define SSI_STCR_TSCKP			0x00000008
1598c2ecf20Sopenharmony_ci#define SSI_STCR_TFSI			0x00000004
1608c2ecf20Sopenharmony_ci#define SSI_STCR_TFSL			0x00000002
1618c2ecf20Sopenharmony_ci#define SSI_STCR_TEFS			0x00000001
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci/* SSI Receive Configuration Register -- REG_SSI_SRCR 0x20 */
1648c2ecf20Sopenharmony_ci#define SSI_SRCR_RXEXT			0x00000400
1658c2ecf20Sopenharmony_ci#define SSI_SRCR_RXBIT0			0x00000200
1668c2ecf20Sopenharmony_ci#define SSI_SRCR_RFEN1			0x00000100
1678c2ecf20Sopenharmony_ci#define SSI_SRCR_RFEN0			0x00000080
1688c2ecf20Sopenharmony_ci#define SSI_SRCR_RFDIR			0x00000040
1698c2ecf20Sopenharmony_ci#define SSI_SRCR_RXDIR			0x00000020
1708c2ecf20Sopenharmony_ci#define SSI_SRCR_RSHFD			0x00000010
1718c2ecf20Sopenharmony_ci#define SSI_SRCR_RSCKP			0x00000008
1728c2ecf20Sopenharmony_ci#define SSI_SRCR_RFSI			0x00000004
1738c2ecf20Sopenharmony_ci#define SSI_SRCR_RFSL			0x00000002
1748c2ecf20Sopenharmony_ci#define SSI_SRCR_REFS			0x00000001
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci/*
1778c2ecf20Sopenharmony_ci * SSI Transmit Clock Control Register -- REG_SSI_STCCR 0x24
1788c2ecf20Sopenharmony_ci * SSI Receive Clock Control Register -- REG_SSI_SRCCR 0x28
1798c2ecf20Sopenharmony_ci */
1808c2ecf20Sopenharmony_ci#define SSI_SxCCR_DIV2_SHIFT		18
1818c2ecf20Sopenharmony_ci#define SSI_SxCCR_DIV2			0x00040000
1828c2ecf20Sopenharmony_ci#define SSI_SxCCR_PSR_SHIFT		17
1838c2ecf20Sopenharmony_ci#define SSI_SxCCR_PSR			0x00020000
1848c2ecf20Sopenharmony_ci#define SSI_SxCCR_WL_SHIFT		13
1858c2ecf20Sopenharmony_ci#define SSI_SxCCR_WL_MASK		0x0001E000
1868c2ecf20Sopenharmony_ci#define SSI_SxCCR_WL(x) \
1878c2ecf20Sopenharmony_ci	(((((x) / 2) - 1) << SSI_SxCCR_WL_SHIFT) & SSI_SxCCR_WL_MASK)
1888c2ecf20Sopenharmony_ci#define SSI_SxCCR_DC_SHIFT		8
1898c2ecf20Sopenharmony_ci#define SSI_SxCCR_DC_MASK		0x00001F00
1908c2ecf20Sopenharmony_ci#define SSI_SxCCR_DC(x) \
1918c2ecf20Sopenharmony_ci	((((x) - 1) << SSI_SxCCR_DC_SHIFT) & SSI_SxCCR_DC_MASK)
1928c2ecf20Sopenharmony_ci#define SSI_SxCCR_PM_SHIFT		0
1938c2ecf20Sopenharmony_ci#define SSI_SxCCR_PM_MASK		0x000000FF
1948c2ecf20Sopenharmony_ci#define SSI_SxCCR_PM(x) \
1958c2ecf20Sopenharmony_ci	((((x) - 1) << SSI_SxCCR_PM_SHIFT) & SSI_SxCCR_PM_MASK)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci/*
1988c2ecf20Sopenharmony_ci * SSI FIFO Control/Status Register -- REG_SSI_SFCSR 0x2c
1998c2ecf20Sopenharmony_ci *
2008c2ecf20Sopenharmony_ci * Tx or Rx FIFO Counter -- SSI_SFCSR_xFCNTy Read-Only
2018c2ecf20Sopenharmony_ci * Tx or Rx FIFO Watermarks -- SSI_SFCSR_xFWMy Read/Write
2028c2ecf20Sopenharmony_ci */
2038c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT1_SHIFT		28
2048c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT1_MASK		0xF0000000
2058c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT1(x) \
2068c2ecf20Sopenharmony_ci	(((x) & SSI_SFCSR_RFCNT1_MASK) >> SSI_SFCSR_RFCNT1_SHIFT)
2078c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT1_SHIFT		24
2088c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT1_MASK		0x0F000000
2098c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT1(x) \
2108c2ecf20Sopenharmony_ci	(((x) & SSI_SFCSR_TFCNT1_MASK) >> SSI_SFCSR_TFCNT1_SHIFT)
2118c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM1_SHIFT		20
2128c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM1_MASK		0x00F00000
2138c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM1(x)	\
2148c2ecf20Sopenharmony_ci	(((x) << SSI_SFCSR_RFWM1_SHIFT) & SSI_SFCSR_RFWM1_MASK)
2158c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM1_SHIFT		16
2168c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM1_MASK		0x000F0000
2178c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM1(x)	\
2188c2ecf20Sopenharmony_ci	(((x) << SSI_SFCSR_TFWM1_SHIFT) & SSI_SFCSR_TFWM1_MASK)
2198c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT0_SHIFT		12
2208c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT0_MASK		0x0000F000
2218c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFCNT0(x) \
2228c2ecf20Sopenharmony_ci	(((x) & SSI_SFCSR_RFCNT0_MASK) >> SSI_SFCSR_RFCNT0_SHIFT)
2238c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT0_SHIFT		8
2248c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT0_MASK		0x00000F00
2258c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFCNT0(x) \
2268c2ecf20Sopenharmony_ci	(((x) & SSI_SFCSR_TFCNT0_MASK) >> SSI_SFCSR_TFCNT0_SHIFT)
2278c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM0_SHIFT		4
2288c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM0_MASK		0x000000F0
2298c2ecf20Sopenharmony_ci#define SSI_SFCSR_RFWM0(x)	\
2308c2ecf20Sopenharmony_ci	(((x) << SSI_SFCSR_RFWM0_SHIFT) & SSI_SFCSR_RFWM0_MASK)
2318c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM0_SHIFT		0
2328c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM0_MASK		0x0000000F
2338c2ecf20Sopenharmony_ci#define SSI_SFCSR_TFWM0(x)	\
2348c2ecf20Sopenharmony_ci	(((x) << SSI_SFCSR_TFWM0_SHIFT) & SSI_SFCSR_TFWM0_MASK)
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/* SSI Test Register -- REG_SSI_STR 0x30 */
2378c2ecf20Sopenharmony_ci#define SSI_STR_TEST			0x00008000
2388c2ecf20Sopenharmony_ci#define SSI_STR_RCK2TCK			0x00004000
2398c2ecf20Sopenharmony_ci#define SSI_STR_RFS2TFS			0x00002000
2408c2ecf20Sopenharmony_ci#define SSI_STR_RXSTATE(x)		(((x) >> 8) & 0x1F)
2418c2ecf20Sopenharmony_ci#define SSI_STR_TXD2RXD			0x00000080
2428c2ecf20Sopenharmony_ci#define SSI_STR_TCK2RCK			0x00000040
2438c2ecf20Sopenharmony_ci#define SSI_STR_TFS2RFS			0x00000020
2448c2ecf20Sopenharmony_ci#define SSI_STR_TXSTATE(x)		((x) & 0x1F)
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/* SSI Option Register -- REG_SSI_SOR 0x34 */
2478c2ecf20Sopenharmony_ci#define SSI_SOR_CLKOFF			0x00000040
2488c2ecf20Sopenharmony_ci#define SSI_SOR_RX_CLR			0x00000020
2498c2ecf20Sopenharmony_ci#define SSI_SOR_TX_CLR			0x00000010
2508c2ecf20Sopenharmony_ci#define SSI_SOR_xX_CLR(tx)		((tx) ? SSI_SOR_TX_CLR : SSI_SOR_RX_CLR)
2518c2ecf20Sopenharmony_ci#define SSI_SOR_INIT			0x00000008
2528c2ecf20Sopenharmony_ci#define SSI_SOR_WAIT_SHIFT		1
2538c2ecf20Sopenharmony_ci#define SSI_SOR_WAIT_MASK		0x00000006
2548c2ecf20Sopenharmony_ci#define SSI_SOR_WAIT(x)			(((x) & 3) << SSI_SOR_WAIT_SHIFT)
2558c2ecf20Sopenharmony_ci#define SSI_SOR_SYNRST			0x00000001
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci/* SSI AC97 Control Register -- REG_SSI_SACNT 0x38 */
2588c2ecf20Sopenharmony_ci#define SSI_SACNT_FRDIV(x)		(((x) & 0x3f) << 5)
2598c2ecf20Sopenharmony_ci#define SSI_SACNT_WR			0x00000010
2608c2ecf20Sopenharmony_ci#define SSI_SACNT_RD			0x00000008
2618c2ecf20Sopenharmony_ci#define SSI_SACNT_RDWR_MASK		0x00000018
2628c2ecf20Sopenharmony_ci#define SSI_SACNT_TIF			0x00000004
2638c2ecf20Sopenharmony_ci#define SSI_SACNT_FV			0x00000002
2648c2ecf20Sopenharmony_ci#define SSI_SACNT_AC97EN		0x00000001
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_cistruct device;
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_DEBUG_FS)
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_cistruct fsl_ssi_dbg {
2728c2ecf20Sopenharmony_ci	struct dentry *dbg_dir;
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci	struct {
2758c2ecf20Sopenharmony_ci		unsigned int rfrc;
2768c2ecf20Sopenharmony_ci		unsigned int tfrc;
2778c2ecf20Sopenharmony_ci		unsigned int cmdau;
2788c2ecf20Sopenharmony_ci		unsigned int cmddu;
2798c2ecf20Sopenharmony_ci		unsigned int rxt;
2808c2ecf20Sopenharmony_ci		unsigned int rdr1;
2818c2ecf20Sopenharmony_ci		unsigned int rdr0;
2828c2ecf20Sopenharmony_ci		unsigned int tde1;
2838c2ecf20Sopenharmony_ci		unsigned int tde0;
2848c2ecf20Sopenharmony_ci		unsigned int roe1;
2858c2ecf20Sopenharmony_ci		unsigned int roe0;
2868c2ecf20Sopenharmony_ci		unsigned int tue1;
2878c2ecf20Sopenharmony_ci		unsigned int tue0;
2888c2ecf20Sopenharmony_ci		unsigned int tfs;
2898c2ecf20Sopenharmony_ci		unsigned int rfs;
2908c2ecf20Sopenharmony_ci		unsigned int tls;
2918c2ecf20Sopenharmony_ci		unsigned int rls;
2928c2ecf20Sopenharmony_ci		unsigned int rff1;
2938c2ecf20Sopenharmony_ci		unsigned int rff0;
2948c2ecf20Sopenharmony_ci		unsigned int tfe1;
2958c2ecf20Sopenharmony_ci		unsigned int tfe0;
2968c2ecf20Sopenharmony_ci	} stats;
2978c2ecf20Sopenharmony_ci};
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_civoid fsl_ssi_dbg_isr(struct fsl_ssi_dbg *ssi_dbg, u32 sisr);
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_civoid fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev);
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_civoid fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg);
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci#else
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_cistruct fsl_ssi_dbg {
3088c2ecf20Sopenharmony_ci};
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_cistatic inline void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *stats, u32 sisr)
3118c2ecf20Sopenharmony_ci{
3128c2ecf20Sopenharmony_ci}
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_cistatic inline void fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg,
3158c2ecf20Sopenharmony_ci					  struct device *dev)
3168c2ecf20Sopenharmony_ci{
3178c2ecf20Sopenharmony_ci}
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_cistatic inline void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg)
3208c2ecf20Sopenharmony_ci{
3218c2ecf20Sopenharmony_ci}
3228c2ecf20Sopenharmony_ci#endif  /* ! IS_ENABLED(CONFIG_DEBUG_FS) */
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci#endif
325