static unsigned char *input_clk_map, *output_clk_map;
+struct asrc_p2p_ops asrc_pcm_p2p_ops_asrc;
+
static struct dma_chan *imx_asrc_dma_alloc(u32 dma_req);
static int imx_asrc_dma_config(
struct asrc_pair_params *params,
static __init int asrc_init(void)
{
int ret;
+
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_start_conv = asrc_start_conv;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_stop_conv = asrc_stop_conv;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_get_dma_request = asrc_get_dma_request;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_per_addr = asrc_get_per_addr;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_req_pair = asrc_req_pair;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_config_pair = asrc_config_pair;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_release_pair = asrc_release_pair;
+ asrc_pcm_p2p_ops_asrc.asrc_p2p_finish_conv = asrc_finish_conv;
+
+ asrc_p2p_hook(&asrc_pcm_p2p_ops_asrc);
+
ret = platform_driver_register(&mxc_asrc_driver);
return ret;
}
*
*/ static void __exit asrc_exit(void)
{
+ asrc_p2p_hook(NULL);
+
platform_driver_unregister(&mxc_asrc_driver);
return;
}
struct device *dev;
};
+struct asrc_p2p_ops {
+ void (*asrc_p2p_start_conv)(enum asrc_pair_index);
+ void (*asrc_p2p_stop_conv)(enum asrc_pair_index);
+ int (*asrc_p2p_get_dma_request)(enum asrc_pair_index, bool);
+ u32 (*asrc_p2p_per_addr)(enum asrc_pair_index, bool);
+ int (*asrc_p2p_req_pair)(int, enum asrc_pair_index *index);
+ int (*asrc_p2p_config_pair)(struct asrc_config *config);
+ void (*asrc_p2p_release_pair)(enum asrc_pair_index);
+ void (*asrc_p2p_finish_conv)(enum asrc_pair_index);
+};
+
+extern void asrc_p2p_hook(struct asrc_p2p_ops *asrc_p2p_ct);
+
extern int asrc_req_pair(int chn_num, enum asrc_pair_index *index);
extern void asrc_release_pair(enum asrc_pair_index index);
extern int asrc_config_pair(struct asrc_config *config);