linux/sound/soc/fsl/fsl_esai.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * fsl_esai.h - ALSA ESAI interface for the Freescale i.MX SoC
 *
 * Copyright (C) 2014 Freescale Semiconductor, Inc.
 *
 * Author: Nicolin Chen <[email protected]>
 */

#ifndef _FSL_ESAI_DAI_H
#define _FSL_ESAI_DAI_H

/* ESAI Register Map */
#define REG_ESAI_ETDR
#define REG_ESAI_ERDR
#define REG_ESAI_ECR
#define REG_ESAI_ESR
#define REG_ESAI_TFCR
#define REG_ESAI_TFSR
#define REG_ESAI_RFCR
#define REG_ESAI_RFSR
#define REG_ESAI_xFCR(tx)
#define REG_ESAI_xFSR(tx)
#define REG_ESAI_TX0
#define REG_ESAI_TX1
#define REG_ESAI_TX2
#define REG_ESAI_TX3
#define REG_ESAI_TX4
#define REG_ESAI_TX5
#define REG_ESAI_TSR
#define REG_ESAI_RX0
#define REG_ESAI_RX1
#define REG_ESAI_RX2
#define REG_ESAI_RX3
#define REG_ESAI_SAISR
#define REG_ESAI_SAICR
#define REG_ESAI_TCR
#define REG_ESAI_TCCR
#define REG_ESAI_RCR
#define REG_ESAI_RCCR
#define REG_ESAI_xCR(tx)
#define REG_ESAI_xCCR(tx)
#define REG_ESAI_TSMA
#define REG_ESAI_TSMB
#define REG_ESAI_RSMA
#define REG_ESAI_RSMB
#define REG_ESAI_xSMA(tx)
#define REG_ESAI_xSMB(tx)
#define REG_ESAI_PRRC
#define REG_ESAI_PCRC

/* ESAI Control Register -- REG_ESAI_ECR 0x8 */
#define ESAI_ECR_ETI_SHIFT
#define ESAI_ECR_ETI_MASK
#define ESAI_ECR_ETI
#define ESAI_ECR_ETO_SHIFT
#define ESAI_ECR_ETO_MASK
#define ESAI_ECR_ETO
#define ESAI_ECR_ERI_SHIFT
#define ESAI_ECR_ERI_MASK
#define ESAI_ECR_ERI
#define ESAI_ECR_ERO_SHIFT
#define ESAI_ECR_ERO_MASK
#define ESAI_ECR_ERO
#define ESAI_ECR_ERST_SHIFT
#define ESAI_ECR_ERST_MASK
#define ESAI_ECR_ERST
#define ESAI_ECR_ESAIEN_SHIFT
#define ESAI_ECR_ESAIEN_MASK
#define ESAI_ECR_ESAIEN

/* ESAI Status Register -- REG_ESAI_ESR 0xC */
#define ESAI_ESR_TINIT_SHIFT
#define ESAI_ESR_TINIT_MASK
#define ESAI_ESR_TINIT
#define ESAI_ESR_RFF_SHIFT
#define ESAI_ESR_RFF_MASK
#define ESAI_ESR_RFF
#define ESAI_ESR_TFE_SHIFT
#define ESAI_ESR_TFE_MASK
#define ESAI_ESR_TFE
#define ESAI_ESR_TLS_SHIFT
#define ESAI_ESR_TLS_MASK
#define ESAI_ESR_TLS
#define ESAI_ESR_TDE_SHIFT
#define ESAI_ESR_TDE_MASK
#define ESAI_ESR_TDE
#define ESAI_ESR_TED_SHIFT
#define ESAI_ESR_TED_MASK
#define ESAI_ESR_TED
#define ESAI_ESR_TD_SHIFT
#define ESAI_ESR_TD_MASK
#define ESAI_ESR_TD
#define ESAI_ESR_RLS_SHIFT
#define ESAI_ESR_RLS_MASK
#define ESAI_ESR_RLS
#define ESAI_ESR_RDE_SHIFT
#define ESAI_ESR_RDE_MASK
#define ESAI_ESR_RDE
#define ESAI_ESR_RED_SHIFT
#define ESAI_ESR_RED_MASK
#define ESAI_ESR_RED
#define ESAI_ESR_RD_SHIFT
#define ESAI_ESR_RD_MASK
#define ESAI_ESR_RD

