Changeset 772 for GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c
r703 r772 105 105 static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack) 106 106 { 107 unsigned long flags;108 107 int timeout, ok; 109 108 110 spin_lock_irq save(&midi->input_lock, flags);109 spin_lock_irq(&midi->input_lock); 111 110 mpu401_write_data(emu, midi, 0x00); 112 111 /* mpu401_clear_rx(emu, midi); */ … … 127 126 ok = 1; 128 127 } 129 spin_unlock_irq restore(&midi->input_lock, flags);128 spin_unlock_irq(&midi->input_lock); 130 129 if (!ok) { 131 130 dev_err(emu->card->dev, … … 143 142 struct snd_emu10k1 *emu; 144 143 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 145 unsigned long flags;146 144 147 145 emu = midi->emu; 148 146 if (snd_BUG_ON(!emu)) 149 147 return -ENXIO; 150 spin_lock_irq save(&midi->open_lock, flags);148 spin_lock_irq(&midi->open_lock); 151 149 midi->midi_mode |= EMU10K1_MIDI_MODE_INPUT; 152 150 midi->substream_input = substream; 153 151 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { 154 spin_unlock_irq restore(&midi->open_lock, flags);152 spin_unlock_irq(&midi->open_lock); 155 153 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1)) 156 154 goto error_out; … … 158 156 goto error_out; 159 157 } else { 160 spin_unlock_irq restore(&midi->open_lock, flags);158 spin_unlock_irq(&midi->open_lock); 161 159 } 162 160 return 0; … … 170 168 struct snd_emu10k1 *emu; 171 169 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 172 unsigned long flags;173 170 174 171 emu = midi->emu; 175 172 if (snd_BUG_ON(!emu)) 176 173 return -ENXIO; 177 spin_lock_irq save(&midi->open_lock, flags);174 spin_lock_irq(&midi->open_lock); 178 175 midi->midi_mode |= EMU10K1_MIDI_MODE_OUTPUT; 179 176 midi->substream_output = substream; 180 177 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { 181 spin_unlock_irq restore(&midi->open_lock, flags);178 spin_unlock_irq(&midi->open_lock); 182 179 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1)) 183 180 goto error_out; … … 185 182 goto error_out; 186 183 } else { 187 spin_unlock_irq restore(&midi->open_lock, flags);184 spin_unlock_irq(&midi->open_lock); 188 185 } 189 186 return 0; … … 197 194 struct snd_emu10k1 *emu; 198 195 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 199 unsigned long flags;200 196 int err = 0; 201 197 … … 203 199 if (snd_BUG_ON(!emu)) 204 200 return -ENXIO; 205 spin_lock_irq save(&midi->open_lock, flags);201 spin_lock_irq(&midi->open_lock); 206 202 snd_emu10k1_intr_disable(emu, midi->rx_enable); 207 203 midi->midi_mode &= ~EMU10K1_MIDI_MODE_INPUT; 208 204 midi->substream_input = NULL; 209 205 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { 210 spin_unlock_irq restore(&midi->open_lock, flags);206 spin_unlock_irq(&midi->open_lock); 211 207 err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); 212 208 } else { 213 spin_unlock_irq restore(&midi->open_lock, flags);209 spin_unlock_irq(&midi->open_lock); 214 210 } 215 211 return err; … … 220 216 struct snd_emu10k1 *emu; 221 217 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 222 unsigned long flags;223 218 int err = 0; 224 219 … … 226 221 if (snd_BUG_ON(!emu)) 227 222 return -ENXIO; 228 spin_lock_irq save(&midi->open_lock, flags);223 spin_lock_irq(&midi->open_lock); 229 224 snd_emu10k1_intr_disable(emu, midi->tx_enable); 230 225 midi->midi_mode &= ~EMU10K1_MIDI_MODE_OUTPUT; 231 226 midi->substream_output = NULL; 232 227 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { 233 spin_unlock_irq restore(&midi->open_lock, flags);228 spin_unlock_irq(&midi->open_lock); 234 229 err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); 235 230 } else { 236 spin_unlock_irq restore(&midi->open_lock, flags);231 spin_unlock_irq(&midi->open_lock); 237 232 } 238 233 return err; … … 257 252 struct snd_emu10k1 *emu; 258 253 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 259 unsigned long flags;260 254 261 255 emu = midi->emu; … … 268 262 269 263 /* try to send some amount of bytes here before interrupts */ 270 spin_lock_irq save(&midi->output_lock, flags);264 spin_lock_irq(&midi->output_lock); 271 265 while (max > 0) { 272 266 if (mpu401_output_ready(emu, midi)) { … … 274 268 snd_rawmidi_transmit(substream, &byte, 1) != 1) { 275 269 /* no more data */ 276 spin_unlock_irq restore(&midi->output_lock, flags);270 spin_unlock_irq(&midi->output_lock); 277 271 return; 278 272 } … … 283 277 } 284 278 } 285 spin_unlock_irq restore(&midi->output_lock, flags);279 spin_unlock_irq(&midi->output_lock); 286 280 snd_emu10k1_intr_enable(emu, midi->tx_enable); 287 281 } else {
Note:
See TracChangeset
for help on using the changeset viewer.