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