Lines Matching defs:timer

17 static int snd_gf1_timer1_start(struct snd_timer * timer)
23 gus = snd_timer_chip(timer);
25 ticks = timer->sticks;
27 snd_gf1_write8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1, 256 - ticks); /* timer 1 count */
28 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* enable timer 1 IRQ */
29 snd_gf1_adlib_write(gus, 0x04, tmp >> 2); /* timer 2 start */
33 static int snd_gf1_timer1_stop(struct snd_timer * timer)
38 gus = snd_timer_chip(timer);
41 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* disable timer #1 */
49 static int snd_gf1_timer2_start(struct snd_timer * timer)
55 gus = snd_timer_chip(timer);
57 ticks = timer->sticks;
59 snd_gf1_write8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2, 256 - ticks); /* timer 2 count */
60 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* enable timer 2 IRQ */
61 snd_gf1_adlib_write(gus, 0x04, tmp >> 2); /* timer 2 start */
65 static int snd_gf1_timer2_stop(struct snd_timer * timer)
70 gus = snd_timer_chip(timer);
73 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp); /* disable timer #1 */
83 struct snd_timer *timer = gus->gf1.timer1;
85 if (timer == NULL)
87 snd_timer_interrupt(timer, timer->sticks);
92 struct snd_timer *timer = gus->gf1.timer2;
94 if (timer == NULL)
96 snd_timer_interrupt(timer, timer->sticks);
121 static void snd_gf1_timer1_free(struct snd_timer *timer)
123 struct snd_gus_card *gus = timer->private_data;
127 static void snd_gf1_timer2_free(struct snd_timer *timer)
129 struct snd_gus_card *gus = timer->private_data;
135 struct snd_timer *timer;
150 if (snd_timer_new(gus->card, "GF1 timer", &tid, &timer) >= 0) {
151 strscpy(timer->name, "GF1 timer #1");
152 timer->private_data = gus;
153 timer->private_free = snd_gf1_timer1_free;
154 timer->hw = snd_gf1_timer1;
156 gus->gf1.timer1 = timer;
160 if (snd_timer_new(gus->card, "GF1 timer", &tid, &timer) >= 0) {
161 strscpy(timer->name, "GF1 timer #2");
162 timer->private_data = gus;
163 timer->private_free = snd_gf1_timer2_free;
164 timer->hw = snd_gf1_timer2;
166 gus->gf1.timer2 = timer;