aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/sound/mxs-saif.txt17
-rw-r--r--sound/soc/mxs/mxs-pcm.c18
-rw-r--r--sound/soc/mxs/mxs-pcm.h7
-rw-r--r--sound/soc/mxs/mxs-saif.c29
-rw-r--r--sound/soc/mxs/mxs-saif.h1
5 files changed, 12 insertions, 60 deletions
diff --git a/Documentation/devicetree/bindings/sound/mxs-saif.txt b/Documentation/devicetree/bindings/sound/mxs-saif.txt
index c37ba6143d9b..7ba07a118e37 100644
--- a/Documentation/devicetree/bindings/sound/mxs-saif.txt
+++ b/Documentation/devicetree/bindings/sound/mxs-saif.txt
@@ -3,8 +3,11 @@
3Required properties: 3Required properties:
4- compatible: Should be "fsl,<chip>-saif" 4- compatible: Should be "fsl,<chip>-saif"
5- reg: Should contain registers location and length 5- reg: Should contain registers location and length
6- interrupts: Should contain ERROR and DMA interrupts 6- interrupts: Should contain ERROR interrupt number
7- fsl,saif-dma-channel: APBX DMA channel for the SAIF 7- dmas: DMA specifier, consisting of a phandle to DMA controller node
8 and SAIF DMA channel ID.
9 Refer to dma.txt and fsl-mxs-dma.txt for details.
10- dma-names: Must be "rx-tx".
8 11
9Optional properties: 12Optional properties:
10- fsl,saif-master: phandle to the master SAIF. It's only required for 13- fsl,saif-master: phandle to the master SAIF. It's only required for
@@ -23,14 +26,16 @@ aliases {
23saif0: saif@80042000 { 26saif0: saif@80042000 {
24 compatible = "fsl,imx28-saif"; 27 compatible = "fsl,imx28-saif";
25 reg = <0x80042000 2000>; 28 reg = <0x80042000 2000>;
26 interrupts = <59 80>; 29 interrupts = <59>;
27 fsl,saif-dma-channel = <4>; 30 dmas = <&dma_apbx 4>;
31 dma-names = "rx-tx";
28}; 32};
29 33
30saif1: saif@80046000 { 34saif1: saif@80046000 {
31 compatible = "fsl,imx28-saif"; 35 compatible = "fsl,imx28-saif";
32 reg = <0x80046000 2000>; 36 reg = <0x80046000 2000>;
33 interrupts = <58 81>; 37 interrupts = <58>;
34 fsl,saif-dma-channel = <5>; 38 dmas = <&dma_apbx 5>;
39 dma-names = "rx-tx";
35 fsl,saif-master = <&saif0>; 40 fsl,saif-master = <&saif0>;
36}; 41};
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
52static 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
67static const struct snd_dmaengine_pcm_config mxs_dmaengine_pcm_config = { 52static 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}
81EXPORT_SYMBOL_GPL(mxs_pcm_platform_register); 63EXPORT_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
24struct mxs_pcm_dma_params {
25 struct mxs_dma_data dma_data;
26 int chan_num;
27};
28
29int mxs_pcm_platform_register(struct device *dev); 22int mxs_pcm_platform_register(struct device *dev);
30void mxs_pcm_platform_unregister(struct device *dev); 23void 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)
664static int mxs_saif_probe(struct platform_device *pdev) 661static 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;