/*
 * Transmit FIFO Configuration Register -- REG_ESAI_TFCR 0x10
 * Receive FIFO Configuration Register -- REG_ESAI_RFCR 0x18
 */
#define ESAI_xFCR_TIEN_SHIFT
#define ESAI_xFCR_TIEN_MASK
#define ESAI_xFCR_TIEN
#define ESAI_xFCR_REXT_SHIFT
#define ESAI_xFCR_REXT_MASK
#define ESAI_xFCR_REXT
#define ESAI_xFCR_xWA_SHIFT
#define ESAI_xFCR_xWA_WIDTH
#define ESAI_xFCR_xWA_MASK
#define ESAI_xFCR_xWA(v)
#define ESAI_xFCR_xFWM_SHIFT
#define ESAI_xFCR_xFWM_WIDTH
#define ESAI_xFCR_xFWM_MASK
#define ESAI_xFCR_xFWM(v)
#define ESAI_xFCR_xE_SHIFT
#define ESAI_xFCR_TE_WIDTH
#define ESAI_xFCR_RE_WIDTH
#define ESAI_xFCR_TE_MASK
#define ESAI_xFCR_RE_MASK
#define ESAI_xFCR_TE(x)
#define ESAI_xFCR_RE(x)
#define ESAI_xFCR_xFR_SHIFT
#define ESAI_xFCR_xFR_MASK
#define ESAI_xFCR_xFR
#define ESAI_xFCR_xFEN_SHIFT
#define ESAI_xFCR_xFEN_MASK
#define ESAI_xFCR_xFEN

/*
 * Transmit FIFO Status Register -- REG_ESAI_TFSR 0x14
 * Receive FIFO Status Register --REG_ESAI_RFSR 0x1C
 */
#define ESAI_xFSR_NTFO_SHIFT
#define ESAI_xFSR_NRFI_SHIFT
#define ESAI_xFSR_NTFI_SHIFT
#define ESAI_xFSR_NRFO_SHIFT
#define ESAI_xFSR_NTFx_WIDTH
#define ESAI_xFSR_NRFx_WIDTH
#define ESAI_xFSR_NTFO_MASK
#define ESAI_xFSR_NTFI_MASK
#define ESAI_xFSR_NRFO_MASK
#define ESAI_xFSR_NRFI_MASK
#define ESAI_xFSR_xFCNT_SHIFT
#define ESAI_xFSR_xFCNT_WIDTH
#define ESAI_xFSR_xFCNT_MASK

/* ESAI Transmit Slot Register -- REG_ESAI_TSR 0x98 */
#define ESAI_TSR_SHIFT
#define ESAI_TSR_WIDTH
#define ESAI_TSR_MASK

/* Serial Audio Interface Status Register -- REG_ESAI_SAISR 0xCC */
#define ESAI_SAISR_TODFE_SHIFT
#define ESAI_SAISR_TODFE_MASK
#define ESAI_SAISR_TODFE
#define ESAI_SAISR_TEDE_SHIFT
#define ESAI_SAISR_TEDE_MASK
#define ESAI_SAISR_TEDE
#define ESAI_SAISR_TDE_SHIFT
#define ESAI_SAISR_TDE_MASK
#define ESAI_SAISR_TDE
#define ESAI_SAISR_TUE_SHIFT
#define ESAI_SAISR_TUE_MASK
#define ESAI_SAISR_TUE
#define ESAI_SAISR_TFS_SHIFT
#define ESAI_SAISR_TFS_MASK
#define ESAI_SAISR_TFS
#define ESAI_SAISR_RODF_SHIFT
#define ESAI_SAISR_RODF_MASK
#define ESAI_SAISR_RODF
#define ESAI_SAISR_REDF_SHIFT
#define ESAI_SAISR_REDF_MASK
#define ESAI_SAISR_REDF
#define ESAI_SAISR_RDF_SHIFT
#define ESAI_SAISR_RDF_MASK
#define ESAI_SAISR_RDF
#define ESAI_SAISR_ROE_SHIFT
#define ESAI_SAISR_ROE_MASK
#define ESAI_SAISR_ROE
#define ESAI_SAISR_RFS_SHIFT
#define ESAI_SAISR_RFS_MASK
#define ESAI_SAISR_RFS
#define ESAI_SAISR_IF2_SHIFT
#define ESAI_SAISR_IF2_MASK
#define ESAI_SAISR_IF2
#define ESAI_SAISR_IF1_SHIFT
#define ESAI_SAISR_IF1_MASK
#define ESAI_SAISR_IF1
#define ESAI_SAISR_IF0_SHIFT
#define ESAI_SAISR_IF0_MASK
#define ESAI_SAISR_IF0

