aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/mioa701_wm9713.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/mioa701_wm9713.c')
-rw-r--r--sound/soc/pxa/mioa701_wm9713.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c
index 19eda8bbfdaf..f284cc54bc80 100644
--- a/sound/soc/pxa/mioa701_wm9713.c
+++ b/sound/soc/pxa/mioa701_wm9713.c
@@ -54,7 +54,6 @@
54#include <sound/initval.h> 54#include <sound/initval.h>
55#include <sound/ac97_codec.h> 55#include <sound/ac97_codec.h>
56 56
57#include "pxa2xx-pcm.h"
58#include "pxa2xx-ac97.h" 57#include "pxa2xx-ac97.h"
59#include "../codecs/wm9713.h" 58#include "../codecs/wm9713.h"
60 59
@@ -128,8 +127,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
128 {"Rear Speaker", NULL, "SPKR"}, 127 {"Rear Speaker", NULL, "SPKR"},
129}; 128};
130 129
131static int mioa701_wm9713_init(struct snd_soc_codec *codec) 130static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd)
132{ 131{
132 struct snd_soc_codec *codec = rtd->codec;
133 unsigned short reg; 133 unsigned short reg;
134 134
135 /* Add mioa701 specific widgets */ 135 /* Add mioa701 specific widgets */
@@ -139,12 +139,12 @@ static int mioa701_wm9713_init(struct snd_soc_codec *codec)
139 snd_soc_dapm_add_routes(codec, ARRAY_AND_SIZE(audio_map)); 139 snd_soc_dapm_add_routes(codec, ARRAY_AND_SIZE(audio_map));
140 140
141 /* Prepare GPIO8 for rear speaker amplifier */ 141 /* Prepare GPIO8 for rear speaker amplifier */
142 reg = codec->read(codec, AC97_GPIO_CFG); 142 reg = codec->driver->read(codec, AC97_GPIO_CFG);
143 codec->write(codec, AC97_GPIO_CFG, reg | 0x0100); 143 codec->driver->write(codec, AC97_GPIO_CFG, reg | 0x0100);
144 144
145 /* Prepare MIC input */ 145 /* Prepare MIC input */
146 reg = codec->read(codec, AC97_3D_CONTROL); 146 reg = codec->driver->read(codec, AC97_3D_CONTROL);
147 codec->write(codec, AC97_3D_CONTROL, reg | 0xc000); 147 codec->driver->write(codec, AC97_3D_CONTROL, reg | 0xc000);
148 148
149 snd_soc_dapm_enable_pin(codec, "Front Speaker"); 149 snd_soc_dapm_enable_pin(codec, "Front Speaker");
150 snd_soc_dapm_enable_pin(codec, "Rear Speaker"); 150 snd_soc_dapm_enable_pin(codec, "Rear Speaker");
@@ -162,32 +162,30 @@ static struct snd_soc_dai_link mioa701_dai[] = {
162 { 162 {
163 .name = "AC97", 163 .name = "AC97",
164 .stream_name = "AC97 HiFi", 164 .stream_name = "AC97 HiFi",
165 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI], 165 .cpu_dai_name = "pxa-ac97.0",
166 .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI], 166 .codec_dai_name = "wm9713-hifi",
167 .codec_name = "wm9713-codec",
167 .init = mioa701_wm9713_init, 168 .init = mioa701_wm9713_init,
169 .platform_name = "pxa-pcm-audio",
168 .ops = &mioa701_ops, 170 .ops = &mioa701_ops,
169 }, 171 },
170 { 172 {
171 .name = "AC97 Aux", 173 .name = "AC97 Aux",
172 .stream_name = "AC97 Aux", 174 .stream_name = "AC97 Aux",
173 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX], 175 .cpu_dai_name = "pxa-ac97.1",
174 .codec_dai = &wm9713_dai[WM9713_DAI_AC97_AUX], 176 .codec_dai_name ="wm9713-aux",
177 .codec_name = "wm9713-codec",
178 .platform_name = "pxa-pcm-audio",
175 .ops = &mioa701_ops, 179 .ops = &mioa701_ops,
176 }, 180 },
177}; 181};
178 182
179static struct snd_soc_card mioa701 = { 183static struct snd_soc_card mioa701 = {
180 .name = "MioA701", 184 .name = "MioA701",
181 .platform = &pxa2xx_soc_platform,
182 .dai_link = mioa701_dai, 185 .dai_link = mioa701_dai,
183 .num_links = ARRAY_SIZE(mioa701_dai), 186 .num_links = ARRAY_SIZE(mioa701_dai),
184}; 187};
185 188
186static struct snd_soc_device mioa701_snd_devdata = {
187 .card = &mioa701,
188 .codec_dev = &soc_codec_dev_wm9713,
189};
190
191static struct platform_device *mioa701_snd_device; 189static struct platform_device *mioa701_snd_device;
192 190
193static int mioa701_wm9713_probe(struct platform_device *pdev) 191static int mioa701_wm9713_probe(struct platform_device *pdev)
@@ -205,8 +203,7 @@ static int mioa701_wm9713_probe(struct platform_device *pdev)
205 if (!mioa701_snd_device) 203 if (!mioa701_snd_device)
206 return -ENOMEM; 204 return -ENOMEM;
207 205
208 platform_set_drvdata(mioa701_snd_device, &mioa701_snd_devdata); 206 platform_set_drvdata(mioa701_snd_device, &mioa701);
209 mioa701_snd_devdata.dev = &mioa701_snd_device->dev;
210 207
211 ret = platform_device_add(mioa701_snd_device); 208 ret = platform_device_add(mioa701_snd_device);
212 if (!ret) 209 if (!ret)