]> err.no Git - linux-2.6/commitdiff
[ALSA] ymfpci: change timer resolution to 48 kHz
authorClemens Ladisch <clemens@ladisch.de>
Wed, 19 Oct 2005 12:39:48 +0000 (14:39 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 4 Nov 2005 12:19:09 +0000 (13:19 +0100)
Modules: YMFPCI driver

We better pretend that the ymfpci timer runs at 48 kHz because the
interrupt frequency cannot be higher, and clients that would try to
use 96 kHz would run at half their desired speed.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
sound/pci/ymfpci/ymfpci_main.c

index c0aaade772d4cd07ad2521de8e18c22d5df769a9..d27f3b56b513f02ad25430b5ed415bd8b51026f6 100644 (file)
@@ -1851,9 +1851,7 @@ static int snd_ymfpci_timer_start(snd_timer_t *timer)
        unsigned int count;
 
        chip = snd_timer_chip(timer);
-       count = timer->sticks - 1;
-       if (count == 0) /* minimum time is 20.8 us */
-               count = 1;
+       count = (timer->sticks << 1) - 1;
        spin_lock_irqsave(&chip->reg_lock, flags);
        snd_ymfpci_writew(chip, YDSXGR_TIMERCOUNT, count);
        snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x03);
@@ -1877,14 +1875,14 @@ static int snd_ymfpci_timer_precise_resolution(snd_timer_t *timer,
                                               unsigned long *num, unsigned long *den)
 {
        *num = 1;
-       *den = 96000;
+       *den = 48000;
        return 0;
 }
 
 static struct _snd_timer_hardware snd_ymfpci_timer_hw = {
        .flags = SNDRV_TIMER_HW_AUTO,
-       .resolution = 10417, /* 1/2fs = 10.41666...us */
-       .ticks = 65536,
+       .resolution = 20833, /* 1/fs = 20.8333...us */
+       .ticks = 0x8000,
        .start = snd_ymfpci_timer_start,
        .stop = snd_ymfpci_timer_stop,
        .precise_resolution = snd_ymfpci_timer_precise_resolution,