linux/include/linux/atmel-ssc.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __INCLUDE_ATMEL_SSC_H
#define __INCLUDE_ATMEL_SSC_H

#include <linux/platform_device.h>
#include <linux/list.h>
#include <linux/io.h>

struct atmel_ssc_platform_data {};

struct ssc_device {};

struct ssc_device * __must_check ssc_request(unsigned int ssc_num);
void ssc_free(struct ssc_device *ssc);

/* SSC register offsets */

/* SSC Control Register */
#define SSC_CR
#define SSC_CR_RXDIS_SIZE
#define SSC_CR_RXDIS_OFFSET
#define SSC_CR_RXEN_SIZE
#define SSC_CR_RXEN_OFFSET
#define SSC_CR_SWRST_SIZE
#define SSC_CR_SWRST_OFFSET
#define SSC_CR_TXDIS_SIZE
#define SSC_CR_TXDIS_OFFSET
#define SSC_CR_TXEN_SIZE
#define SSC_CR_TXEN_OFFSET

/* SSC Clock Mode Register */
#define SSC_CMR
#define SSC_CMR_DIV_SIZE
#define SSC_CMR_DIV_OFFSET

/* SSC Receive Clock Mode Register */
#define SSC_RCMR
#define SSC_RCMR_CKG_SIZE
#define SSC_RCMR_CKG_OFFSET
#define SSC_RCMR_CKI_SIZE
#define SSC_RCMR_CKI_OFFSET
#define SSC_RCMR_CKO_SIZE
#define SSC_RCMR_CKO_OFFSET
#define SSC_RCMR_CKS_SIZE
#define SSC_RCMR_CKS_OFFSET
#define SSC_RCMR_PERIOD_SIZE
#define SSC_RCMR_PERIOD_OFFSET
#define SSC_RCMR_START_SIZE
#define SSC_RCMR_START_OFFSET
#define SSC_RCMR_STOP_SIZE
#define SSC_RCMR_STOP_OFFSET
#define SSC_RCMR_STTDLY_SIZE
#define SSC_RCMR_STTDLY_OFFSET

/* SSC Receive Frame Mode Register */
#define SSC_RFMR
#define SSC_RFMR_DATLEN_SIZE
#define SSC_RFMR_DATLEN_OFFSET
#define SSC_RFMR_DATNB_SIZE
#define SSC_RFMR_DATNB_OFFSET
#define SSC_RFMR_FSEDGE_SIZE
#define SSC_RFMR_FSEDGE_OFFSET
/*
 * The FSLEN_EXT exist on at91sam9rl, at91sam9g10,
 * at91sam9g20, and at91sam9g45 and newer SoCs
 */
#define SSC_RFMR_FSLEN_EXT_SIZE
#define SSC_RFMR_FSLEN_EXT_OFFSET
#define SSC_RFMR_FSLEN_SIZE
#define SSC_RFMR_FSLEN_OFFSET
#define SSC_RFMR_FSOS_SIZE
#define SSC_RFMR_FSOS_OFFSET
#define SSC_RFMR_LOOP_SIZE
#define SSC_RFMR_LOOP_OFFSET
#define SSC_RFMR_MSBF_SIZE
#define SSC_RFMR_MSBF_OFFSET

/* SSC Transmit Clock Mode Register */
#define SSC_TCMR
#define SSC_TCMR_CKG_SIZE
#define SSC_TCMR_CKG_OFFSET
#define SSC_TCMR_CKI_SIZE
#define SSC_TCMR_CKI_OFFSET
#define SSC_TCMR_CKO_SIZE
#define SSC_TCMR_CKO_OFFSET
#define SSC_TCMR_CKS_SIZE
#define SSC_TCMR_CKS_OFFSET
#define SSC_TCMR_PERIOD_SIZE
#define SSC_TCMR_PERIOD_OFFSET
#define SSC_TCMR_START_SIZE
#define SSC_TCMR_START_OFFSET
#define SSC_TCMR_STTDLY_SIZE
#define SSC_TCMR_STTDLY_OFFSET

/* SSC Transmit Frame Mode Register */
#define SSC_TFMR
#define SSC_TFMR_DATDEF_SIZE
#define SSC_TFMR_DATDEF_OFFSET
#define SSC_TFMR_DATLEN_SIZE
#define SSC_TFMR_DATLEN_OFFSET
#define SSC_TFMR_DATNB_SIZE
#define SSC_TFMR_DATNB_OFFSET
#define SSC_TFMR_FSDEN_SIZE
#define SSC_TFMR_FSDEN_OFFSET
#define SSC_TFMR_FSEDGE_SIZE
#define SSC_TFMR_FSEDGE_OFFSET
/*
 * The FSLEN_EXT exist on at91sam9rl, at91sam9g10,
 * at91sam9g20, and at91sam9g45 and newer SoCs
 */
