linux/sound/soc/dwc/local.h

/*
 * Copyright (ST) 2012 Rajeev Kumar ([email protected])
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef __DESIGNWARE_LOCAL_H
#define __DESIGNWARE_LOCAL_H

#include <linux/clk.h>
#include <linux/device.h>
#include <linux/types.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm.h>
#include <sound/designware_i2s.h>

/* common register for all channel */
#define IER
#define IRER
#define ITER
#define CER
#define CCR
#define RXFFR
#define TXFFR

/* Enable register fields */
#define IER_TDM_SLOTS_SHIFT
#define IER_FRAME_OFF_SHIFT
#define IER_FRAME_OFF
#define IER_INTF_TYPE
#define IER_IEN

/* Interrupt status register fields */
#define ISR_TXFO
#define ISR_TXFE
#define ISR_RXFO
#define ISR_RXDA

/* I2STxRxRegisters for all channels */
#define LRBR_LTHR(x)
#define RRBR_RTHR(x)
#define RER(x)
#define TER(x)
#define RCR(x)
#define TCR(x)
#define ISR(x)
#define IMR(x)
#define ROR(x)
#define TOR(x)
#define RFCR(x)
#define TFCR(x)
#define RFF(x)
#define TFF(x)
#define RSLOT_TSLOT(x)

/* Receive enable register fields */
#define RER_RXSLOT_SHIFT
#define RER_RXCHEN

/* Transmit enable register fields */
#define TER_TXSLOT_SHIFT
#define TER_TXCHEN

/* I2SCOMPRegisters */
#define I2S_COMP_PARAM_2
#define I2S_COMP_PARAM_1
#define I2S_COMP_VERSION
#define I2S_COMP_TYPE

#define I2S_RRXDMA
#define I2S_RTXDMA
#define I2S_DMACR
#define I2S_DMAEN_RXBLOCK
#define I2S_DMAEN_TXBLOCK

/*
 * Component parameter register fields - define the I2S block's
 * configuration.
 */
#define COMP1_TX_WORDSIZE_3(r)
#define COMP1_TX_WORDSIZE_2(r)
#define COMP1_TX_WORDSIZE_1(r)
#define COMP1_TX_WORDSIZE_0(r)
#define COMP1_TX_CHANNELS(r)
#define COMP1_RX_CHANNELS(r)
#define COMP1_RX_ENABLED(r)
#define COMP1_TX_ENABLED(r)
#define COMP1_MODE_EN(r)
#define COMP1_FIFO_DEPTH_GLOBAL(r)
#define COMP1_APB_DATA_WIDTH(r)

#define COMP2_RX_WORDSIZE_3(r)
#define COMP2_RX_WORDSIZE_2(r)
#define COMP2_RX_WORDSIZE_1(r)
#define COMP2_RX_WORDSIZE_0(r)

/* Number of entries in WORDSIZE and DATA_WIDTH parameter registers */
#define COMP_MAX_WORDSIZE
#define COMP_MAX_DATA_WIDTH

#define MAX_CHANNEL_NUM
#define MIN_CHANNEL_NUM

dw_i2s_snd_dma_data;

struct dw_i2s_dev {};

#if IS_ENABLED(CONFIG_SND_DESIGNWARE_PCM)
void dw_pcm_push_tx(struct dw_i2s_dev *dev);
void dw_pcm_pop_rx(struct dw_i2s_dev *dev);
int dw_pcm_register(struct platform_device *pdev);
#else
static inline void dw_pcm_push_tx(struct dw_i2s_dev *dev) { }
static inline void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { }
static inline int dw_pcm_register(struct platform_device *pdev)
{
	return -EINVAL;
}
#endif

#endif