aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/asihpi
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2011-03-25 15:25:46 +1300
committerTakashi Iwai <tiwai@suse.de>2011-03-25 12:42:26 +0100
commit7bf76c33e9a1ecb2a15f1a066d4e032b5d0922a7 (patch)
treec722c8a6ad3780325c60b32b1ed8aee7889615ba /sound/pci/asihpi
parent677cd904aba939bc4cfdc3c1eada8ec46582127e (diff)
ALSA: asihpi - Support single-rate no-SRC cards
Cards without settable local samplerate and without SRC still must have a valid samplerate. This fixed rate is determined by reading the current rate for the card. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi')
-rw-r--r--sound/pci/asihpi/asihpi.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 0ac1f98d91a..22606e3b08f 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -381,13 +381,13 @@ static void snd_card_asihpi_pcm_samplerates(struct snd_card_asihpi *asihpi,
"No local sampleclock, err %d\n", err);
}
- for (idx = 0; idx < 100; idx++) {
- if (hpi_sample_clock_query_local_rate(
- h_control, idx, &sample_rate)) {
- if (!idx)
- snd_printk(KERN_ERR
- "Local rate query failed\n");
-
+ for (idx = -1; idx < 100; idx++) {
+ if (idx == -1) {
+ if (hpi_sample_clock_get_sample_rate(h_control,
+ &sample_rate))
+ continue;
+ } else if (hpi_sample_clock_query_local_rate(h_control,
+ idx, &sample_rate)) {
break;
}
@@ -440,8 +440,6 @@ static void snd_card_asihpi_pcm_samplerates(struct snd_card_asihpi *asihpi,
}
}
- /* printk(KERN_INFO "Supported rates %X %d %d\n",
- rates, rate_min, rate_max); */
pcmhw->rates = rates;
pcmhw->rate_min = rate_min;
pcmhw->rate_max = rate_max;