diff options
author | Ge Lei <b42127@freescale.com> | 2012-11-15 14:46:19 +0800 |
---|---|---|
committer | Chen Liangjun <b36089@freescale.com> | 2012-11-15 17:19:17 +0800 |
commit | 72ab3f46c599fadabf83f17b0bde7d6887c805fd (patch) | |
tree | b1770dc63840bed3d52b70c633fc37e149800a7e /drivers | |
parent | 3a34fe70afc521a01f13cdd80bc2f5ae23e3b4c8 (diff) |
ENGR00233570-1 ASRC: Use hook to add support for ASRC loadable
ASoC ESAI machine driver and pcm platform driver use the APIs from mxc_asrc.c,
but once ASRC is used as a loadable module, these files can't find the APIs
from this ko. In this patch, we use 'asrc_p2p_hook' to hook the APIs which will
be used in ASoC ESAI machine driver and pcm platform driver.
Signed-off-by: Ge Lei <b42127@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/asrc/mxc_asrc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c index d7edf78cc87d..6c5daed7ce53 100644 --- a/drivers/mxc/asrc/mxc_asrc.c +++ b/drivers/mxc/asrc/mxc_asrc.c @@ -154,6 +154,8 @@ static unsigned char output_clk_map_v2[] = { 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, @@ -2060,6 +2062,18 @@ static struct platform_driver mxc_asrc_driver = { 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; } @@ -2069,6 +2083,8 @@ static __init int asrc_init(void) * */ static void __exit asrc_exit(void) { + asrc_p2p_hook(NULL); + platform_driver_unregister(&mxc_asrc_driver); return; } |