--- zzzz-none-000/linux-3.10.107/sound/soc/ux500/ux500_msp_i2s.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/soc/ux500/ux500_msp_i2s.h 2021-02-04 17:41:59.000000000 +0000 @@ -16,6 +16,7 @@ #define UX500_MSP_I2S_H #include +#include #define MSP_INPUT_FREQ_APB 48000000 @@ -341,11 +342,6 @@ MSP_COMPRESS_MODE_A_LAW = 3 }; -enum msp_spi_burst_mode { - MSP_SPI_BURST_MODE_DISABLE = 0, - MSP_SPI_BURST_MODE_ENABLE = 1 -}; - enum msp_expand_mode { MSP_EXPAND_MODE_LINEAR = 0, MSP_EXPAND_MODE_LINEAR_SIGNED = 1, @@ -370,13 +366,6 @@ */ #define MAX_MSP_BACKUP_REGS 36 -enum enum_i2s_controller { - MSP_0_I2S_CONTROLLER = 0, - MSP_1_I2S_CONTROLLER, - MSP_2_I2S_CONTROLLER, - MSP_3_I2S_CONTROLLER, -}; - enum i2s_direction_t { MSP_DIR_TX = 0x01, MSP_DIR_RX = 0x02, @@ -454,32 +443,6 @@ u32 clocks_per_frame; }; -struct i2s_message { - enum i2s_direction_t i2s_direction; - void *txdata; - void *rxdata; - size_t txbytes; - size_t rxbytes; - int dma_flag; - int tx_offset; - int rx_offset; - bool cyclic_dma; - dma_addr_t buf_addr; - size_t buf_len; - size_t period_len; -}; - -struct i2s_controller { - struct module *owner; - unsigned int id; - unsigned int class; - const struct i2s_algorithm *algo; /* the algorithm to access the bus */ - void *data; - struct mutex bus_lock; - struct device dev; /* the controller device */ - char name[48]; -}; - struct ux500_msp_config { unsigned int f_inputclk; unsigned int rx_clk_sel; @@ -491,8 +454,6 @@ unsigned int tx_fsync_sel; unsigned int rx_fifo_config; unsigned int tx_fifo_config; - unsigned int spi_clk_mode; - unsigned int spi_burst_mode; unsigned int loopback_enable; unsigned int tx_data_enable; unsigned int default_protdesc; @@ -502,43 +463,28 @@ unsigned int direction; unsigned int protocol; unsigned int frame_freq; - unsigned int frame_size; enum msp_data_size data_size; unsigned int def_elem_len; unsigned int iodelay; - void (*handler) (void *data); - void *tx_callback_data; - void *rx_callback_data; +}; + +struct ux500_msp_dma_params { + unsigned int data_size; + dma_addr_t tx_rx_addr; + struct stedma40_chan_cfg *dma_cfg; }; struct ux500_msp { - enum enum_i2s_controller id; + int id; void __iomem *registers; struct device *dev; - struct i2s_controller *i2s_cont; - struct stedma40_chan_cfg *dma_cfg_rx; - struct stedma40_chan_cfg *dma_cfg_tx; - struct dma_chan *tx_pipeid; - struct dma_chan *rx_pipeid; + struct ux500_msp_dma_params playback_dma_data; + struct ux500_msp_dma_params capture_dma_data; enum msp_state msp_state; - int (*transfer) (struct ux500_msp *msp, struct i2s_message *message); - struct timer_list notify_timer; int def_elem_len; unsigned int dir_busy; int loopback_enable; - u32 backup_regs[MAX_MSP_BACKUP_REGS]; unsigned int f_bitclk; - /* Pin modes */ - struct pinctrl *pinctrl_p; - struct pinctrl_state *pinctrl_def; - struct pinctrl_state *pinctrl_sleep; - /* Reference Count */ - int pinctrl_rxtx_ref; -}; - -struct ux500_msp_dma_params { - unsigned int data_size; - struct stedma40_chan_cfg *dma_cfg; }; struct msp_i2s_platform_data;