diff options
-rw-r--r-- | sound/pci/hda/hda_codec.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 77fbcd4a69b..529bd5f6521 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2590,12 +2590,12 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid, | |||
2590 | unsigned int stream_tag, unsigned int format) | 2590 | unsigned int stream_tag, unsigned int format) |
2591 | { | 2591 | { |
2592 | /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ | 2592 | /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ |
2593 | if (codec->spdif_ctls & AC_DIG1_ENABLE) | 2593 | if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) |
2594 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, | 2594 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, |
2595 | codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff); | 2595 | codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff); |
2596 | snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); | 2596 | snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); |
2597 | /* turn on again (if needed) */ | 2597 | /* turn on again (if needed) */ |
2598 | if (codec->spdif_ctls & AC_DIG1_ENABLE) | 2598 | if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) |
2599 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, | 2599 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, |
2600 | codec->spdif_ctls & 0xff); | 2600 | codec->spdif_ctls & 0xff); |
2601 | } | 2601 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 2f112626f24..aeee5816153 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -654,6 +654,11 @@ struct hda_codec { | |||
654 | 654 | ||
655 | struct snd_hwdep *hwdep; /* assigned hwdep device */ | 655 | struct snd_hwdep *hwdep; /* assigned hwdep device */ |
656 | 656 | ||
657 | /* misc flags */ | ||
658 | unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each | ||
659 | * status change | ||
660 | * (e.g. Realtek codecs) | ||
661 | */ | ||
657 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 662 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
658 | unsigned int power_on :1; /* current (global) power-state */ | 663 | unsigned int power_on :1; /* current (global) power-state */ |
659 | unsigned int power_transition :1; /* power-state in transition */ | 664 | unsigned int power_transition :1; /* power-state in transition */ |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7e5422f64ca..8bff732958e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2670,6 +2670,8 @@ static int alc_build_pcms(struct hda_codec *codec) | |||
2670 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_digital_capture); | 2670 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_digital_capture); |
2671 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid; | 2671 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid; |
2672 | } | 2672 | } |
2673 | /* FIXME: do we need this for all Realtek codec models? */ | ||
2674 | codec->spdif_status_reset = 1; | ||
2673 | } | 2675 | } |
2674 | 2676 | ||
2675 | /* If the use of more than one ADC is requested for the current | 2677 | /* If the use of more than one ADC is requested for the current |