diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-17 12:20:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-17 12:20:23 -0400 |
commit | c76a507bfeaeaa82f2e306266a0722b1a2d37fde (patch) | |
tree | e76a7bf1a6ca3cc1a58ab52235f122a31246cc71 /sound/soc/mxs | |
parent | ff868b229657d5a2e449df7b1e2cc465ec86991d (diff) | |
parent | 62477adf5f4ede918a97e648a5173b00bbbb17cc (diff) |
Merge remote-tracking branch 'asoc/topic/mxs' into asoc-next
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 | 37 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-saif.h | 1 |
4 files changed, 1 insertions, 62 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 d31dc52fa862..49d870034bc3 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
@@ -26,8 +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 <linux/pinctrl/consumer.h> | ||
31 | #include <sound/core.h> | 29 | #include <sound/core.h> |
32 | #include <sound/pcm.h> | 30 | #include <sound/pcm.h> |
33 | #include <sound/pcm_params.h> | 31 | #include <sound/pcm_params.h> |
@@ -605,8 +603,6 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai) | |||
605 | struct mxs_saif *saif = dev_get_drvdata(dai->dev); | 603 | struct mxs_saif *saif = dev_get_drvdata(dai->dev); |
606 | 604 | ||
607 | snd_soc_dai_set_drvdata(dai, saif); | 605 | snd_soc_dai_set_drvdata(dai, saif); |
608 | dai->playback_dma_data = &saif->dma_param; | ||
609 | dai->capture_dma_data = &saif->dma_param; | ||
610 | 606 | ||
611 | return 0; | 607 | return 0; |
612 | } | 608 | } |
@@ -665,9 +661,8 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id) | |||
665 | static int mxs_saif_probe(struct platform_device *pdev) | 661 | static int mxs_saif_probe(struct platform_device *pdev) |
666 | { | 662 | { |
667 | struct device_node *np = pdev->dev.of_node; | 663 | struct device_node *np = pdev->dev.of_node; |
668 | struct resource *iores, *dmares; | 664 | struct resource *iores; |
669 | struct mxs_saif *saif; | 665 | struct mxs_saif *saif; |
670 | struct pinctrl *pinctrl; | ||
671 | int ret = 0; | 666 | int ret = 0; |
672 | struct device_node *master; | 667 | struct device_node *master; |
673 | 668 | ||
@@ -707,12 +702,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
707 | 702 | ||
708 | mxs_saif[saif->id] = saif; | 703 | mxs_saif[saif->id] = saif; |
709 | 704 | ||
710 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
711 | if (IS_ERR(pinctrl)) { | ||
712 | ret = PTR_ERR(pinctrl); | ||
713 | return ret; | ||
714 | } | ||
715 | |||
716 | saif->clk = devm_clk_get(&pdev->dev, NULL); | 705 | saif->clk = devm_clk_get(&pdev->dev, NULL); |
717 | if (IS_ERR(saif->clk)) { | 706 | if (IS_ERR(saif->clk)) { |
718 | ret = PTR_ERR(saif->clk); | 707 | ret = PTR_ERR(saif->clk); |
@@ -727,22 +716,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
727 | if (IS_ERR(saif->base)) | 716 | if (IS_ERR(saif->base)) |
728 | return PTR_ERR(saif->base); | 717 | return PTR_ERR(saif->base); |
729 | 718 | ||
730 | dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); | ||
731 | if (!dmares) { | ||
732 | /* | ||
733 | * TODO: This is a temporary solution and should be changed | ||
734 | * to use generic DMA binding later when the helplers get in. | ||
735 | */ | ||
736 | ret = of_property_read_u32(np, "fsl,saif-dma-channel", | ||
737 | &saif->dma_param.chan_num); | ||
738 | if (ret) { | ||
739 | dev_err(&pdev->dev, "failed to get dma channel\n"); | ||
740 | return ret; | ||
741 | } | ||
742 | } else { | ||
743 | saif->dma_param.chan_num = dmares->start; | ||
744 | } | ||
745 | |||
746 | saif->irq = platform_get_irq(pdev, 0); | 719 | saif->irq = platform_get_irq(pdev, 0); |
747 | if (saif->irq < 0) { | 720 | if (saif->irq < 0) { |
748 | ret = saif->irq; | 721 | ret = saif->irq; |
@@ -759,14 +732,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
759 | return ret; | 732 | return ret; |
760 | } | 733 | } |
761 | 734 | ||
762 | saif->dma_param.dma_data.chan_irq = platform_get_irq(pdev, 1); | ||
763 | if (saif->dma_param.dma_data.chan_irq < 0) { | ||
764 | ret = saif->dma_param.dma_data.chan_irq; | ||
765 | dev_err(&pdev->dev, "failed to get dma irq resource: %d\n", | ||
766 | ret); | ||
767 | return ret; | ||
768 | } | ||
769 | |||
770 | platform_set_drvdata(pdev, saif); | 735 | platform_set_drvdata(pdev, saif); |
771 | 736 | ||
772 | 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; |