diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-05-13 01:30:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-13 01:55:28 -0400 |
commit | 62477adf5f4ede918a97e648a5173b00bbbb17cc (patch) | |
tree | d450067daf66cc0e7ed8fcbfcd75d1331760c39d /sound/soc/mxs | |
parent | e76af6d189075a0ca59bc654157e80da53559fb0 (diff) |
ASoC: mxs: move to use generic DMA helper
With mxs-dma converted to generic DMA bindings, let's move mxs-pcm to
use it by removing flages SND_DMAENGINE_PCM_FLAG_NO_DT and
SND_DMAENGINE_PCM_FLAG_COMPAT. As the result, those mxs custom dma
params code can be removed now.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mxs')
-rw-r--r-- | sound/soc/mxs/mxs-pcm.c | 18 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-pcm.h | 7 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-saif.c | 29 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-saif.h | 1 |
4 files changed, 1 insertions, 54 deletions
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index b41fffc056fb..b16abbbf7764 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c | |||
@@ -49,24 +49,8 @@ static const struct snd_pcm_hardware snd_mxs_hardware = { | |||
49 | .fifo_size = 32, | 49 | .fifo_size = 32, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static bool filter(struct dma_chan *chan, void *param) | ||
53 | { | ||
54 | struct mxs_pcm_dma_params *dma_params = param; | ||
55 | |||
56 | if (!mxs_dma_is_apbx(chan)) | ||
57 | return false; | ||
58 | |||
59 | if (chan->chan_id != dma_params->chan_num) | ||
60 | return false; | ||
61 | |||
62 | chan->private = &dma_params->dma_data; | ||
63 | |||
64 | return true; | ||
65 | } | ||
66 | |||
67 | static const struct snd_dmaengine_pcm_config mxs_dmaengine_pcm_config = { | 52 | static const struct snd_dmaengine_pcm_config mxs_dmaengine_pcm_config = { |
68 | .pcm_hardware = &snd_mxs_hardware, | 53 | .pcm_hardware = &snd_mxs_hardware, |
69 | .compat_filter_fn = filter, | ||
70 | .prealloc_buffer_size = 64 * 1024, | 54 | .prealloc_buffer_size = 64 * 1024, |
71 | }; | 55 | }; |
72 | 56 | ||
@@ -74,8 +58,6 @@ int mxs_pcm_platform_register(struct device *dev) | |||
74 | { | 58 | { |
75 | return snd_dmaengine_pcm_register(dev, &mxs_dmaengine_pcm_config, | 59 | return snd_dmaengine_pcm_register(dev, &mxs_dmaengine_pcm_config, |
76 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | | 60 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | |
77 | SND_DMAENGINE_PCM_FLAG_NO_DT | | ||
78 | SND_DMAENGINE_PCM_FLAG_COMPAT | | ||
79 | SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX); | 61 | SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX); |
80 | } | 62 | } |
81 | EXPORT_SYMBOL_GPL(mxs_pcm_platform_register); | 63 | EXPORT_SYMBOL_GPL(mxs_pcm_platform_register); |
diff --git a/sound/soc/mxs/mxs-pcm.h b/sound/soc/mxs/mxs-pcm.h index 3aa918f9ed3e..bc685b67cac7 100644 --- a/sound/soc/mxs/mxs-pcm.h +++ b/sound/soc/mxs/mxs-pcm.h | |||
@@ -19,13 +19,6 @@ | |||
19 | #ifndef _MXS_PCM_H | 19 | #ifndef _MXS_PCM_H |
20 | #define _MXS_PCM_H | 20 | #define _MXS_PCM_H |
21 | 21 | ||
22 | #include <linux/fsl/mxs-dma.h> | ||
23 | |||
24 | struct mxs_pcm_dma_params { | ||
25 | struct mxs_dma_data dma_data; | ||
26 | int chan_num; | ||
27 | }; | ||
28 | |||
29 | int mxs_pcm_platform_register(struct device *dev); | 22 | int mxs_pcm_platform_register(struct device *dev); |
30 | void mxs_pcm_platform_unregister(struct device *dev); | 23 | void mxs_pcm_platform_unregister(struct device *dev); |
31 | 24 | ||
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 71a972f5af97..49d870034bc3 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/time.h> | 28 | #include <linux/time.h> |
29 | #include <linux/fsl/mxs-dma.h> | ||
30 | #include <sound/core.h> | 29 | #include <sound/core.h> |
31 | #include <sound/pcm.h> | 30 | #include <sound/pcm.h> |
32 | #include <sound/pcm_params.h> | 31 | #include <sound/pcm_params.h> |
@@ -604,8 +603,6 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai) | |||
604 | struct mxs_saif *saif = dev_get_drvdata(dai->dev); | 603 | struct mxs_saif *saif = dev_get_drvdata(dai->dev); |
605 | 604 | ||
606 | snd_soc_dai_set_drvdata(dai, saif); | 605 | snd_soc_dai_set_drvdata(dai, saif); |
607 | dai->playback_dma_data = &saif->dma_param; | ||
608 | dai->capture_dma_data = &saif->dma_param; | ||
609 | 606 | ||
610 | return 0; | 607 | return 0; |
611 | } | 608 | } |
@@ -664,7 +661,7 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id) | |||
664 | static int mxs_saif_probe(struct platform_device *pdev) | 661 | static int mxs_saif_probe(struct platform_device *pdev) |
665 | { | 662 | { |
666 | struct device_node *np = pdev->dev.of_node; | 663 | struct device_node *np = pdev->dev.of_node; |
667 | struct resource *iores, *dmares; | 664 | struct resource *iores; |
668 | struct mxs_saif *saif; | 665 | struct mxs_saif *saif; |
669 | int ret = 0; | 666 | int ret = 0; |
670 | struct device_node *master; | 667 | struct device_node *master; |
@@ -719,22 +716,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
719 | if (IS_ERR(saif->base)) | 716 | if (IS_ERR(saif->base)) |
720 | return PTR_ERR(saif->base); | 717 | return PTR_ERR(saif->base); |
721 | 718 | ||
722 | dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); | ||
723 | if (!dmares) { | ||
724 | /* | ||
725 | * TODO: This is a temporary solution and should be changed | ||
726 | * to use generic DMA binding later when the helplers get in. | ||
727 | */ | ||
728 | ret = of_property_read_u32(np, "fsl,saif-dma-channel", | ||
729 | &saif->dma_param.chan_num); | ||
730 | if (ret) { | ||
731 | dev_err(&pdev->dev, "failed to get dma channel\n"); | ||
732 | return ret; | ||
733 | } | ||
734 | } else { | ||
735 | saif->dma_param.chan_num = dmares->start; | ||
736 | } | ||
737 | |||
738 | saif->irq = platform_get_irq(pdev, 0); | 719 | saif->irq = platform_get_irq(pdev, 0); |
739 | if (saif->irq < 0) { | 720 | if (saif->irq < 0) { |
740 | ret = saif->irq; | 721 | ret = saif->irq; |
@@ -751,14 +732,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
751 | return ret; | 732 | return ret; |
752 | } | 733 | } |
753 | 734 | ||
754 | saif->dma_param.dma_data.chan_irq = platform_get_irq(pdev, 1); | ||
755 | if (saif->dma_param.dma_data.chan_irq < 0) { | ||
756 | ret = saif->dma_param.dma_data.chan_irq; | ||
757 | dev_err(&pdev->dev, "failed to get dma irq resource: %d\n", | ||
758 | ret); | ||
759 | return ret; | ||
760 | } | ||
761 | |||
762 | platform_set_drvdata(pdev, saif); | 735 | platform_set_drvdata(pdev, saif); |
763 | 736 | ||
764 | ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component, | 737 | ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component, |
diff --git a/sound/soc/mxs/mxs-saif.h b/sound/soc/mxs/mxs-saif.h index 3cb342e5bc90..53eaa4bf0e27 100644 --- a/sound/soc/mxs/mxs-saif.h +++ b/sound/soc/mxs/mxs-saif.h | |||
@@ -117,7 +117,6 @@ struct mxs_saif { | |||
117 | unsigned int mclk_in_use; | 117 | unsigned int mclk_in_use; |
118 | void __iomem *base; | 118 | void __iomem *base; |
119 | int irq; | 119 | int irq; |
120 | struct mxs_pcm_dma_params dma_param; | ||
121 | unsigned int id; | 120 | unsigned int id; |
122 | unsigned int master_id; | 121 | unsigned int master_id; |
123 | unsigned int cur_rate; | 122 | unsigned int cur_rate; |