驱动 HLD

1. The audio driver picture based on alsa.









2. HIAO functions:
1) alsa_hiao_init
register the device and driver of hiao.
2) snd_hiao_pcm
register playback stream
3) snd_card_hiao_ctl
register controls such as mute or volume adjustment
4) snd_hiao_hw_params
set audio parameters, allocate memory
5) snd_hiao_playback_prepare
flush all buffer
6) snd_hiao_interrupt
Interrupt sevice program
7) snd_hiao_playback_trigger
start, stop or pause the playback
8) snd_hiao_ack
fill data to hiao buffer.
Note:
Hiao needs audio data with special format, so a special data format transform is needed.
We cannot place the transform to a tasklet. Because (1). fill one period once, if the isr is delayed and merged, it cause error.(2). Fill all free, we can not be sure the data is valid.
We place the transform to a callback after the data is written by user space program, but in memory map situation, the call back is not triggered. So we modify the alsa core to ensure the callback be triggered in memory map situation.
3. SIO functions:
1) hi_i2s_mod_init
register device and driver of sio, register dai of sio
2) godbox_aic31_mod_init
declare dai pair to connect sio with aic31
3) hi_pcm_new
register playback and record streams
4) hi_i2s_ops_hw_params, godbox_ops_hw_params
set audio parameters.
5) hi_pcm_dma_complete
Interrupt sevice program
6) hi_i2s_ops_trigger, hi_pcm_trigger
to start, stop or pause sio and dma

Note:
We use the standard aic3x driver in linux kernel.

你可能感兴趣的:(linux)