diff options
Diffstat (limited to 'sound/soc/atmel/atmel_ssc_dai.c')
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 170561407f61..1c7663422054 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -721,6 +721,8 @@ static struct snd_soc_dai_driver atmel_ssc_dai = { static int asoc_ssc_init(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); + struct ssc_device *ssc = platform_get_drvdata(pdev); int ret; ret = snd_soc_register_dai(dev, &atmel_ssc_dai); @@ -729,7 +731,11 @@ static int asoc_ssc_init(struct device *dev) goto err; } - ret = atmel_pcm_pdc_platform_register(dev); + if (ssc->pdata->use_dma) + ret = atmel_pcm_dma_platform_register(dev); + else + ret = atmel_pcm_pdc_platform_register(dev); + if (ret) { dev_err(dev, "Could not register PCM: %d\n", ret); goto err_unregister_dai; @@ -745,7 +751,14 @@ err: static void asoc_ssc_exit(struct device *dev) { - atmel_pcm_pdc_platform_unregister(dev); + struct platform_device *pdev = to_platform_device(dev); + struct ssc_device *ssc = platform_get_drvdata(pdev); + + if (ssc->pdata->use_dma) + atmel_pcm_dma_platform_unregister(dev); + else + atmel_pcm_pdc_platform_unregister(dev); + snd_soc_unregister_dai(dev); } |