diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-11-04 12:05:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-05 09:14:13 -0400 |
commit | f562be51fe9021c913e661c46681cb5bae70f369 (patch) | |
tree | 61dea5f616064563b690e2721542f4656771b535 /sound | |
parent | bf0199b7a5085e8d1908d2b0a9c530ed8d142fb8 (diff) |
ASoC i.MX: register dma audio device
We have two different transfer methods on i.MX: FIQ and DMA. Since
the merge of the ASoC multicomponent support the DMA device is lost.
Add it again. Also, imx_ssi_dai_probe has to be called for !AC97
aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/imx/imx-ssi.c | 44 | ||||
-rw-r--r-- | sound/soc/imx/imx-ssi.h | 1 |
2 files changed, 30 insertions, 15 deletions
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index d4bd345b0a8d..d2d98c75ee8a 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c | |||
@@ -439,7 +439,22 @@ void imx_pcm_free(struct snd_pcm *pcm) | |||
439 | } | 439 | } |
440 | EXPORT_SYMBOL_GPL(imx_pcm_free); | 440 | EXPORT_SYMBOL_GPL(imx_pcm_free); |
441 | 441 | ||
442 | static int imx_ssi_dai_probe(struct snd_soc_dai *dai) | ||
443 | { | ||
444 | struct imx_ssi *ssi = dev_get_drvdata(dai->dev); | ||
445 | uint32_t val; | ||
446 | |||
447 | snd_soc_dai_set_drvdata(dai, ssi); | ||
448 | |||
449 | val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | | ||
450 | SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); | ||
451 | writel(val, ssi->base + SSI_SFCSR); | ||
452 | |||
453 | return 0; | ||
454 | } | ||
455 | |||
442 | static struct snd_soc_dai_driver imx_ssi_dai = { | 456 | static struct snd_soc_dai_driver imx_ssi_dai = { |
457 | .probe = imx_ssi_dai_probe, | ||
443 | .playback = { | 458 | .playback = { |
444 | .channels_min = 2, | 459 | .channels_min = 2, |
445 | .channels_max = 2, | 460 | .channels_max = 2, |
@@ -455,20 +470,6 @@ static struct snd_soc_dai_driver imx_ssi_dai = { | |||
455 | .ops = &imx_ssi_pcm_dai_ops, | 470 | .ops = &imx_ssi_pcm_dai_ops, |
456 | }; | 471 | }; |
457 | 472 | ||
458 | static int imx_ssi_dai_probe(struct snd_soc_dai *dai) | ||
459 | { | ||
460 | struct imx_ssi *ssi = dev_get_drvdata(dai->dev); | ||
461 | uint32_t val; | ||
462 | |||
463 | snd_soc_dai_set_drvdata(dai, ssi); | ||
464 | |||
465 | val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | | ||
466 | SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); | ||
467 | writel(val, ssi->base + SSI_SFCSR); | ||
468 | |||
469 | return 0; | ||
470 | } | ||
471 | |||
472 | static struct snd_soc_dai_driver imx_ac97_dai = { | 473 | static struct snd_soc_dai_driver imx_ac97_dai = { |
473 | .probe = imx_ssi_dai_probe, | 474 | .probe = imx_ssi_dai_probe, |
474 | .ac97_control = 1, | 475 | .ac97_control = 1, |
@@ -677,7 +678,17 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
677 | goto failed_register; | 678 | goto failed_register; |
678 | } | 679 | } |
679 | 680 | ||
680 | ssi->soc_platform_pdev = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); | 681 | ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); |
682 | if (!ssi->soc_platform_pdev_fiq) | ||
683 | goto failed_pdev_fiq_alloc; | ||
684 | platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); | ||
685 | ret = platform_device_add(ssi->soc_platform_pdev_fiq); | ||
686 | if (ret) { | ||
687 | dev_err(&pdev->dev, "failed to add platform device\n"); | ||
688 | goto failed_pdev_fiq_add; | ||
689 | } | ||
690 | |||
691 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); | ||
681 | if (!ssi->soc_platform_pdev) | 692 | if (!ssi->soc_platform_pdev) |
682 | goto failed_pdev_alloc; | 693 | goto failed_pdev_alloc; |
683 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); | 694 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); |
@@ -692,6 +703,9 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
692 | failed_pdev_add: | 703 | failed_pdev_add: |
693 | platform_device_put(ssi->soc_platform_pdev); | 704 | platform_device_put(ssi->soc_platform_pdev); |
694 | failed_pdev_alloc: | 705 | failed_pdev_alloc: |
706 | failed_pdev_fiq_add: | ||
707 | platform_device_put(ssi->soc_platform_pdev_fiq); | ||
708 | failed_pdev_fiq_alloc: | ||
695 | snd_soc_unregister_dai(&pdev->dev); | 709 | snd_soc_unregister_dai(&pdev->dev); |
696 | failed_register: | 710 | failed_register: |
697 | failed_ac97: | 711 | failed_ac97: |
diff --git a/sound/soc/imx/imx-ssi.h b/sound/soc/imx/imx-ssi.h index 53b780d9b2b0..4fc17da11866 100644 --- a/sound/soc/imx/imx-ssi.h +++ b/sound/soc/imx/imx-ssi.h | |||
@@ -212,6 +212,7 @@ struct imx_ssi { | |||
212 | int enabled; | 212 | int enabled; |
213 | 213 | ||
214 | struct platform_device *soc_platform_pdev; | 214 | struct platform_device *soc_platform_pdev; |
215 | struct platform_device *soc_platform_pdev_fiq; | ||
215 | }; | 216 | }; |
216 | 217 | ||
217 | struct snd_soc_platform *imx_ssi_fiq_init(struct platform_device *pdev, | 218 | struct snd_soc_platform *imx_ssi_fiq_init(struct platform_device *pdev, |