Lines Matching refs:gus
22 struct snd_gus_card *gus; in snd_gf1_timer1_start() local
24 gus = snd_timer_chip(timer); in snd_gf1_timer1_start()
25 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_timer1_start()
27 tmp = (gus->gf1.timer_enabled |= 4); 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()
31 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_timer1_start()
39 struct snd_gus_card *gus; in snd_gf1_timer1_stop() local
41 gus = snd_timer_chip(timer); in snd_gf1_timer1_stop()
42 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_timer1_stop()
43 tmp = (gus->gf1.timer_enabled &= ~4); 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()
45 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_timer1_stop()
58 struct snd_gus_card *gus; in snd_gf1_timer2_start() local
60 gus = snd_timer_chip(timer); in snd_gf1_timer2_start()
61 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_timer2_start()
63 tmp = (gus->gf1.timer_enabled |= 8); 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()
67 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_timer2_start()
75 struct snd_gus_card *gus; in snd_gf1_timer2_stop() local
77 gus = snd_timer_chip(timer); in snd_gf1_timer2_stop()
78 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_timer2_stop()
79 tmp = (gus->gf1.timer_enabled &= ~8); 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()
81 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_timer2_stop()
89 static void snd_gf1_interrupt_timer1(struct snd_gus_card * gus) in snd_gf1_interrupt_timer1() argument
91 struct snd_timer *timer = gus->gf1.timer1; in snd_gf1_interrupt_timer1()
98 static void snd_gf1_interrupt_timer2(struct snd_gus_card * gus) in snd_gf1_interrupt_timer2() argument
100 struct snd_timer *timer = gus->gf1.timer2; in snd_gf1_interrupt_timer2()
131 struct snd_gus_card *gus = timer->private_data; in snd_gf1_timer1_free() local
132 gus->gf1.timer1 = NULL; in snd_gf1_timer1_free()
137 struct snd_gus_card *gus = timer->private_data; in snd_gf1_timer2_free() local
138 gus->gf1.timer2 = NULL; in snd_gf1_timer2_free()
141 void snd_gf1_timers_init(struct snd_gus_card * gus) in snd_gf1_timers_init() argument
146 if (gus->gf1.timer1 != NULL || gus->gf1.timer2 != NULL) in snd_gf1_timers_init()
149 gus->gf1.interrupt_handler_timer1 = snd_gf1_interrupt_timer1; in snd_gf1_timers_init()
150 gus->gf1.interrupt_handler_timer2 = snd_gf1_interrupt_timer2; in snd_gf1_timers_init()
154 tid.card = gus->card->number; in snd_gf1_timers_init()
155 tid.device = gus->timer_dev; in snd_gf1_timers_init()
158 if (snd_timer_new(gus->card, "GF1 timer", &tid, &timer) >= 0) { in snd_gf1_timers_init()
160 timer->private_data = gus; 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()
170 timer->private_data = gus; in snd_gf1_timers_init()
174 gus->gf1.timer2 = timer; in snd_gf1_timers_init()
177 void snd_gf1_timers_done(struct snd_gus_card * gus) in snd_gf1_timers_done() argument
179 snd_gf1_set_default_handlers(gus, SNDRV_GF1_HANDLER_TIMER1 | SNDRV_GF1_HANDLER_TIMER2); in snd_gf1_timers_done()
180 if (gus->gf1.timer1) { in snd_gf1_timers_done()
181 snd_device_free(gus->card, gus->gf1.timer1); in snd_gf1_timers_done()
182 gus->gf1.timer1 = NULL; in snd_gf1_timers_done()
184 if (gus->gf1.timer2) { in snd_gf1_timers_done()
185 snd_device_free(gus->card, gus->gf1.timer2); in snd_gf1_timers_done()
186 gus->gf1.timer2 = NULL; in snd_gf1_timers_done()