Lines Matching full:timer
14 * Timer 1 - 80us
17 static int snd_gf1_timer1_start(struct snd_timer * timer) in snd_gf1_timer1_start() argument
24 gus = snd_timer_chip(timer); in snd_gf1_timer1_start()
26 ticks = timer->sticks; in snd_gf1_timer1_start()
28 snd_gf1_write8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1, 256 - ticks); /* timer 1 count */ in snd_gf1_timer1_start()
29 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* enable timer 1 IRQ */ in snd_gf1_timer1_start()
30 snd_gf1_adlib_write(gus, 0x04, tmp >> 2); /* timer 2 start */ in snd_gf1_timer1_start()
35 static int snd_gf1_timer1_stop(struct snd_timer * timer) in snd_gf1_timer1_stop() argument
41 gus = snd_timer_chip(timer); in snd_gf1_timer1_stop()
44 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* disable timer #1 */ in snd_gf1_timer1_stop()
50 * Timer 2 - 320us
53 static int snd_gf1_timer2_start(struct snd_timer * timer) in snd_gf1_timer2_start() argument
60 gus = snd_timer_chip(timer); in snd_gf1_timer2_start()
62 ticks = timer->sticks; in snd_gf1_timer2_start()
64 snd_gf1_write8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2, 256 - ticks); /* timer 2 count */ in snd_gf1_timer2_start()
65 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* enable timer 2 IRQ */ in snd_gf1_timer2_start()
66 snd_gf1_adlib_write(gus, 0x04, tmp >> 2); /* timer 2 start */ in snd_gf1_timer2_start()
71 static int snd_gf1_timer2_stop(struct snd_timer * timer) in snd_gf1_timer2_stop() argument
77 gus = snd_timer_chip(timer); in snd_gf1_timer2_stop()
80 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* disable timer #1 */ in snd_gf1_timer2_stop()
91 struct snd_timer *timer = gus->gf1.timer1; in snd_gf1_interrupt_timer1() local
93 if (timer == NULL) in snd_gf1_interrupt_timer1()
95 snd_timer_interrupt(timer, timer->sticks); in snd_gf1_interrupt_timer1()
100 struct snd_timer *timer = gus->gf1.timer2; in snd_gf1_interrupt_timer2() local
102 if (timer == NULL) in snd_gf1_interrupt_timer2()
104 snd_timer_interrupt(timer, timer->sticks); in snd_gf1_interrupt_timer2()
129 static void snd_gf1_timer1_free(struct snd_timer *timer) in snd_gf1_timer1_free() argument
131 struct snd_gus_card *gus = timer->private_data; in snd_gf1_timer1_free()
135 static void snd_gf1_timer2_free(struct snd_timer *timer) in snd_gf1_timer2_free() argument
137 struct snd_gus_card *gus = timer->private_data; in snd_gf1_timer2_free()
143 struct snd_timer *timer; in snd_gf1_timers_init() local
158 if (snd_timer_new(gus->card, "GF1 timer", &tid, &timer) >= 0) { in snd_gf1_timers_init()
159 strcpy(timer->name, "GF1 timer #1"); in snd_gf1_timers_init()
160 timer->private_data = gus; in snd_gf1_timers_init()
161 timer->private_free = snd_gf1_timer1_free; in snd_gf1_timers_init()
162 timer->hw = snd_gf1_timer1; in snd_gf1_timers_init()
164 gus->gf1.timer1 = timer; in snd_gf1_timers_init()
168 if (snd_timer_new(gus->card, "GF1 timer", &tid, &timer) >= 0) { in snd_gf1_timers_init()
169 strcpy(timer->name, "GF1 timer #2"); in snd_gf1_timers_init()
170 timer->private_data = gus; in snd_gf1_timers_init()
171 timer->private_free = snd_gf1_timer2_free; in snd_gf1_timers_init()
172 timer->hw = snd_gf1_timer2; in snd_gf1_timers_init()
174 gus->gf1.timer2 = timer; in snd_gf1_timers_init()