diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-07-03 23:50:45 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-07-03 23:50:45 +0200 |
commit | 854ace9c40d2b121191e1644aa4b0b68c4a226d3 (patch) | |
tree | fdc43a62eacc95a1276003a4d7d46287312407ab /sound/pci/hda/hda_codec.c | |
parent | dbe45d0ce394732cc06187e929697fc0fb16aa53 (diff) | |
parent | c470331e69bd54d11a9ea3c27a0e4ad783d02d6b (diff) | |
download | linux-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.c | 14 |
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); } |