linux/sound/soc/rockchip/rockchip_i2s.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * sound/soc/rockchip/rockchip_i2s.h
 *
 * ALSA SoC Audio Layer - Rockchip I2S Controller driver
 *
 * Copyright (c) 2014 Rockchip Electronics Co. Ltd.
 * Author: Jianqun xu <[email protected]>
 */

#ifndef _ROCKCHIP_IIS_H
#define _ROCKCHIP_IIS_H

/*
 * TXCR
 * transmit operation control register
*/
#define I2S_TXCR_RCNT_SHIFT
#define I2S_TXCR_RCNT_MASK
#define I2S_TXCR_CSR_SHIFT
#define I2S_TXCR_CSR(x)
#define I2S_TXCR_CSR_MASK
#define I2S_TXCR_HWT
#define I2S_TXCR_SJM_SHIFT
#define I2S_TXCR_SJM_R
#define I2S_TXCR_SJM_L
#define I2S_TXCR_FBM_SHIFT
#define I2S_TXCR_FBM_MSB
#define I2S_TXCR_FBM_LSB
#define I2S_TXCR_IBM_SHIFT
#define I2S_TXCR_IBM_NORMAL
#define I2S_TXCR_IBM_LSJM
#define I2S_TXCR_IBM_RSJM
#define I2S_TXCR_IBM_MASK
#define I2S_TXCR_PBM_SHIFT
#define I2S_TXCR_PBM_MODE(x)
#define I2S_TXCR_PBM_MASK
#define I2S_TXCR_TFS_SHIFT
#define I2S_TXCR_TFS_I2S
#define I2S_TXCR_TFS_PCM
#define I2S_TXCR_TFS_MASK
#define I2S_TXCR_VDW_SHIFT
#define I2S_TXCR_VDW(x)
#define I2S_TXCR_VDW_MASK

/*
 * RXCR
 * receive operation control register
*/
#define I2S_RXCR_CSR_SHIFT
#define I2S_RXCR_CSR(x)
#define I2S_RXCR_CSR_MASK
#define I2S_RXCR_HWT
#define I2S_RXCR_SJM_SHIFT
#define I2S_RXCR_SJM_R
#define I2S_RXCR_SJM_L
#define I2S_RXCR_FBM_SHIFT
#define I2S_RXCR_FBM_MSB
#define I2S_RXCR_FBM_LSB
#define I2S_RXCR_IBM_SHIFT
#define I2S_RXCR_IBM_NORMAL
#define I2S_RXCR_IBM_LSJM
#define I2S_RXCR_IBM_RSJM
#define I2S_RXCR_IBM_MASK
#define I2S_RXCR_PBM_SHIFT
#define I2S_RXCR_PBM_MODE(x)
#define I2S_RXCR_PBM_MASK
#define I2S_RXCR_TFS_SHIFT
#define I2S_RXCR_TFS_I2S
#define I2S_RXCR_TFS_PCM
#define I2S_RXCR_TFS_MASK
#define I2S_RXCR_VDW_SHIFT
#define I2S_RXCR_VDW(x)
#define I2S_RXCR_VDW_MASK

/*
 * CKR
 * clock generation register
*/
#define I2S_CKR_TRCM_SHIFT
#define I2S_CKR_TRCM(x)
#define I2S_CKR_TRCM_TXRX
#define I2S_CKR_TRCM_TXONLY
#define I2S_CKR_TRCM_RXONLY
#define I2S_CKR_TRCM_MASK
#define I2S_CKR_MSS_SHIFT
#define I2S_CKR_MSS_MASTER
#define I2S_CKR_MSS_SLAVE
#define I2S_CKR_MSS_MASK
#define I2S_CKR_CKP_SHIFT
#define I2S_CKR_CKP_NORMAL
#define I2S_CKR_CKP_INVERTED
#define I2S_CKR_CKP_MASK
#define I2S_CKR_RLP_SHIFT
#define I2S_CKR_RLP_NORMAL
#define I2S_CKR_RLP_INVERTED
#define I2S_CKR_RLP_MASK
#define I2S_CKR_TLP_SHIFT
#define I2S_CKR_TLP_NORMAL
#define I2S_CKR_TLP_INVERTED
#define I2S_CKR_TLP_MASK
#define I2S_CKR_MDIV_SHIFT
#define I2S_CKR_MDIV(x)
#define I2S_CKR_MDIV_MASK
#define I2S_CKR_RSD_SHIFT
#define I2S_CKR_RSD(x)
#define I2S_CKR_RSD_MASK
#define I2S_CKR_TSD_SHIFT
#define I2S_CKR_TSD(x)
#define I2S_CKR_TSD_MASK