#define SSC_TFMR_FSLEN_EXT_SIZE
#define SSC_TFMR_FSLEN_EXT_OFFSET
#define SSC_TFMR_FSLEN_SIZE
#define SSC_TFMR_FSLEN_OFFSET
#define SSC_TFMR_FSOS_SIZE
#define SSC_TFMR_FSOS_OFFSET
#define SSC_TFMR_MSBF_SIZE
#define SSC_TFMR_MSBF_OFFSET

/* SSC Receive Hold Register */
#define SSC_RHR
#define SSC_RHR_RDAT_SIZE
#define SSC_RHR_RDAT_OFFSET

/* SSC Transmit Hold Register */
#define SSC_THR
#define SSC_THR_TDAT_SIZE
#define SSC_THR_TDAT_OFFSET

/* SSC Receive Sync. Holding Register */
#define SSC_RSHR
#define SSC_RSHR_RSDAT_SIZE
#define SSC_RSHR_RSDAT_OFFSET

/* SSC Transmit Sync. Holding Register */
#define SSC_TSHR
#define SSC_TSHR_TSDAT_SIZE
#define SSC_TSHR_RSDAT_OFFSET

/* SSC Receive Compare 0 Register */
#define SSC_RC0R
#define SSC_RC0R_CP0_SIZE
#define SSC_RC0R_CP0_OFFSET

/* SSC Receive Compare 1 Register */
#define SSC_RC1R
#define SSC_RC1R_CP1_SIZE
#define SSC_RC1R_CP1_OFFSET

/* SSC Status Register */
#define SSC_SR
#define SSC_SR_CP0_SIZE
#define SSC_SR_CP0_OFFSET
#define SSC_SR_CP1_SIZE
#define SSC_SR_CP1_OFFSET
#define SSC_SR_ENDRX_SIZE
#define SSC_SR_ENDRX_OFFSET
#define SSC_SR_ENDTX_SIZE
#define SSC_SR_ENDTX_OFFSET
#define SSC_SR_OVRUN_SIZE
#define SSC_SR_OVRUN_OFFSET
#define SSC_SR_RXBUFF_SIZE
#define SSC_SR_RXBUFF_OFFSET
#define SSC_SR_RXEN_SIZE
#define SSC_SR_RXEN_OFFSET
#define SSC_SR_RXRDY_SIZE
#define SSC_SR_RXRDY_OFFSET
#define SSC_SR_RXSYN_SIZE
#define SSC_SR_RXSYN_OFFSET
#define SSC_SR_TXBUFE_SIZE
#define SSC_SR_TXBUFE_OFFSET
#define SSC_SR_TXEMPTY_SIZE
#define SSC_SR_TXEMPTY_OFFSET
#define SSC_SR_TXEN_SIZE
#define SSC_SR_TXEN_OFFSET
#define SSC_SR_TXRDY_SIZE
#define SSC_SR_TXRDY_OFFSET
#define SSC_SR_TXSYN_SIZE
#define SSC_SR_TXSYN_OFFSET

/* SSC Interrupt Enable Register */
#define SSC_IER
#define SSC_IER_CP0_SIZE
#define SSC_IER_CP0_OFFSET
#define SSC_IER_CP1_SIZE
#define SSC_IER_CP1_OFFSET
#define SSC_IER_ENDRX_SIZE
#define SSC_IER_ENDRX_OFFSET
#define SSC_IER_ENDTX_SIZE
#define SSC_IER_ENDTX_OFFSET
#define SSC_IER_OVRUN_SIZE
#define SSC_IER_OVRUN_OFFSET
#define SSC_IER_RXBUFF_SIZE
#define SSC_IER_RXBUFF_OFFSET
#define SSC_IER_RXRDY_SIZE
#define SSC_IER_RXRDY_OFFSET
#define SSC_IER_RXSYN_SIZE
#define SSC_IER_RXSYN_OFFSET
#define SSC_IER_TXBUFE_SIZE
#define SSC_IER_TXBUFE_OFFSET
#define SSC_IER_TXEMPTY_SIZE
#define SSC_IER_TXEMPTY_OFFSET
#define SSC_IER_TXRDY_SIZE
#define SSC_IER_TXRDY_OFFSET
#define SSC_IER_TXSYN_SIZE
#define SSC_IER_TXSYN_OFFSET

