summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-05 14:51:48 +0200
committerJaroslav Kysela <perex@suse.cz>2007-05-11 16:55:56 +0200
commit6b97eb45f2edca51250b6c1e3142801f069245fe (patch)
treebe20e5e69f05499091ee9d83005b2712babb5431 /sound/pci/hda/patch_realtek.c
parentf9ab2b1c3ab5345f9003bf7ebc1eaa0f9b8cf99e (diff)
downloadlwn-6b97eb45f2edca51250b6c1e3142801f069245fe.tar.gz
lwn-6b97eb45f2edca51250b6c1e3142801f069245fe.zip
[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_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4243c6b491fc..d3f7a3dab1c4 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1916,6 +1916,17 @@ static int alc880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
return snd_hda_multi_out_dig_open(codec, &spec->multiout);
}
+static int alc880_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ unsigned int stream_tag,
+ unsigned int format,
+ struct snd_pcm_substream *substream)
+{
+ struct alc_spec *spec = codec->spec;
+ return snd_hda_multi_out_dig_prepare(codec, &spec->multiout,
+ stream_tag, format, substream);
+}
+
static int alc880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
@@ -1984,7 +1995,8 @@ static struct hda_pcm_stream alc880_pcm_digital_playback = {
/* NID is set in alc_build_pcms */
.ops = {
.open = alc880_dig_playback_pcm_open,
- .close = alc880_dig_playback_pcm_close
+ .close = alc880_dig_playback_pcm_close,
+ .prepare = alc880_dig_playback_pcm_prepare
},
};