/* Serial Audio Interface Control Register -- REG_ESAI_SAICR 0xD0 */
#define ESAI_SAICR_ALC_SHIFT
#define ESAI_SAICR_ALC_MASK
#define ESAI_SAICR_ALC
#define ESAI_SAICR_TEBE_SHIFT
#define ESAI_SAICR_TEBE_MASK
#define ESAI_SAICR_TEBE
#define ESAI_SAICR_SYNC_SHIFT
#define ESAI_SAICR_SYNC_MASK
#define ESAI_SAICR_SYNC
#define ESAI_SAICR_OF2_SHIFT
#define ESAI_SAICR_OF2_MASK
#define ESAI_SAICR_OF2
#define ESAI_SAICR_OF1_SHIFT
#define ESAI_SAICR_OF1_MASK
#define ESAI_SAICR_OF1
#define ESAI_SAICR_OF0_SHIFT
#define ESAI_SAICR_OF0_MASK
#define ESAI_SAICR_OF0

/*
 * Transmit Control Register -- REG_ESAI_TCR 0xD4
 * Receive Control Register -- REG_ESAI_RCR 0xDC
 */
#define ESAI_xCR_xLIE_SHIFT
#define ESAI_xCR_xLIE_MASK
#define ESAI_xCR_xLIE
#define ESAI_xCR_xIE_SHIFT
#define ESAI_xCR_xIE_MASK
#define ESAI_xCR_xIE
#define ESAI_xCR_xEDIE_SHIFT
#define ESAI_xCR_xEDIE_MASK
#define ESAI_xCR_xEDIE
#define ESAI_xCR_xEIE_SHIFT
#define ESAI_xCR_xEIE_MASK
#define ESAI_xCR_xEIE
#define ESAI_xCR_xPR_SHIFT
#define ESAI_xCR_xPR_MASK
#define ESAI_xCR_xPR
#define ESAI_xCR_PADC_SHIFT
#define ESAI_xCR_PADC_MASK
#define ESAI_xCR_PADC
#define ESAI_xCR_xFSR_SHIFT
#define ESAI_xCR_xFSR_MASK
#define ESAI_xCR_xFSR
#define ESAI_xCR_xFSL_SHIFT
#define ESAI_xCR_xFSL_MASK
#define ESAI_xCR_xFSL
#define ESAI_xCR_xSWS_SHIFT
#define ESAI_xCR_xSWS_WIDTH
#define ESAI_xCR_xSWS_MASK
#define ESAI_xCR_xSWS(s, w)
#define ESAI_xCR_xMOD_SHIFT
#define ESAI_xCR_xMOD_WIDTH
#define ESAI_xCR_xMOD_MASK
#define ESAI_xCR_xMOD_ONDEMAND
#define ESAI_xCR_xMOD_NETWORK
#define ESAI_xCR_xMOD_AC97
#define ESAI_xCR_xWA_SHIFT
#define ESAI_xCR_xWA_MASK
#define ESAI_xCR_xWA
#define ESAI_xCR_xSHFD_SHIFT
#define ESAI_xCR_xSHFD_MASK
#define ESAI_xCR_xSHFD
#define ESAI_xCR_xE_SHIFT
#define ESAI_xCR_TE_WIDTH
#define ESAI_xCR_RE_WIDTH
#define ESAI_xCR_TE_MASK
#define ESAI_xCR_RE_MASK
#define ESAI_xCR_TE(x)
#define ESAI_xCR_RE(x)