/*
 * FIFOLR
 * FIFO level register
*/
#define I2S_FIFOLR_RFL_SHIFT
#define I2S_FIFOLR_RFL_MASK
#define I2S_FIFOLR_TFL3_SHIFT
#define I2S_FIFOLR_TFL3_MASK
#define I2S_FIFOLR_TFL2_SHIFT
#define I2S_FIFOLR_TFL2_MASK
#define I2S_FIFOLR_TFL1_SHIFT
#define I2S_FIFOLR_TFL1_MASK
#define I2S_FIFOLR_TFL0_SHIFT
#define I2S_FIFOLR_TFL0_MASK

/*
 * DMACR
 * DMA control register
*/
#define I2S_DMACR_RDE_SHIFT
#define I2S_DMACR_RDE_DISABLE
#define I2S_DMACR_RDE_ENABLE
#define I2S_DMACR_RDL_SHIFT
#define I2S_DMACR_RDL(x)
#define I2S_DMACR_RDL_MASK
#define I2S_DMACR_TDE_SHIFT
#define I2S_DMACR_TDE_DISABLE
#define I2S_DMACR_TDE_ENABLE
#define I2S_DMACR_TDL_SHIFT
#define I2S_DMACR_TDL(x)
#define I2S_DMACR_TDL_MASK

/*
 * INTCR
 * interrupt control register
*/
#define I2S_INTCR_RFT_SHIFT
#define I2S_INTCR_RFT(x)
#define I2S_INTCR_RXOIC
#define I2S_INTCR_RXOIE_SHIFT
#define I2S_INTCR_RXOIE_DISABLE
#define I2S_INTCR_RXOIE_ENABLE
#define I2S_INTCR_RXFIE_SHIFT
#define I2S_INTCR_RXFIE_DISABLE
#define I2S_INTCR_RXFIE_ENABLE
#define I2S_INTCR_TFT_SHIFT
#define I2S_INTCR_TFT(x)
#define I2S_INTCR_TFT_MASK
#define I2S_INTCR_TXUIC
#define I2S_INTCR_TXUIE_SHIFT
#define I2S_INTCR_TXUIE_DISABLE
#define I2S_INTCR_TXUIE_ENABLE

/*
 * INTSR
 * interrupt status register
*/
#define I2S_INTSR_TXEIE_SHIFT
#define I2S_INTSR_TXEIE_DISABLE
#define I2S_INTSR_TXEIE_ENABLE
#define I2S_INTSR_RXOI_SHIFT
#define I2S_INTSR_RXOI_INA
#define I2S_INTSR_RXOI_ACT
#define I2S_INTSR_RXFI_SHIFT
#define I2S_INTSR_RXFI_INA
#define I2S_INTSR_RXFI_ACT
#define I2S_INTSR_TXUI_SHIFT
#define I2S_INTSR_TXUI_INA
#define I2S_INTSR_TXUI_ACT
#define I2S_INTSR_TXEI_SHIFT
#define I2S_INTSR_TXEI_INA
#define I2S_INTSR_TXEI_ACT

/*
 * XFER
 * Transfer start register
*/
#define I2S_XFER_RXS_SHIFT
#define I2S_XFER_RXS_STOP
#define I2S_XFER_RXS_START
#define I2S_XFER_TXS_SHIFT
#define I2S_XFER_TXS_STOP
#define I2S_XFER_TXS_START

/*
 * CLR
 * clear SCLK domain logic register
*/
#define I2S_CLR_RXC
#define I2S_CLR_TXC

/*
 * TXDR
 * Transimt FIFO data register, write only.
*/
#define I2S_TXDR_MASK

/*
 * RXDR
 * Receive FIFO data register, write only.
*/
#define I2S_RXDR_MASK

/* Clock divider id */
enum {};

/* channel select */
#define I2S_CSR_SHIFT
#define I2S_CHN_2
#define I2S_CHN_4
#define I2S_CHN_6
#define I2S_CHN_8

/* I2S REGS */
#define I2S_TXCR
#define I2S_RXCR
#define I2S_CKR
#define I2S_FIFOLR
#define I2S_DMACR
#define I2S_INTCR
#define I2S_INTSR
#define I2S_XFER
#define I2S_CLR
#define I2S_TXDR
#define I2S_RXDR

/* io direction cfg register */
#define I2S_IO_DIRECTION_MASK
#define I2S_IO_8CH_OUT_2CH_IN
#define I2S_IO_6CH_OUT_4CH_IN
#define I2S_IO_4CH_OUT_6CH_IN
#define I2S_IO_2CH_OUT_8CH_IN

#endif /* _ROCKCHIP_IIS_H */