36 #ifndef __MHAL_I2S_H__
37 #define __MHAL_I2S_H__
39 #include "mhal_osai.h"
226 #define I2S_ELENGTH 2
442 struct osai_dma_config i2s_txdma_cfg;
444 struct osai_dma_config i2s_rxdma_cfg;
32000Hz
Definition: mhal_i2s.h:363
Real sample rate of I2S Rx is 1/2 of the sample rate.
Definition: mhal_i2s.h:296
I2S external mode.
Definition: mhal_i2s.h:341
hal_i2s_sample_rate sample_rate
Specify the sample rate of the I2S link.
Definition: mhal_i2s.h:386
int mtk_mhal_i2s_stop_tx_vfifo(struct mtk_i2s_ctlr *ctlr)
Disable the Tx VFIFO DMA transmit operation.
hal_i2s_link_bits_sample
I2S bits per sample.
Definition: mhal_i2s.h:258
I2S port is i2s0.
Definition: mhal_i2s.h:318
Function enable.
Definition: mhal_i2s.h:332
I2S configure structure.
Definition: mhal_i2s.h:416
Real sample rate of I2S Rx = sample rate.
Definition: mhal_i2s.h:294
This value means two channels.
Definition: mhal_i2s.h:309
hal_i2s_link_channel_per_sample
I2S link channel per sample.
Definition: mhal_i2s.h:245
M-HAL privite structure.
Definition: mhal_i2s.h:436
int mtk_mhal_i2s_alloc_vfifo_ch(struct mtk_i2s_ctlr *ctlr)
I2S allocate DMA channel.
int mtk_mhal_i2s_enable_audio_top(struct mtk_i2s_ctlr *ctlr)
Enable uplink FIFO and downlink FIFO of the I2S link.
hal_i2s_tx_mode
Enable or disable the right channel of I2S Tx sending the same data as the left channel of I2S Tx...
Definition: mhal_i2s.h:274
int mtk_mhal_i2s_release_vfifo_ch(struct mtk_i2s_ctlr *ctlr)
I2S release DMA channel.
i2s_fnen lr_swap
Enable or disable swapping the data of the right channel and the left channelof the I2S link...
Definition: mhal_i2s.h:405
hal_i2s_tx_mode tx_mode
Enable or disable the right channel of I2S Tx sending the same data as the left channel of I2S Tx...
Definition: mhal_i2s.h:424
hal_i2s_link_bits_sample bits_per_sample
Specify the bit number of each frame sync cycle of the I2S link.
Definition: mhal_i2s.h:397
i2s_fnen
Function enable/disable.
Definition: mhal_i2s.h:328
void * mdata
M-HAL privite structure, used by M-HAL only.
Definition: mhal_i2s.h:467
int mtk_mhal_i2s_start_tx_vfifo(struct mtk_i2s_ctlr *ctlr, u32 *buffer, u32 threshold, u32 buffer_length)
Start the Tx VFIFO DMA transmit operation.
24000Hz
Definition: mhal_i2s.h:361
i2s_no
I2S port number.
Definition: mhal_i2s.h:316
int mtk_mhal_i2s_reset(struct mtk_i2s_ctlr *ctlr)
Reset the I2S hardware.
I2S port is i2s1.
Definition: mhal_i2s.h:320
32 bits in each frame sync cycle.
Definition: mhal_i2s.h:260
int mtk_mhal_i2s_cfg_rx_dma_irq_enable(struct mtk_i2s_ctlr *ctlr, i2s_dma_callback_func callback_func)
Config Rx VFIFO DMA interrupt enable.
i2s_fnen word_select_inverse
Enable or disable word select inverse of the I2S link.
Definition: mhal_i2s.h:408
The right channel of Tx sends all 0.
Definition: mhal_i2s.h:276
hal_i2s_link_channel_per_sample channels_per_sample
Specify the channel number of each frame sync cycle of the I2S link.
Definition: mhal_i2s.h:393
void __iomem * i2s_tx_fifo_port
I2S TX FIFO port.
Definition: mhal_i2s.h:463
hal_i2s_channel_number
I2S channel number define.
Definition: mhal_i2s.h:305
int mtk_mhal_i2s_disable_rx(struct mtk_i2s_ctlr *ctlr)
Power off the I2S input link.
int mtk_mhal_i2s_move_rx_point(struct mtk_i2s_ctlr *ctlr, u32 buffer_length)
Move the SW point of Rx VFIFO DMA.
int mtk_mhal_i2s_disable_audio_top(struct mtk_i2s_ctlr *ctlr)
Disable the uplink FIFO and the downlink FIFO of I2S link.
void(* i2s_dma_callback_func)(void *user_data)
This defines the callback function prototype.
Definition: mhal_i2s.h:213
u8 i2s_rxdma_chnum
I2S RX DMA channel number.
Definition: mhal_i2s.h:461
hal_i2s_sample_rate
I2S sample rate define.
Definition: mhal_i2s.h:353
Function disable.
Definition: mhal_i2s.h:330
128 bits in each frame sync cycle.
Definition: mhal_i2s.h:264
struct hal_i2s_link_config i2s_in
I2S input link configuration.
Definition: mhal_i2s.h:418
u32 msb_offset
Specify the delay cycle from rising edge of sample rate to first channel MSB of the I2S link...
Definition: mhal_i2s.h:401
hal_i2s_rx_down_rate rx_down_rate
Enable or disable the function of real sample rate of I2S Rx being 1/2 of SR, and I2S Rx will drop on...
Definition: mhal_i2s.h:429
void * user_data
User_data is an OS-HAL defined parameter provided by mtk_mhal_i2c_dma_done_callback_register().
Definition: mhal_i2c.h:266
64 bits in each frame sync cycle.
Definition: mhal_i2s.h:262
hal_i2s_channel_number channel_number
Specify the channel number of the I2S link.
Definition: mhal_i2s.h:389
int mtk_mhal_i2s_move_tx_point(struct mtk_i2s_ctlr *ctlr, u32 buffer_length)
Move the SW point of Tx VFIFO DMA.
int mtk_mhal_i2s_stop_rx_vfifo(struct mtk_i2s_ctlr *ctlr)
Disable the Rx VFIFO DMA receive operation.
12000Hz
Definition: mhal_i2s.h:357
int mtk_mhal_i2s_set_config(struct mtk_i2s_ctlr *ctlr, struct hal_i2s_config *config)
Set the I2S configuration in detail.
i2s_no i2s_port
I2S port number.
Definition: mhal_i2s.h:457
Four channels in each frame sync cycle.
Definition: mhal_i2s.h:249
struct hal_i2s_link_config i2s_out
I2S output link configuration.
Definition: mhal_i2s.h:420
I2S internal loopback mode.
Definition: mhal_i2s.h:345
I2S external TDM mode.
Definition: mhal_i2s.h:343
int mtk_mhal_i2s_start_rx_vfifo(struct mtk_i2s_ctlr *ctlr, u32 *buffer, u32 threshold, u32 buffer_length)
Start the Rx VFIFO DMA receive operation.
int mtk_mhal_i2s_cfg_tx_dma_irq_enable(struct mtk_i2s_ctlr *ctlr, i2s_dma_callback_func callback_func)
Config Tx VFIFO DMA interrupt enable.
int mtk_mhal_i2s_cfg_tx_dma_irq_disable(struct mtk_i2s_ctlr *ctlr)
Config Tx VFIFO DMA interrupt disable.
hal_i2s_rx_down_rate
Enable or disable 2x down sample rate mode in the I2S Rx link.
Definition: mhal_i2s.h:292
hal_i2s_initial_type
This enum defines the initial type of I2S.
Definition: mhal_i2s.h:339
int mtk_mhal_i2s_clk_en(struct mtk_i2s_ctlr *ctlr, i2s_fnen en)
enable the I2S clock.
int mtk_mhal_i2s_enable_tx(struct mtk_i2s_ctlr *ctlr)
Power on the I2S the output link.
void __iomem * i2s_rx_fifo_port
I2S RX FIFO port.
Definition: mhal_i2s.h:465
8000Hz
Definition: mhal_i2s.h:355
Two channels in each frame sync cycle.
Definition: mhal_i2s.h:247
I2S control structure.
Definition: mhal_i2s.h:453
The right channel of Tx sends the same data as the left channelof I2S Tx.
Definition: mhal_i2s.h:280
int mtk_mhal_i2s_cfg_type(struct mtk_i2s_ctlr *ctlr, hal_i2s_initial_type i2s_initial_type)
Configure I2S type.
int mtk_mhal_i2s_enable_rx(struct mtk_i2s_ctlr *ctlr)
Power on the I2S input link.
int mtk_mhal_i2s_cfg_rx_dma_irq_disable(struct mtk_i2s_ctlr *ctlr)
Config Rx VFIFO DMA interrupt disable.
16000Hz
Definition: mhal_i2s.h:359
void __iomem * base
I2S port base address.
Definition: mhal_i2s.h:455
This value means one channel.
Definition: mhal_i2s.h:307
u8 i2s_txdma_chnum
I2S TX DMA channel number.
Definition: mhal_i2s.h:459
I2S link structure.
Definition: mhal_i2s.h:383
int mtk_mhal_i2s_disable_tx(struct mtk_i2s_ctlr *ctlr)
Power off the I2S output link.
48000Hz
Definition: mhal_i2s.h:365