/*
 * Transmit Clock Control Register -- REG_ESAI_TCCR 0xD8
 * Receive Clock Control Register -- REG_ESAI_RCCR 0xE0
 */
#define ESAI_xCCR_xHCKD_SHIFT
#define ESAI_xCCR_xHCKD_MASK
#define ESAI_xCCR_xHCKD
#define ESAI_xCCR_xFSD_SHIFT
#define ESAI_xCCR_xFSD_MASK
#define ESAI_xCCR_xFSD
#define ESAI_xCCR_xCKD_SHIFT
#define ESAI_xCCR_xCKD_MASK
#define ESAI_xCCR_xCKD
#define ESAI_xCCR_xHCKP_SHIFT
#define ESAI_xCCR_xHCKP_MASK
#define ESAI_xCCR_xHCKP
#define ESAI_xCCR_xFSP_SHIFT
#define ESAI_xCCR_xFSP_MASK
#define ESAI_xCCR_xFSP
#define ESAI_xCCR_xCKP_SHIFT
#define ESAI_xCCR_xCKP_MASK
#define ESAI_xCCR_xCKP
#define ESAI_xCCR_xFP_SHIFT
#define ESAI_xCCR_xFP_WIDTH
#define ESAI_xCCR_xFP_MASK
#define ESAI_xCCR_xFP(v)
#define ESAI_xCCR_xDC_SHIFT
#define ESAI_xCCR_xDC_WIDTH
#define ESAI_xCCR_xDC_MASK
#define ESAI_xCCR_xDC(v)
#define ESAI_xCCR_xPSR_SHIFT
#define ESAI_xCCR_xPSR_MASK
#define ESAI_xCCR_xPSR_BYPASS
#define ESAI_xCCR_xPSR_DIV8
#define ESAI_xCCR_xPM_SHIFT
#define ESAI_xCCR_xPM_WIDTH
#define ESAI_xCCR_xPM_MASK
#define ESAI_xCCR_xPM(v)

/* Transmit Slot Mask Register A/B -- REG_ESAI_TSMA/B 0xE4 ~ 0xF0 */
#define ESAI_xSMA_xS_SHIFT
#define ESAI_xSMA_xS_WIDTH
#define ESAI_xSMA_xS_MASK
#define ESAI_xSMA_xS(v)
#define ESAI_xSMB_xS_SHIFT
#define ESAI_xSMB_xS_WIDTH
#define ESAI_xSMB_xS_MASK
#define ESAI_xSMB_xS(v)

/* Port C Direction Register -- REG_ESAI_PRRC 0xF8 */
#define ESAI_PRRC_PDC_SHIFT
#define ESAI_PRRC_PDC_WIDTH
#define ESAI_PRRC_PDC_MASK
#define ESAI_PRRC_PDC(v)

/* Port C Control Register -- REG_ESAI_PCRC 0xFC */
#define ESAI_PCRC_PC_SHIFT
#define ESAI_PCRC_PC_WIDTH
#define ESAI_PCRC_PC_MASK
#define ESAI_PCRC_PC(v)

#define ESAI_GPIO

/* ESAI clock source */
#define ESAI_HCKT_FSYS
#define ESAI_HCKT_EXTAL
#define ESAI_HCKR_FSYS
#define ESAI_HCKR_EXTAL

/* ESAI clock divider */
#define ESAI_TX_DIV_PSR
#define ESAI_TX_DIV_PM
#define ESAI_TX_DIV_FP
#define ESAI_RX_DIV_PSR
#define ESAI_RX_DIV_PM
#define ESAI_RX_DIV_FP
#endif /* _FSL_ESAI_DAI_H */