22 #include <linux/slab.h>
23 #include <linux/module.h>
25 #include <linux/hrtimer.h>
35 #define NANO_SEC 1000000000UL
36 static unsigned int resolution;
53 oruns = hrtimer_forward_now(hrt, ns_to_ktime(t->
sticks * resolution));
61 static int snd_hrtimer_open(
struct snd_timer *
t)
70 stime->
hrt.function = snd_hrtimer_callback;
76 static int snd_hrtimer_close(
struct snd_timer *t)
88 static int snd_hrtimer_start(
struct snd_timer *t)
100 static int snd_hrtimer_stop(
struct snd_timer *t)
109 .open = snd_hrtimer_open,
110 .close = snd_hrtimer_close,
111 .start = snd_hrtimer_start,
112 .stop = snd_hrtimer_stop,
121 static int __init snd_hrtimer_init(
void)
128 if (tp.tv_sec > 0 || !tp.tv_nsec) {
130 "snd-hrtimer: Invalid resolution %u.%09u",
131 (
unsigned)tp.tv_sec, (
unsigned)tp.tv_nsec);
134 resolution = tp.tv_nsec;
144 timer->
hw = hrtimer_hw;
145 timer->
hw.resolution = resolution;
158 static void __exit snd_hrtimer_exit(
void)