aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/isa/gus/gus_irq.c18
-rw-r--r--sound/isa/gus/gus_main.c16
2 files changed, 20 insertions, 14 deletions
diff --git a/sound/isa/gus/gus_irq.c b/sound/isa/gus/gus_irq.c
index a0430b338d67..cd9a6f1c99e6 100644
--- a/sound/isa/gus/gus_irq.c
+++ b/sound/isa/gus/gus_irq.c
@@ -45,11 +45,13 @@ __again:
45 // snd_printk("IRQ: status = 0x%x\n", status); 45 // snd_printk("IRQ: status = 0x%x\n", status);
46 if (status & 0x02) { 46 if (status & 0x02) {
47 STAT_ADD(gus->gf1.interrupt_stat_midi_in); 47 STAT_ADD(gus->gf1.interrupt_stat_midi_in);
48 gus->gf1.interrupt_handler_midi_in(gus); 48 if (gus->gf1.interrupt_handler_midi_in)
49 gus->gf1.interrupt_handler_midi_in(gus);
49 } 50 }
50 if (status & 0x01) { 51 if (status & 0x01) {
51 STAT_ADD(gus->gf1.interrupt_stat_midi_out); 52 STAT_ADD(gus->gf1.interrupt_stat_midi_out);
52 gus->gf1.interrupt_handler_midi_out(gus); 53 if (gus->gf1.interrupt_handler_midi_out)
54 gus->gf1.interrupt_handler_midi_out(gus);
53 } 55 }
54 if (status & (0x20 | 0x40)) { 56 if (status & (0x20 | 0x40)) {
55 unsigned int already, _current_; 57 unsigned int already, _current_;
@@ -85,20 +87,24 @@ __again:
85 } 87 }
86 if (status & 0x04) { 88 if (status & 0x04) {
87 STAT_ADD(gus->gf1.interrupt_stat_timer1); 89 STAT_ADD(gus->gf1.interrupt_stat_timer1);
88 gus->gf1.interrupt_handler_timer1(gus); 90 if (gus->gf1.interrupt_handler_timer1)
91 gus->gf1.interrupt_handler_timer1(gus);
89 } 92 }
90 if (status & 0x08) { 93 if (status & 0x08) {
91 STAT_ADD(gus->gf1.interrupt_stat_timer2); 94 STAT_ADD(gus->gf1.interrupt_stat_timer2);
92 gus->gf1.interrupt_handler_timer2(gus); 95 if (gus->gf1.interrupt_handler_timer2)
96 gus->gf1.interrupt_handler_timer2(gus);
93 } 97 }
94 if (status & 0x80) { 98 if (status & 0x80) {
95 if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL) & 0x40) { 99 if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL) & 0x40) {
96 STAT_ADD(gus->gf1.interrupt_stat_dma_write); 100 STAT_ADD(gus->gf1.interrupt_stat_dma_write);
97 gus->gf1.interrupt_handler_dma_write(gus); 101 if (gus->gf1.interrupt_handler_dma_write)
102 gus->gf1.interrupt_handler_dma_write(gus);
98 } 103 }
99 if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL) & 0x40) { 104 if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL) & 0x40) {
100 STAT_ADD(gus->gf1.interrupt_stat_dma_read); 105 STAT_ADD(gus->gf1.interrupt_stat_dma_read);
101 gus->gf1.interrupt_handler_dma_read(gus); 106 if (gus->gf1.interrupt_handler_dma_read)
107 gus->gf1.interrupt_handler_dma_read(gus);
102 } 108 }
103 } 109 }
104 if (--loop > 0) 110 if (--loop > 0)
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index ada9209a93a6..b14d5d6d9a32 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -154,6 +154,14 @@ int snd_gus_create(struct snd_card *card,
154 gus = kzalloc(sizeof(*gus), GFP_KERNEL); 154 gus = kzalloc(sizeof(*gus), GFP_KERNEL);
155 if (gus == NULL) 155 if (gus == NULL)
156 return -ENOMEM; 156 return -ENOMEM;
157 spin_lock_init(&gus->reg_lock);
158 spin_lock_init(&gus->voice_alloc);
159 spin_lock_init(&gus->active_voice_lock);
160 spin_lock_init(&gus->event_lock);
161 spin_lock_init(&gus->dma_lock);
162 spin_lock_init(&gus->pcm_volume_level_lock);
163 spin_lock_init(&gus->uart_cmd_lock);
164 mutex_init(&gus->dma_mutex);
157 gus->gf1.irq = -1; 165 gus->gf1.irq = -1;
158 gus->gf1.dma1 = -1; 166 gus->gf1.dma1 = -1;
159 gus->gf1.dma2 = -1; 167 gus->gf1.dma2 = -1;
@@ -218,14 +226,6 @@ int snd_gus_create(struct snd_card *card,
218 gus->gf1.pcm_channels = pcm_channels; 226 gus->gf1.pcm_channels = pcm_channels;
219 gus->gf1.volume_ramp = 25; 227 gus->gf1.volume_ramp = 25;
220 gus->gf1.smooth_pan = 1; 228 gus->gf1.smooth_pan = 1;
221 spin_lock_init(&gus->reg_lock);
222 spin_lock_init(&gus->voice_alloc);
223 spin_lock_init(&gus->active_voice_lock);
224 spin_lock_init(&gus->event_lock);
225 spin_lock_init(&gus->dma_lock);
226 spin_lock_init(&gus->pcm_volume_level_lock);
227 spin_lock_init(&gus->uart_cmd_lock);
228 mutex_init(&gus->dma_mutex);
229 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops)) < 0) { 229 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops)) < 0) {
230 snd_gus_free(gus); 230 snd_gus_free(gus);
231 return err; 231 return err;