diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:51:56 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:51:56 -0400 |
commit | 8bd172dc96fba8ba5a7560afdc1ff7461c278e86 (patch) | |
tree | 3e116afc5055bd0b54b4e0ae065c33c1f3e97e47 /sound/pci/lola/lola.c | |
parent | 972505ccde9a3bdc8455f4cf3d3f37d17f8f10a3 (diff) |
ALSA: lola - Allow granularity changes
Add some sanity checks.
Change PCM parameters appropriately per granularity.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lola/lola.c')
-rw-r--r-- | sound/pci/lola/lola.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 3d2516b11f22..8ee22bee10c9 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c | |||
@@ -587,14 +587,31 @@ static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, | |||
587 | chip->pci = pci; | 587 | chip->pci = pci; |
588 | chip->irq = -1; | 588 | chip->irq = -1; |
589 | 589 | ||
590 | chip->sample_rate_min = sample_rate_min[dev]; | ||
591 | chip->granularity = granularity[dev]; | 590 | chip->granularity = granularity[dev]; |
592 | /* FIXME */ | 591 | switch (chip->granularity) { |
593 | if (chip->granularity != LOLA_GRANULARITY_MAX) { | 592 | case 8: |
593 | chip->sample_rate_max = 48000; | ||
594 | break; | ||
595 | case 16: | ||
596 | chip->sample_rate_max = 96000; | ||
597 | break; | ||
598 | case 32: | ||
599 | chip->sample_rate_max = 192000; | ||
600 | break; | ||
601 | default: | ||
594 | snd_printk(KERN_WARNING SFX | 602 | snd_printk(KERN_WARNING SFX |
595 | "Only %d granularity is supported for now\n", | 603 | "Invalid granularity %d, reset to %d\n", |
596 | LOLA_GRANULARITY_MAX); | 604 | chip->granularity, LOLA_GRANULARITY_MAX); |
597 | chip->granularity = LOLA_GRANULARITY_MAX; | 605 | chip->granularity = LOLA_GRANULARITY_MAX; |
606 | chip->sample_rate_max = 192000; | ||
607 | break; | ||
608 | } | ||
609 | chip->sample_rate_min = sample_rate_min[dev]; | ||
610 | if (chip->sample_rate_min > chip->sample_rate_max) { | ||
611 | snd_printk(KERN_WARNING SFX | ||
612 | "Invalid sample_rate_min %d, reset to 16000\n", | ||
613 | chip->sample_rate_min); | ||
614 | chip->sample_rate_min = 16000; | ||
598 | } | 615 | } |
599 | 616 | ||
600 | err = pci_request_regions(pci, DRVNAME); | 617 | err = pci_request_regions(pci, DRVNAME); |