diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-12-10 14:34:45 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-18 13:54:00 -0500 |
commit | 6f2032a18969d22740a865e0b4f2e48cf5338f36 (patch) | |
tree | febca721ef37f8d0ff3cc67a29e9d29181414a33 /sound/soc/cirrus | |
parent | 237eeb1c044fdd0f406a8484ee31884e34b9dfc5 (diff) |
ASoC: ep93xx: get rid of ep93xx-pcm-audio struct device
Modify the ep93xx PCM driver so that it's a utility library that can be
registered on each DAI, rather than a separate struct device. This is
more in line with how many recent DT-converted platforms operate, and
avoids the need for yet another struct device.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/cirrus')
-rw-r--r-- | sound/soc/cirrus/edb93xx.c | 2 | ||||
-rw-r--r-- | sound/soc/cirrus/ep93xx-ac97.c | 8 | ||||
-rw-r--r-- | sound/soc/cirrus/ep93xx-i2s.c | 8 | ||||
-rw-r--r-- | sound/soc/cirrus/ep93xx-pcm.c | 19 | ||||
-rw-r--r-- | sound/soc/cirrus/ep93xx-pcm.h | 22 | ||||
-rw-r--r-- | sound/soc/cirrus/simone.c | 2 | ||||
-rw-r--r-- | sound/soc/cirrus/snappercl15.c | 2 |
7 files changed, 46 insertions, 17 deletions
diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c index c43fb214558a..4f900efc437c 100644 --- a/sound/soc/cirrus/edb93xx.c +++ b/sound/soc/cirrus/edb93xx.c | |||
@@ -63,7 +63,7 @@ static struct snd_soc_ops edb93xx_ops = { | |||
63 | static struct snd_soc_dai_link edb93xx_dai = { | 63 | static struct snd_soc_dai_link edb93xx_dai = { |
64 | .name = "CS4271", | 64 | .name = "CS4271", |
65 | .stream_name = "CS4271 HiFi", | 65 | .stream_name = "CS4271 HiFi", |
66 | .platform_name = "ep93xx-pcm-audio", | 66 | .platform_name = "ep93xx-i2s", |
67 | .cpu_dai_name = "ep93xx-i2s", | 67 | .cpu_dai_name = "ep93xx-i2s", |
68 | .codec_name = "spi0.0", | 68 | .codec_name = "spi0.0", |
69 | .codec_dai_name = "cs4271-hifi", | 69 | .codec_dai_name = "cs4271-hifi", |
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index efa75b5086a4..cc5583da5380 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <linux/platform_data/dma-ep93xx.h> | 25 | #include <linux/platform_data/dma-ep93xx.h> |
26 | 26 | ||
27 | #include "ep93xx-pcm.h" | ||
28 | |||
27 | /* | 29 | /* |
28 | * Per channel (1-4) registers. | 30 | * Per channel (1-4) registers. |
29 | */ | 31 | */ |
@@ -394,8 +396,14 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) | |||
394 | if (ret) | 396 | if (ret) |
395 | goto fail; | 397 | goto fail; |
396 | 398 | ||
399 | ret = devm_ep93xx_pcm_platform_register(&pdev->dev); | ||
400 | if (ret) | ||
401 | goto fail_unregister; | ||
402 | |||
397 | return 0; | 403 | return 0; |
398 | 404 | ||
405 | fail_unregister: | ||
406 | snd_soc_unregister_component(&pdev->dev); | ||
399 | fail: | 407 | fail: |
400 | ep93xx_ac97_info = NULL; | 408 | ep93xx_ac97_info = NULL; |
401 | snd_soc_set_ac97_ops(NULL); | 409 | snd_soc_set_ac97_ops(NULL); |
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index a57643d6402f..167728a73da2 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <mach/ep93xx-regs.h> | 30 | #include <mach/ep93xx-regs.h> |
31 | #include <linux/platform_data/dma-ep93xx.h> | 31 | #include <linux/platform_data/dma-ep93xx.h> |
32 | 32 | ||
33 | #include "ep93xx-pcm.h" | ||
34 | |||
33 | #define EP93XX_I2S_TXCLKCFG 0x00 | 35 | #define EP93XX_I2S_TXCLKCFG 0x00 |
34 | #define EP93XX_I2S_RXCLKCFG 0x04 | 36 | #define EP93XX_I2S_RXCLKCFG 0x04 |
35 | #define EP93XX_I2S_GLCTRL 0x0C | 37 | #define EP93XX_I2S_GLCTRL 0x0C |
@@ -405,8 +407,14 @@ static int ep93xx_i2s_probe(struct platform_device *pdev) | |||
405 | if (err) | 407 | if (err) |
406 | goto fail_put_lrclk; | 408 | goto fail_put_lrclk; |
407 | 409 | ||
410 | err = devm_ep93xx_pcm_platform_register(&pdev->dev); | ||
411 | if (err) | ||
412 | goto fail_unregister; | ||
413 | |||
408 | return 0; | 414 | return 0; |
409 | 415 | ||
416 | fail_unregister: | ||
417 | snd_soc_unregister_component(&pdev->dev); | ||
410 | fail_put_lrclk: | 418 | fail_put_lrclk: |
411 | clk_put(info->lrclk); | 419 | clk_put(info->lrclk); |
412 | fail_put_sclk: | 420 | fail_put_sclk: |
diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c index fdb8b8feb4ed..198c5405f2ce 100644 --- a/sound/soc/cirrus/ep93xx-pcm.c +++ b/sound/soc/cirrus/ep93xx-pcm.c | |||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #include <linux/platform_data/dma-ep93xx.h> | 24 | #include <linux/platform_data/dma-ep93xx.h> |
25 | 25 | ||
26 | #include "ep93xx-pcm.h" | ||
27 | |||
26 | static const struct snd_pcm_hardware ep93xx_pcm_hardware = { | 28 | static const struct snd_pcm_hardware ep93xx_pcm_hardware = { |
27 | .info = (SNDRV_PCM_INFO_MMAP | | 29 | .info = (SNDRV_PCM_INFO_MMAP | |
28 | SNDRV_PCM_INFO_MMAP_VALID | | 30 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -76,27 +78,16 @@ static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = { | |||
76 | .prealloc_buffer_size = 131072, | 78 | .prealloc_buffer_size = 131072, |
77 | }; | 79 | }; |
78 | 80 | ||
79 | static int ep93xx_soc_platform_probe(struct platform_device *pdev) | 81 | int devm_ep93xx_pcm_platform_register(struct device *dev) |
80 | { | 82 | { |
81 | return devm_snd_dmaengine_pcm_register(&pdev->dev, | 83 | return devm_snd_dmaengine_pcm_register(dev, |
82 | &ep93xx_dmaengine_pcm_config, | 84 | &ep93xx_dmaengine_pcm_config, |
83 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | | 85 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | |
84 | SND_DMAENGINE_PCM_FLAG_NO_DT | | 86 | SND_DMAENGINE_PCM_FLAG_NO_DT | |
85 | SND_DMAENGINE_PCM_FLAG_COMPAT); | 87 | SND_DMAENGINE_PCM_FLAG_COMPAT); |
86 | } | 88 | } |
87 | 89 | EXPORT_SYMBOL_GPL(devm_ep93xx_pcm_platform_register); | |
88 | static struct platform_driver ep93xx_pcm_driver = { | ||
89 | .driver = { | ||
90 | .name = "ep93xx-pcm-audio", | ||
91 | .owner = THIS_MODULE, | ||
92 | }, | ||
93 | |||
94 | .probe = ep93xx_soc_platform_probe, | ||
95 | }; | ||
96 | |||
97 | module_platform_driver(ep93xx_pcm_driver); | ||
98 | 90 | ||
99 | MODULE_AUTHOR("Ryan Mallon"); | 91 | MODULE_AUTHOR("Ryan Mallon"); |
100 | MODULE_DESCRIPTION("EP93xx ALSA PCM interface"); | 92 | MODULE_DESCRIPTION("EP93xx ALSA PCM interface"); |
101 | MODULE_LICENSE("GPL"); | 93 | MODULE_LICENSE("GPL"); |
102 | MODULE_ALIAS("platform:ep93xx-pcm-audio"); | ||
diff --git a/sound/soc/cirrus/ep93xx-pcm.h b/sound/soc/cirrus/ep93xx-pcm.h new file mode 100644 index 000000000000..b7a12a2fae9c --- /dev/null +++ b/sound/soc/cirrus/ep93xx-pcm.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __EP93XX_PCM_H__ | ||
18 | #define __EP93XX_PCM_H__ | ||
19 | |||
20 | int devm_ep93xx_pcm_platform_register(struct device *dev); | ||
21 | |||
22 | #endif | ||
diff --git a/sound/soc/cirrus/simone.c b/sound/soc/cirrus/simone.c index 4d094d00c34a..822a19a89e74 100644 --- a/sound/soc/cirrus/simone.c +++ b/sound/soc/cirrus/simone.c | |||
@@ -27,7 +27,7 @@ static struct snd_soc_dai_link simone_dai = { | |||
27 | .cpu_dai_name = "ep93xx-ac97", | 27 | .cpu_dai_name = "ep93xx-ac97", |
28 | .codec_dai_name = "ac97-hifi", | 28 | .codec_dai_name = "ac97-hifi", |
29 | .codec_name = "ac97-codec", | 29 | .codec_name = "ac97-codec", |
30 | .platform_name = "ep93xx-pcm-audio", | 30 | .platform_name = "ep93xx-ac97", |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static struct snd_soc_card snd_soc_simone = { | 33 | static struct snd_soc_card snd_soc_simone = { |
diff --git a/sound/soc/cirrus/snappercl15.c b/sound/soc/cirrus/snappercl15.c index 69041074f2c1..29238a7476dd 100644 --- a/sound/soc/cirrus/snappercl15.c +++ b/sound/soc/cirrus/snappercl15.c | |||
@@ -83,7 +83,7 @@ static struct snd_soc_dai_link snappercl15_dai = { | |||
83 | .cpu_dai_name = "ep93xx-i2s", | 83 | .cpu_dai_name = "ep93xx-i2s", |
84 | .codec_dai_name = "tlv320aic23-hifi", | 84 | .codec_dai_name = "tlv320aic23-hifi", |
85 | .codec_name = "tlv320aic23-codec.0-001a", | 85 | .codec_name = "tlv320aic23-codec.0-001a", |
86 | .platform_name = "ep93xx-pcm-audio", | 86 | .platform_name = "ep93xx-i2s", |
87 | .init = snappercl15_tlv320aic23_init, | 87 | .init = snappercl15_tlv320aic23_init, |
88 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | | 88 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | |
89 | SND_SOC_DAIFMT_CBS_CFS, | 89 | SND_SOC_DAIFMT_CBS_CFS, |