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-ad193x.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-ad193x.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad193x.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad193x.c b/sound/soc/blackfin/bf5xx-ad193x.c index 355094fad18a..d6651c033cb7 100644 --- a/sound/soc/blackfin/bf5xx-ad193x.c +++ b/sound/soc/blackfin/bf5xx-ad193x.c | |||
@@ -38,22 +38,12 @@ | |||
38 | #include <asm/portmux.h> | 38 | #include <asm/portmux.h> |
39 | 39 | ||
40 | #include "../codecs/ad193x.h" | 40 | #include "../codecs/ad193x.h" |
41 | #include "bf5xx-sport.h" | ||
42 | 41 | ||
43 | #include "bf5xx-tdm-pcm.h" | 42 | #include "bf5xx-tdm-pcm.h" |
44 | #include "bf5xx-tdm.h" | 43 | #include "bf5xx-tdm.h" |
45 | 44 | ||
46 | static struct snd_soc_card bf5xx_ad193x; | 45 | static struct snd_soc_card bf5xx_ad193x; |
47 | 46 | ||
48 | static int bf5xx_ad193x_startup(struct snd_pcm_substream *substream) | ||
49 | { | ||
50 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
51 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
52 | |||
53 | snd_soc_dai_set_drvdata(cpu_dai, sport_handle); | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, | 47 | static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, |
58 | struct snd_pcm_hw_params *params) | 48 | struct snd_pcm_hw_params *params) |
59 | { | 49 | { |
@@ -103,23 +93,33 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, | |||
103 | } | 93 | } |
104 | 94 | ||
105 | static struct snd_soc_ops bf5xx_ad193x_ops = { | 95 | static struct snd_soc_ops bf5xx_ad193x_ops = { |
106 | .startup = bf5xx_ad193x_startup, | ||
107 | .hw_params = bf5xx_ad193x_hw_params, | 96 | .hw_params = bf5xx_ad193x_hw_params, |
108 | }; | 97 | }; |
109 | 98 | ||
110 | static struct snd_soc_dai_link bf5xx_ad193x_dai = { | 99 | static struct snd_soc_dai_link bf5xx_ad193x_dai[] = { |
111 | .name = "ad193x", | 100 | { |
112 | .stream_name = "AD193X", | 101 | .name = "ad193x", |
113 | .cpu_dai_name = "bfin-tdm", | 102 | .stream_name = "AD193X", |
114 | .codec_dai_name ="ad193x-hifi", | 103 | .cpu_dai_name = "bfin-tdm.0", |
115 | .platform_name = "bfin-tdm-pcm-audio", | 104 | .codec_dai_name ="ad193x-hifi", |
116 | .codec_name = "ad193x.5", | 105 | .platform_name = "bfin-tdm-pcm-audio", |
117 | .ops = &bf5xx_ad193x_ops, | 106 | .codec_name = "ad193x.5", |
107 | .ops = &bf5xx_ad193x_ops, | ||
108 | }, | ||
109 | { | ||
110 | .name = "ad193x", | ||
111 | .stream_name = "AD193X", | ||
112 | .cpu_dai_name = "bfin-tdm.1", | ||
113 | .codec_dai_name ="ad193x-hifi", | ||
114 | .platform_name = "bfin-tdm-pcm-audio", | ||
115 | .codec_name = "ad193x.5", | ||
116 | .ops = &bf5xx_ad193x_ops, | ||
117 | }, | ||
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct snd_soc_card bf5xx_ad193x = { | 120 | static struct snd_soc_card bf5xx_ad193x = { |
121 | .name = "bfin-ad193x", | 121 | .name = "bfin-ad193x", |
122 | .dai_link = &bf5xx_ad193x_dai, | 122 | .dai_link = &bf5xx_ad193x_dai[CONFIG_SND_BF5XX_SPORT_NUM], |
123 | .num_links = 1, | 123 | .num_links = 1, |
124 | }; | 124 | }; |
125 | 125 | ||