aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-16 05:23:56 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:55:59 -0400
commit5930ca41857f57e130b4438a9a261b2ab91f6fcf (patch)
treedd2123aee7ab46a0a729cb80bbc00c3caaee2e47 /sound/pci
parentf12ab1e07dadecc3ac4774a7354c61baa83ff11f (diff)
[ALSA] hda-codec - Allow opening SPDIF while analog dup mode
Allow opening the dedicated SPDIF stream while running on analog dup mode. Then the SPDIF stream is once reset and assigned for the new stream. It's useful for exclusive SPDIF output like AC3/DTS. (In the former version, you had to close once the analog stream to play the exclusive digital stream.) Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_codec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 59dcd97bf833..1fa93bd25a7b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1916,10 +1916,9 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
1916int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout) 1916int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout)
1917{ 1917{
1918 mutex_lock(&codec->spdif_mutex); 1918 mutex_lock(&codec->spdif_mutex);
1919 if (mout->dig_out_used) { 1919 if (mout->dig_out_used == HDA_DIG_ANALOG_DUP)
1920 mutex_unlock(&codec->spdif_mutex); 1920 /* already opened as analog dup; reset it once */
1921 return -EBUSY; /* already being used */ 1921 snd_hda_codec_setup_stream(codec, mout->dig_out_nid, 0, 0, 0);
1922 }
1923 mout->dig_out_used = HDA_DIG_EXCLUSIVE; 1922 mout->dig_out_used = HDA_DIG_EXCLUSIVE;
1924 mutex_unlock(&codec->spdif_mutex); 1923 mutex_unlock(&codec->spdif_mutex);
1925 return 0; 1924 return 0;