aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_synth.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_synth.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_synth.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/sound/pci/emu10k1/emu10k1_synth.c b/sound/pci/emu10k1/emu10k1_synth.c
index 204995a1dfbd..ad7b71491fc4 100644
--- a/sound/pci/emu10k1/emu10k1_synth.c
+++ b/sound/pci/emu10k1/emu10k1_synth.c
@@ -30,7 +30,7 @@ MODULE_LICENSE("GPL");
30 */ 30 */
31static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev) 31static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
32{ 32{
33 struct snd_emux *emu; 33 struct snd_emux *emux;
34 struct snd_emu10k1 *hw; 34 struct snd_emu10k1 *hw;
35 struct snd_emu10k1_synth_arg *arg; 35 struct snd_emu10k1_synth_arg *arg;
36 unsigned long flags; 36 unsigned long flags;
@@ -46,53 +46,56 @@ static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
46 else if (arg->max_voices > 64) 46 else if (arg->max_voices > 64)
47 arg->max_voices = 64; 47 arg->max_voices = 64;
48 48
49 if (snd_emux_new(&emu) < 0) 49 if (snd_emux_new(&emux) < 0)
50 return -ENOMEM; 50 return -ENOMEM;
51 51
52 snd_emu10k1_ops_setup(emu); 52 snd_emu10k1_ops_setup(emux);
53 emu->hw = hw = arg->hwptr; 53 hw = arg->hwptr;
54 emu->max_voices = arg->max_voices; 54 emux->hw = hw;
55 emu->num_ports = arg->seq_ports; 55 emux->max_voices = arg->max_voices;
56 emu->pitch_shift = -501; 56 emux->num_ports = arg->seq_ports;
57 emu->memhdr = hw->memhdr; 57 emux->pitch_shift = -501;
58 emu->midi_ports = arg->seq_ports < 2 ? arg->seq_ports : 2; /* maximum two ports */ 58 emux->memhdr = hw->memhdr;
59 emu->midi_devidx = hw->audigy ? 2 : 1; /* audigy has two external midis */ 59 /* maximum two ports */
60 emu->linear_panning = 0; 60 emux->midi_ports = arg->seq_ports < 2 ? arg->seq_ports : 2;
61 emu->hwdep_idx = 2; /* FIXED */ 61 /* audigy has two external midis */
62 62 emux->midi_devidx = hw->audigy ? 2 : 1;
63 if (snd_emux_register(emu, dev->card, arg->index, "Emu10k1") < 0) { 63 emux->linear_panning = 0;
64 snd_emux_free(emu); 64 emux->hwdep_idx = 2; /* FIXED */
65
66 if (snd_emux_register(emux, dev->card, arg->index, "Emu10k1") < 0) {
67 snd_emux_free(emux);
65 return -ENOMEM; 68 return -ENOMEM;
66 } 69 }
67 70
68 spin_lock_irqsave(&hw->voice_lock, flags); 71 spin_lock_irqsave(&hw->voice_lock, flags);
69 hw->synth = emu; 72 hw->synth = emux;
70 hw->get_synth_voice = snd_emu10k1_synth_get_voice; 73 hw->get_synth_voice = snd_emu10k1_synth_get_voice;
71 spin_unlock_irqrestore(&hw->voice_lock, flags); 74 spin_unlock_irqrestore(&hw->voice_lock, flags);
72 75
73 dev->driver_data = emu; 76 dev->driver_data = emux;
74 77
75 return 0; 78 return 0;
76} 79}
77 80
78static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev) 81static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
79{ 82{
80 struct snd_emux *emu; 83 struct snd_emux *emux;
81 struct snd_emu10k1 *hw; 84 struct snd_emu10k1 *hw;
82 unsigned long flags; 85 unsigned long flags;
83 86
84 if (dev->driver_data == NULL) 87 if (dev->driver_data == NULL)
85 return 0; /* not registered actually */ 88 return 0; /* not registered actually */
86 89
87 emu = dev->driver_data; 90 emux = dev->driver_data;
88 91
89 hw = emu->hw; 92 hw = emux->hw;
90 spin_lock_irqsave(&hw->voice_lock, flags); 93 spin_lock_irqsave(&hw->voice_lock, flags);
91 hw->synth = NULL; 94 hw->synth = NULL;
92 hw->get_synth_voice = NULL; 95 hw->get_synth_voice = NULL;
93 spin_unlock_irqrestore(&hw->voice_lock, flags); 96 spin_unlock_irqrestore(&hw->voice_lock, flags);
94 97
95 snd_emux_free(emu); 98 snd_emux_free(emux);
96 return 0; 99 return 0;
97} 100}
98 101