diff options
author | Barry Song <barry.song@analog.com> | 2011-03-28 01:45:10 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-29 18:20:05 -0400 |
commit | 2c66cb99d134d787827ed1cd93cc59351ab66a95 (patch) | |
tree | 4c67200205b224947e9500b17af9537e54254a65 /sound/soc/blackfin/bf5xx-ad1836.c | |
parent | bfe4ee0a935dccf5980ecb5605c66fe50feb9056 (diff) |
ASoC: Blackfin: push down SPORT settings from global variables
Now that we have multi-component support, take the time to unify the
SPORT implementations a bit and make the setup dynamic. This kills
off the global sport_handle which was shared across all the Blackfin
machine drivers. The pin management aspect is off loaded to platform
resources, and now multiple SPORTs can be instantiated simultaneously.
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Scott Jiang <scott.jiang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ad1836.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad1836.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad1836.c b/sound/soc/blackfin/bf5xx-ad1836.c index 5d9d9e2805b8..ea4951cf5526 100644 --- a/sound/soc/blackfin/bf5xx-ad1836.c +++ b/sound/soc/blackfin/bf5xx-ad1836.c | |||
@@ -29,22 +29,12 @@ | |||
29 | #include <asm/portmux.h> | 29 | #include <asm/portmux.h> |
30 | 30 | ||
31 | #include "../codecs/ad1836.h" | 31 | #include "../codecs/ad1836.h" |
32 | #include "bf5xx-sport.h" | ||
33 | 32 | ||
34 | #include "bf5xx-tdm-pcm.h" | 33 | #include "bf5xx-tdm-pcm.h" |
35 | #include "bf5xx-tdm.h" | 34 | #include "bf5xx-tdm.h" |
36 | 35 | ||
37 | static struct snd_soc_card bf5xx_ad1836; | 36 | static struct snd_soc_card bf5xx_ad1836; |
38 | 37 | ||
39 | static int bf5xx_ad1836_startup(struct snd_pcm_substream *substream) | ||
40 | { | ||
41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
42 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
43 | |||
44 | snd_soc_dai_set_drvdata(cpu_dai, sport_handle); | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream, | 38 | static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream, |
49 | struct snd_pcm_hw_params *params) | 39 | struct snd_pcm_hw_params *params) |
50 | { | 40 | { |
@@ -75,23 +65,33 @@ static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream, | |||
75 | } | 65 | } |
76 | 66 | ||
77 | static struct snd_soc_ops bf5xx_ad1836_ops = { | 67 | static struct snd_soc_ops bf5xx_ad1836_ops = { |
78 | .startup = bf5xx_ad1836_startup, | ||
79 | .hw_params = bf5xx_ad1836_hw_params, | 68 | .hw_params = bf5xx_ad1836_hw_params, |
80 | }; | 69 | }; |
81 | 70 | ||
82 | static struct snd_soc_dai_link bf5xx_ad1836_dai = { | 71 | static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { |
83 | .name = "ad1836", | 72 | { |
84 | .stream_name = "AD1836", | 73 | .name = "ad1836", |
85 | .cpu_dai_name = "bfin-tdm", | 74 | .stream_name = "AD1836", |
86 | .codec_dai_name = "ad1836-hifi", | 75 | .cpu_dai_name = "bfin-tdm.0", |
87 | .platform_name = "bfin-tdm-pcm-audio", | 76 | .codec_dai_name = "ad1836-hifi", |
88 | .codec_name = "ad1836.0", | 77 | .platform_name = "bfin-tdm-pcm-audio", |
89 | .ops = &bf5xx_ad1836_ops, | 78 | .codec_name = "ad1836.0", |
79 | .ops = &bf5xx_ad1836_ops, | ||
80 | }, | ||
81 | { | ||
82 | .name = "ad1836", | ||
83 | .stream_name = "AD1836", | ||
84 | .cpu_dai_name = "bfin-tdm.1", | ||
85 | .codec_dai_name = "ad1836-hifi", | ||
86 | .platform_name = "bfin-tdm-pcm-audio", | ||
87 | .codec_name = "ad1836.0", | ||
88 | .ops = &bf5xx_ad1836_ops, | ||
89 | }, | ||
90 | }; | 90 | }; |
91 | 91 | ||
92 | static struct snd_soc_card bf5xx_ad1836 = { | 92 | static struct snd_soc_card bf5xx_ad1836 = { |
93 | .name = "bfin-ad1836", | 93 | .name = "bfin-ad1836", |
94 | .dai_link = &bf5xx_ad1836_dai, | 94 | .dai_link = &bf5xx_ad1836_dai[CONFIG_SND_BF5XX_SPORT_NUM], |
95 | .num_links = 1, | 95 | .num_links = 1, |
96 | }; | 96 | }; |
97 | 97 | ||