#include "imx-ssi.h"
#include "imx-pcm.h"
+struct asrc_p2p_ops *asrc_pcm_p2p_ops;
+
+void asrc_p2p_hook(struct asrc_p2p_ops *asrc_p2p_ct)
+{
+ asrc_pcm_p2p_ops = asrc_p2p_ct;
+ return ;
+}
+EXPORT_SYMBOL(asrc_p2p_hook);
static void audio_dma_irq(void *data)
{
iprtd->asrc_dma_data.peripheral_type = IMX_DMATYPE_ASRC;
iprtd->asrc_dma_data.priority = DMA_PRIO_HIGH;
iprtd->asrc_dma_data.dma_request =
- asrc_get_dma_request(iprtd->asrc_index, 1);
+ iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_get_dma_request(iprtd->asrc_index, 1);
iprtd->asrc_dma_chan = dma_request_channel(mask, asrc_filter, iprtd);
if (!iprtd->asrc_dma_chan)
goto error;
slave_config.direction = DMA_TO_DEVICE;
- slave_config.dst_addr = asrc_get_per_addr(iprtd->asrc_index, 1);
+ slave_config.dst_addr = iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_per_addr(iprtd->asrc_index, 1);
slave_config.dst_addr_width = buswidth;
slave_config.dst_maxburst = dma_params->burstsize * buswidth;
iprtd->asrc_p2p_dma_data.peripheral_type = IMX_DMATYPE_ASRC;
iprtd->asrc_p2p_dma_data.priority = DMA_PRIO_HIGH;
iprtd->asrc_p2p_dma_data.dma_request =
- asrc_get_dma_request(iprtd->asrc_index, 0);
+ iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_get_dma_request(iprtd->asrc_index, 0);
iprtd->asrc_p2p_dma_data.dma_request_p2p = dma_params->dma;
iprtd->asrc_p2p_dma_chan =
dma_request_channel(mask, asrc_p2p_filter, iprtd);
}
slave_config.direction = DMA_DEV_TO_DEV;
- slave_config.src_addr = asrc_get_per_addr(iprtd->asrc_index, 0);
+ slave_config.src_addr = iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_per_addr(iprtd->asrc_index, 0);
slave_config.src_addr_width = buswidth;
slave_config.src_maxburst = dma_params->burstsize * buswidth;
slave_config.dst_addr = dma_params->dma_addr;
if (iprtd->asrc_enable) {
dmaengine_submit(iprtd->asrc_p2p_desc);
dmaengine_submit(iprtd->asrc_desc);
- asrc_start_conv(iprtd->asrc_index);
+ iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_start_conv(iprtd->asrc_index);
mdelay(1);
} else {
dmaengine_submit(iprtd->desc);
if (iprtd->asrc_enable) {
dmaengine_terminate_all(iprtd->asrc_dma_chan);
dmaengine_terminate_all(iprtd->asrc_p2p_dma_chan);
- asrc_stop_conv(iprtd->asrc_index);
+ iprtd->asrc_pcm_p2p_ops_ko->
+ asrc_p2p_stop_conv(iprtd->asrc_index);
} else {
dmaengine_terminate_all(iprtd->dma_chan);
}
iprtd->p2p =
(struct asrc_p2p_params *)snd_soc_pcm_get_drvdata(rtd);
iprtd->asrc_index = -1;
+ if (!asrc_pcm_p2p_ops) {
+ pr_err("ASRC is not loaded!\n");
+ return -EINVAL;
+ }
+ iprtd->asrc_pcm_p2p_ops_ko = asrc_pcm_p2p_ops;
}
runtime->private_data = iprtd;