diff options
Diffstat (limited to 'sound/soc/pxa/z2.c')
-rw-r--r-- | sound/soc/pxa/z2.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index 4e4d2fa8ddc5..4cc841b44182 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <mach/z2.h> | 30 | #include <mach/z2.h> |
31 | 31 | ||
32 | #include "../codecs/wm8750.h" | 32 | #include "../codecs/wm8750.h" |
33 | #include "pxa2xx-pcm.h" | ||
34 | #include "pxa2xx-i2s.h" | 33 | #include "pxa2xx-i2s.h" |
35 | 34 | ||
36 | static struct snd_soc_card snd_soc_z2; | 35 | static struct snd_soc_card snd_soc_z2; |
@@ -39,8 +38,8 @@ static int z2_hw_params(struct snd_pcm_substream *substream, | |||
39 | struct snd_pcm_hw_params *params) | 38 | struct snd_pcm_hw_params *params) |
40 | { | 39 | { |
41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 40 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
42 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 41 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
43 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 42 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
44 | unsigned int clk = 0; | 43 | unsigned int clk = 0; |
45 | int ret = 0; | 44 | int ret = 0; |
46 | 45 | ||
@@ -138,8 +137,9 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
138 | /* | 137 | /* |
139 | * Logic for a wm8750 as connected on a Z2 Device | 138 | * Logic for a wm8750 as connected on a Z2 Device |
140 | */ | 139 | */ |
141 | static int z2_wm8750_init(struct snd_soc_codec *codec) | 140 | static int z2_wm8750_init(struct snd_soc_pcm_runtime *rtd) |
142 | { | 141 | { |
142 | struct snd_soc_codec *codec = rtd->codec; | ||
143 | int ret; | 143 | int ret; |
144 | 144 | ||
145 | /* NC codec pins */ | 145 | /* NC codec pins */ |
@@ -160,7 +160,7 @@ static int z2_wm8750_init(struct snd_soc_codec *codec) | |||
160 | goto err; | 160 | goto err; |
161 | 161 | ||
162 | /* Jack detection API stuff */ | 162 | /* Jack detection API stuff */ |
163 | ret = snd_soc_jack_new(&snd_soc_z2, "Headset Jack", SND_JACK_HEADSET, | 163 | ret = snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET, |
164 | &hs_jack); | 164 | &hs_jack); |
165 | if (ret) | 165 | if (ret) |
166 | goto err; | 166 | goto err; |
@@ -189,8 +189,10 @@ static struct snd_soc_ops z2_ops = { | |||
189 | static struct snd_soc_dai_link z2_dai = { | 189 | static struct snd_soc_dai_link z2_dai = { |
190 | .name = "wm8750", | 190 | .name = "wm8750", |
191 | .stream_name = "WM8750", | 191 | .stream_name = "WM8750", |
192 | .cpu_dai = &pxa_i2s_dai, | 192 | .cpu_dai_name = "pxa2xx-i2s", |
193 | .codec_dai = &wm8750_dai, | 193 | .codec_dai_name = "wm8750-hifi", |
194 | .platform_name = "pxa-pcm-audio", | ||
195 | .codec_name = "wm8750-codec.0-001a", | ||
194 | .init = z2_wm8750_init, | 196 | .init = z2_wm8750_init, |
195 | .ops = &z2_ops, | 197 | .ops = &z2_ops, |
196 | }; | 198 | }; |
@@ -198,17 +200,10 @@ static struct snd_soc_dai_link z2_dai = { | |||
198 | /* z2 audio machine driver */ | 200 | /* z2 audio machine driver */ |
199 | static struct snd_soc_card snd_soc_z2 = { | 201 | static struct snd_soc_card snd_soc_z2 = { |
200 | .name = "Z2", | 202 | .name = "Z2", |
201 | .platform = &pxa2xx_soc_platform, | ||
202 | .dai_link = &z2_dai, | 203 | .dai_link = &z2_dai, |
203 | .num_links = 1, | 204 | .num_links = 1, |
204 | }; | 205 | }; |
205 | 206 | ||
206 | /* z2 audio subsystem */ | ||
207 | static struct snd_soc_device z2_snd_devdata = { | ||
208 | .card = &snd_soc_z2, | ||
209 | .codec_dev = &soc_codec_dev_wm8750, | ||
210 | }; | ||
211 | |||
212 | static struct platform_device *z2_snd_device; | 207 | static struct platform_device *z2_snd_device; |
213 | 208 | ||
214 | static int __init z2_init(void) | 209 | static int __init z2_init(void) |
@@ -222,8 +217,7 @@ static int __init z2_init(void) | |||
222 | if (!z2_snd_device) | 217 | if (!z2_snd_device) |
223 | return -ENOMEM; | 218 | return -ENOMEM; |
224 | 219 | ||
225 | platform_set_drvdata(z2_snd_device, &z2_snd_devdata); | 220 | platform_set_drvdata(z2_snd_device, &snd_soc_z2); |
226 | z2_snd_devdata.dev = &z2_snd_device->dev; | ||
227 | ret = platform_device_add(z2_snd_device); | 221 | ret = platform_device_add(z2_snd_device); |
228 | 222 | ||
229 | if (ret) | 223 | if (ret) |