/* SSC Interrupt Disable Register */
#define SSC_IDR
#define SSC_IDR_CP0_SIZE
#define SSC_IDR_CP0_OFFSET
#define SSC_IDR_CP1_SIZE
#define SSC_IDR_CP1_OFFSET
#define SSC_IDR_ENDRX_SIZE
#define SSC_IDR_ENDRX_OFFSET
#define SSC_IDR_ENDTX_SIZE
#define SSC_IDR_ENDTX_OFFSET
#define SSC_IDR_OVRUN_SIZE
#define SSC_IDR_OVRUN_OFFSET
#define SSC_IDR_RXBUFF_SIZE
#define SSC_IDR_RXBUFF_OFFSET
#define SSC_IDR_RXRDY_SIZE
#define SSC_IDR_RXRDY_OFFSET
#define SSC_IDR_RXSYN_SIZE
#define SSC_IDR_RXSYN_OFFSET
#define SSC_IDR_TXBUFE_SIZE
#define SSC_IDR_TXBUFE_OFFSET
#define SSC_IDR_TXEMPTY_SIZE
#define SSC_IDR_TXEMPTY_OFFSET
#define SSC_IDR_TXRDY_SIZE
#define SSC_IDR_TXRDY_OFFSET
#define SSC_IDR_TXSYN_SIZE
#define SSC_IDR_TXSYN_OFFSET

/* SSC Interrupt Mask Register */
#define SSC_IMR
#define SSC_IMR_CP0_SIZE
#define SSC_IMR_CP0_OFFSET
#define SSC_IMR_CP1_SIZE
#define SSC_IMR_CP1_OFFSET
#define SSC_IMR_ENDRX_SIZE
#define SSC_IMR_ENDRX_OFFSET
#define SSC_IMR_ENDTX_SIZE
#define SSC_IMR_ENDTX_OFFSET
#define SSC_IMR_OVRUN_SIZE
#define SSC_IMR_OVRUN_OFFSET
#define SSC_IMR_RXBUFF_SIZE
#define SSC_IMR_RXBUFF_OFFSET
#define SSC_IMR_RXRDY_SIZE
#define SSC_IMR_RXRDY_OFFSET
#define SSC_IMR_RXSYN_SIZE
#define SSC_IMR_RXSYN_OFFSET
#define SSC_IMR_TXBUFE_SIZE
#define SSC_IMR_TXBUFE_OFFSET
#define SSC_IMR_TXEMPTY_SIZE
#define SSC_IMR_TXEMPTY_OFFSET
#define SSC_IMR_TXRDY_SIZE
#define SSC_IMR_TXRDY_OFFSET
#define SSC_IMR_TXSYN_SIZE
#define SSC_IMR_TXSYN_OFFSET

/* SSC PDC Receive Pointer Register */
#define SSC_PDC_RPR

/* SSC PDC Receive Counter Register */
#define SSC_PDC_RCR

/* SSC PDC Transmit Pointer Register */
#define SSC_PDC_TPR

/* SSC PDC Receive Next Pointer Register */
#define SSC_PDC_RNPR

/* SSC PDC Receive Next Counter Register */
#define SSC_PDC_RNCR

/* SSC PDC Transmit Counter Register */
#define SSC_PDC_TCR

/* SSC PDC Transmit Next Pointer Register */
#define SSC_PDC_TNPR

/* SSC PDC Transmit Next Counter Register */
#define SSC_PDC_TNCR

/* SSC PDC Transfer Control Register */
#define SSC_PDC_PTCR
#define SSC_PDC_PTCR_RXTDIS_SIZE
#define SSC_PDC_PTCR_RXTDIS_OFFSET
#define SSC_PDC_PTCR_RXTEN_SIZE
#define SSC_PDC_PTCR_RXTEN_OFFSET
#define SSC_PDC_PTCR_TXTDIS_SIZE
#define SSC_PDC_PTCR_TXTDIS_OFFSET
#define SSC_PDC_PTCR_TXTEN_SIZE
#define SSC_PDC_PTCR_TXTEN_OFFSET

/* SSC PDC Transfer Status Register */
#define SSC_PDC_PTSR
#define SSC_PDC_PTSR_RXTEN_SIZE
#define SSC_PDC_PTSR_RXTEN_OFFSET
#define SSC_PDC_PTSR_TXTEN_SIZE
#define SSC_PDC_PTSR_TXTEN_OFFSET

/* Bit manipulation macros */
#define SSC_BIT(name)
#define SSC_BF(name, value)
#define SSC_BFEXT(name, value)
#define SSC_BFINS(name, value, old)

/* Register access macros */
#define ssc_readl(base, reg)
#define ssc_writel(base, reg, value)

#endif /* __INCLUDE_ATMEL_SSC_H */