aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_intel.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_intel.c
parentdbe45d0ce394732cc06187e929697fc0fb16aa53 (diff)
parentc470331e69bd54d11a9ea3c27a0e4ad783d02d6b (diff)
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_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 4e9ea708027..1877d95d4aa 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1454,6 +1454,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
mutex_unlock(&chip->open_mutex);
return err;
}
+ snd_pcm_limit_hw_rates(runtime);
spin_lock_irqsave(&chip->reg_lock, flags);
azx_dev->substream = substream;
azx_dev->running = 0;
@@ -1463,6 +1464,12 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
snd_pcm_set_sync(substream);
mutex_unlock(&chip->open_mutex);
+ if (snd_BUG_ON(!runtime->hw.channels_min || !runtime->hw.channels_max))
+ return -EINVAL;
+ if (snd_BUG_ON(!runtime->hw.formats))
+ return -EINVAL;
+ if (snd_BUG_ON(!runtime->hw.rates))
+ return -EINVAL;
return 0;
}