aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2010-01-08 03:11:18 -0500
committerJaroslav Kysela <perex@perex.cz>2010-01-08 03:11:18 -0500
commita4ad68d57e4dc4138304df23d1817eb094149389 (patch)
treeca7d8c4ce5377c4251560de06e15dd7be7063351 /sound/core
parentcd9d95a55550555da8e587ead9cbba5f98a371a3 (diff)
parentc97259df3f2e163c72f4d0685c61fb2e026dc989 (diff)
Merge branch 'topic/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/Kconfig1
-rw-r--r--sound/core/pcm_lib.c4
-rw-r--r--sound/core/pcm_timer.c17
3 files changed, 4 insertions, 18 deletions
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index c15682a2f9db..475455c76610 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -5,6 +5,7 @@ config SND_TIMER
5config SND_PCM 5config SND_PCM
6 tristate 6 tristate
7 select SND_TIMER 7 select SND_TIMER
8 select GCD
8 9
9config SND_HWDEP 10config SND_HWDEP
10 tristate 11 tristate
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index c7b35b20e659..0ee7e807c964 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -774,7 +774,7 @@ int snd_interval_ratnum(struct snd_interval *i,
774 int diff; 774 int diff;
775 if (q == 0) 775 if (q == 0)
776 q = 1; 776 q = 1;
777 den = div_down(num, q); 777 den = div_up(num, q);
778 if (den < rats[k].den_min) 778 if (den < rats[k].den_min)
779 continue; 779 continue;
780 if (den > rats[k].den_max) 780 if (den > rats[k].den_max)
@@ -810,7 +810,7 @@ int snd_interval_ratnum(struct snd_interval *i,
810 i->empty = 1; 810 i->empty = 1;
811 return -EINVAL; 811 return -EINVAL;
812 } 812 }
813 den = div_up(num, q); 813 den = div_down(num, q);
814 if (den > rats[k].den_max) 814 if (den > rats[k].den_max)
815 continue; 815 continue;
816 if (den < rats[k].den_min) 816 if (den < rats[k].den_min)
diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c
index ca8068b63d6c..b01d9481d632 100644
--- a/sound/core/pcm_timer.c
+++ b/sound/core/pcm_timer.c
@@ -20,6 +20,7 @@
20 */ 20 */
21 21
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/gcd.h>
23#include <sound/core.h> 24#include <sound/core.h>
24#include <sound/pcm.h> 25#include <sound/pcm.h>
25#include <sound/timer.h> 26#include <sound/timer.h>
@@ -28,22 +29,6 @@
28 * Timer functions 29 * Timer functions
29 */ 30 */
30 31
31/* Greatest common divisor */
32static unsigned long gcd(unsigned long a, unsigned long b)
33{
34 unsigned long r;
35 if (a < b) {
36 r = a;
37 a = b;
38 b = r;
39 }
40 while ((r = a % b) != 0) {
41 a = b;
42 b = r;
43 }
44 return b;
45}
46
47void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) 32void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream)
48{ 33{
49 unsigned long rate, mult, fsize, l, post; 34 unsigned long rate, mult, fsize, l, post;