aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/stac9766.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/stac9766.c')
-rw-r--r--sound/soc/codecs/stac9766.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index befc6488c39a..3293629dcb3b 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/slab.h>
18#include <linux/module.h> 19#include <linux/module.h>
19#include <linux/device.h> 20#include <linux/device.h>
20#include <sound/core.h> 21#include <sound/core.h>
@@ -191,6 +192,7 @@ static int ac97_analog_prepare(struct snd_pcm_substream *substream,
191 vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS); 192 vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
192 193
193 vra |= 0x1; /* enable variable rate audio */ 194 vra |= 0x1; /* enable variable rate audio */
195 vra &= ~0x4; /* disable SPDIF output */
194 196
195 stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra); 197 stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
196 198
@@ -221,22 +223,6 @@ static int ac97_digital_prepare(struct snd_pcm_substream *substream,
221 return stac9766_ac97_write(codec, reg, runtime->rate); 223 return stac9766_ac97_write(codec, reg, runtime->rate);
222} 224}
223 225
224static int ac97_digital_trigger(struct snd_pcm_substream *substream,
225 int cmd, struct snd_soc_dai *dai)
226{
227 struct snd_soc_codec *codec = dai->codec;
228 unsigned short vra;
229
230 switch (cmd) {
231 case SNDRV_PCM_TRIGGER_STOP:
232 vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
233 vra &= !0x04;
234 stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
235 break;
236 }
237 return 0;
238}
239
240static int stac9766_set_bias_level(struct snd_soc_codec *codec, 226static int stac9766_set_bias_level(struct snd_soc_codec *codec,
241 enum snd_soc_bias_level level) 227 enum snd_soc_bias_level level)
242{ 228{
@@ -315,7 +301,6 @@ static struct snd_soc_dai_ops stac9766_dai_ops_analog = {
315 301
316static struct snd_soc_dai_ops stac9766_dai_ops_digital = { 302static struct snd_soc_dai_ops stac9766_dai_ops_digital = {
317 .prepare = ac97_digital_prepare, 303 .prepare = ac97_digital_prepare,
318 .trigger = ac97_digital_trigger,
319}; 304};
320 305
321struct snd_soc_dai stac9766_dai[] = { 306struct snd_soc_dai stac9766_dai[] = {
@@ -418,9 +403,6 @@ static int stac9766_codec_probe(struct platform_device *pdev)
418 snd_soc_add_controls(codec, stac9766_snd_ac97_controls, 403 snd_soc_add_controls(codec, stac9766_snd_ac97_controls,
419 ARRAY_SIZE(stac9766_snd_ac97_controls)); 404 ARRAY_SIZE(stac9766_snd_ac97_controls));
420 405
421 ret = snd_soc_init_card(socdev);
422 if (ret < 0)
423 goto reset_err;
424 return 0; 406 return 0;
425 407
426reset_err: 408reset_err: