aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cmedia.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-05 08:51:48 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:55:56 -0400
commit6b97eb45f2edca51250b6c1e3142801f069245fe (patch)
treebe20e5e69f05499091ee9d83005b2712babb5431 /sound/pci/hda/patch_cmedia.c
parentf9ab2b1c3ab5345f9003bf7ebc1eaa0f9b8cf99e (diff)
[ALSA] hda-codec - Fix SPDIF output
Fix SPDIF output (at least on Realtek codecs). The DIGI_CONVERT verbs have to be reset before the PCM stream is set up. Otherwise the digital setup is screwed up. Also, check the AMP capability before setting AMP of the digital out widget. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_cmedia.c')
-rw-r--r--sound/pci/hda/patch_cmedia.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index 5b9d3a31a1ae..3c722e667bc8 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -497,6 +497,17 @@ static int cmi9880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
497 return snd_hda_multi_out_dig_close(codec, &spec->multiout); 497 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
498} 498}
499 499
500static int cmi9880_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
501 struct hda_codec *codec,
502 unsigned int stream_tag,
503 unsigned int format,
504 struct snd_pcm_substream *substream)
505{
506 struct cmi_spec *spec = codec->spec;
507 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
508 format, substream);
509}
510
500/* 511/*
501 * Analog capture 512 * Analog capture
502 */ 513 */
@@ -556,7 +567,8 @@ static struct hda_pcm_stream cmi9880_pcm_digital_playback = {
556 /* NID is set in cmi9880_build_pcms */ 567 /* NID is set in cmi9880_build_pcms */
557 .ops = { 568 .ops = {
558 .open = cmi9880_dig_playback_pcm_open, 569 .open = cmi9880_dig_playback_pcm_open,
559 .close = cmi9880_dig_playback_pcm_close 570 .close = cmi9880_dig_playback_pcm_close,
571 .prepare = cmi9880_dig_playback_pcm_prepare
560 }, 572 },
561}; 573};
562 574