summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-03 23:50:45 +0200
committerTakashi Iwai <tiwai@suse.de>2009-07-03 23:50:45 +0200
commit854ace9c40d2b121191e1644aa4b0b68c4a226d3 (patch)
treefdc43a62eacc95a1276003a4d7d46287312407ab /sound/pci/hda/hda_codec.c
parentdbe45d0ce394732cc06187e929697fc0fb16aa53 (diff)
parentc470331e69bd54d11a9ea3c27a0e4ad783d02d6b (diff)
downloadlinux-3.10-854ace9c40d2b121191e1644aa4b0b68c4a226d3.tar.gz
linux-3.10-854ace9c40d2b121191e1644aa4b0b68c4a226d3.tar.bz2
linux-3.10-854ace9c40d2b121191e1644aa4b0b68c4a226d3.zip
Merge branch 'fix/hda' into for-linus
* fix/hda: ALSA: hda - Add sanity check in PCM open callback ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback ALSA: hda - Avoid invalid formats and rates with shared SPDIF ALSA: hda - Improve ASUS eeePC 1000 mixer ALSA: hda - Add GPIO1 control at muting with HP laptops
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 462e2cedaa6..26d255de6be 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3470,10 +3470,16 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
}
mutex_lock(&codec->spdif_mutex);
if (mout->share_spdif) {
- runtime->hw.rates &= mout->spdif_rates;
- runtime->hw.formats &= mout->spdif_formats;
- if (mout->spdif_maxbps < hinfo->maxbps)
- hinfo->maxbps = mout->spdif_maxbps;
+ if ((runtime->hw.rates & mout->spdif_rates) &&
+ (runtime->hw.formats & mout->spdif_formats)) {
+ runtime->hw.rates &= mout->spdif_rates;
+ runtime->hw.formats &= mout->spdif_formats;
+ if (mout->spdif_maxbps < hinfo->maxbps)
+ hinfo->maxbps = mout->spdif_maxbps;
+ } else {
+ mout->share_spdif = 0;
+ /* FIXME: need notify? */
+ }
}
mutex_unlock(&codec->spdif_mutex);
}