From 5d33b1f39705c183a7b76785c30c54dd8ca898ca Mon Sep 17 00:00:00 2001 From: Laurence Darby Date: Sat, 3 Nov 2012 17:00:06 +0000 Subject: [PATCH] --- yaml --- r: 342575 b: refs/heads/master c: 3bef1c377d1bd8fd879ee5a66cf6f45ba16820cd h: refs/heads/master i: 342573: e6f12db1e2d8e9212bd4a971b93efba316259e2b 342571: 29fb74fa209645eeea109f8226cec8035cd880b7 342567: 978b4d68b9ae9c5e9ae74f25fd4cd791ec685180 342559: a14ec5f74aa7e1963eb3a69b7a2b970b6c7fae05 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 979e3b6061e5..72e1d25e37ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5d00dc3a4b65ed38249f3225e453944c633747b +refs/heads/master: 3bef1c377d1bd8fd879ee5a66cf6f45ba16820cd diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 2da787519513..569bc05aad6c 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -4816,10 +4816,20 @@ EXPORT_SYMBOL_HDA(snd_hda_input_mux_put); static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid, unsigned int stream_tag, unsigned int format) { - struct hda_spdif_out *spdif = snd_hda_spdif_out_of_nid(codec, nid); - - /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ - if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) + struct hda_spdif_out *spdif; + unsigned int curr_fmt; + bool reset; + + spdif = snd_hda_spdif_out_of_nid(codec, nid); + curr_fmt = snd_hda_codec_read(codec, nid, 0, + AC_VERB_GET_STREAM_FORMAT, 0); + reset = codec->spdif_status_reset && + (spdif->ctls & AC_DIG1_ENABLE) && + curr_fmt != format; + + /* turn off SPDIF if needed; otherwise the IEC958 bits won't be + updated */ + if (reset) set_dig_out_convert(codec, nid, spdif->ctls & ~AC_DIG1_ENABLE & 0xff, -1); @@ -4831,7 +4841,7 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid, format); } /* turn on again (if needed) */ - if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) + if (reset) set_dig_out_convert(codec, nid, spdif->ctls & 0xff, -1); }