• Home
  • Raw
  • Download

Lines Matching refs:midi

239 	struct emu10k1x_midi midi;  member
807 if (chip->midi.interrupt) in snd_emu10k1x_interrupt()
808 chip->midi.interrupt(chip, status); in snd_emu10k1x_interrupt()
1234 struct emu10k1x_midi *midi, unsigned int status) in do_emu10k1x_midi_interrupt() argument
1238 if (midi->rmidi == NULL) { in do_emu10k1x_midi_interrupt()
1239 snd_emu10k1x_intr_disable(emu, midi->tx_enable | midi->rx_enable); in do_emu10k1x_midi_interrupt()
1243 spin_lock(&midi->input_lock); in do_emu10k1x_midi_interrupt()
1244 if ((status & midi->ipr_rx) && mpu401_input_avail(emu, midi)) { in do_emu10k1x_midi_interrupt()
1245 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { in do_emu10k1x_midi_interrupt()
1246 mpu401_clear_rx(emu, midi); in do_emu10k1x_midi_interrupt()
1248 byte = mpu401_read_data(emu, midi); in do_emu10k1x_midi_interrupt()
1249 if (midi->substream_input) in do_emu10k1x_midi_interrupt()
1250 snd_rawmidi_receive(midi->substream_input, &byte, 1); in do_emu10k1x_midi_interrupt()
1253 spin_unlock(&midi->input_lock); in do_emu10k1x_midi_interrupt()
1255 spin_lock(&midi->output_lock); in do_emu10k1x_midi_interrupt()
1256 if ((status & midi->ipr_tx) && mpu401_output_ready(emu, midi)) { in do_emu10k1x_midi_interrupt()
1257 if (midi->substream_output && in do_emu10k1x_midi_interrupt()
1258 snd_rawmidi_transmit(midi->substream_output, &byte, 1) == 1) { in do_emu10k1x_midi_interrupt()
1259 mpu401_write_data(emu, midi, byte); in do_emu10k1x_midi_interrupt()
1261 snd_emu10k1x_intr_disable(emu, midi->tx_enable); in do_emu10k1x_midi_interrupt()
1264 spin_unlock(&midi->output_lock); in do_emu10k1x_midi_interrupt()
1269 do_emu10k1x_midi_interrupt(emu, &emu->midi, status); in snd_emu10k1x_midi_interrupt()
1273 struct emu10k1x_midi *midi, unsigned char cmd, int ack) in snd_emu10k1x_midi_cmd() argument
1278 spin_lock_irqsave(&midi->input_lock, flags); in snd_emu10k1x_midi_cmd()
1279 mpu401_write_data(emu, midi, 0x00); in snd_emu10k1x_midi_cmd()
1282 mpu401_write_cmd(emu, midi, cmd); in snd_emu10k1x_midi_cmd()
1287 if (mpu401_input_avail(emu, midi)) { in snd_emu10k1x_midi_cmd()
1288 if (mpu401_read_data(emu, midi) == MPU401_ACK) in snd_emu10k1x_midi_cmd()
1292 if (!ok && mpu401_read_data(emu, midi) == MPU401_ACK) in snd_emu10k1x_midi_cmd()
1297 spin_unlock_irqrestore(&midi->input_lock, flags); in snd_emu10k1x_midi_cmd()
1302 mpu401_read_stat(emu, midi), in snd_emu10k1x_midi_cmd()
1303 mpu401_read_data(emu, midi)); in snd_emu10k1x_midi_cmd()
1312 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_input_open() local
1315 emu = midi->emu; in snd_emu10k1x_midi_input_open()
1318 spin_lock_irqsave(&midi->open_lock, flags); in snd_emu10k1x_midi_input_open()
1319 midi->midi_mode |= EMU10K1X_MIDI_MODE_INPUT; in snd_emu10k1x_midi_input_open()
1320 midi->substream_input = substream; in snd_emu10k1x_midi_input_open()
1321 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { in snd_emu10k1x_midi_input_open()
1322 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_input_open()
1323 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1)) in snd_emu10k1x_midi_input_open()
1325 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) in snd_emu10k1x_midi_input_open()
1328 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_input_open()
1339 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_output_open() local
1342 emu = midi->emu; in snd_emu10k1x_midi_output_open()
1345 spin_lock_irqsave(&midi->open_lock, flags); in snd_emu10k1x_midi_output_open()
1346 midi->midi_mode |= EMU10K1X_MIDI_MODE_OUTPUT; in snd_emu10k1x_midi_output_open()
1347 midi->substream_output = substream; in snd_emu10k1x_midi_output_open()
1348 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { in snd_emu10k1x_midi_output_open()
1349 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_output_open()
1350 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1)) in snd_emu10k1x_midi_output_open()
1352 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) in snd_emu10k1x_midi_output_open()
1355 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_output_open()
1366 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_input_close() local
1370 emu = midi->emu; in snd_emu10k1x_midi_input_close()
1373 spin_lock_irqsave(&midi->open_lock, flags); in snd_emu10k1x_midi_input_close()
1374 snd_emu10k1x_intr_disable(emu, midi->rx_enable); in snd_emu10k1x_midi_input_close()
1375 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_INPUT; in snd_emu10k1x_midi_input_close()
1376 midi->substream_input = NULL; in snd_emu10k1x_midi_input_close()
1377 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { in snd_emu10k1x_midi_input_close()
1378 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_input_close()
1379 err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); in snd_emu10k1x_midi_input_close()
1381 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_input_close()
1389 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_output_close() local
1393 emu = midi->emu; in snd_emu10k1x_midi_output_close()
1396 spin_lock_irqsave(&midi->open_lock, flags); in snd_emu10k1x_midi_output_close()
1397 snd_emu10k1x_intr_disable(emu, midi->tx_enable); in snd_emu10k1x_midi_output_close()
1398 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_OUTPUT; in snd_emu10k1x_midi_output_close()
1399 midi->substream_output = NULL; in snd_emu10k1x_midi_output_close()
1400 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { in snd_emu10k1x_midi_output_close()
1401 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_output_close()
1402 err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); in snd_emu10k1x_midi_output_close()
1404 spin_unlock_irqrestore(&midi->open_lock, flags); in snd_emu10k1x_midi_output_close()
1412 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_input_trigger() local
1413 emu = midi->emu; in snd_emu10k1x_midi_input_trigger()
1418 snd_emu10k1x_intr_enable(emu, midi->rx_enable); in snd_emu10k1x_midi_input_trigger()
1420 snd_emu10k1x_intr_disable(emu, midi->rx_enable); in snd_emu10k1x_midi_input_trigger()
1426 struct emu10k1x_midi *midi = substream->rmidi->private_data; in snd_emu10k1x_midi_output_trigger() local
1429 emu = midi->emu; in snd_emu10k1x_midi_output_trigger()
1438 spin_lock_irqsave(&midi->output_lock, flags); in snd_emu10k1x_midi_output_trigger()
1440 if (mpu401_output_ready(emu, midi)) { in snd_emu10k1x_midi_output_trigger()
1441 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT) || in snd_emu10k1x_midi_output_trigger()
1444 spin_unlock_irqrestore(&midi->output_lock, flags); in snd_emu10k1x_midi_output_trigger()
1447 mpu401_write_data(emu, midi, byte); in snd_emu10k1x_midi_output_trigger()
1453 spin_unlock_irqrestore(&midi->output_lock, flags); in snd_emu10k1x_midi_output_trigger()
1454 snd_emu10k1x_intr_enable(emu, midi->tx_enable); in snd_emu10k1x_midi_output_trigger()
1456 snd_emu10k1x_intr_disable(emu, midi->tx_enable); in snd_emu10k1x_midi_output_trigger()
1480 struct emu10k1x_midi *midi = rmidi->private_data; in snd_emu10k1x_midi_free() local
1481 midi->interrupt = NULL; in snd_emu10k1x_midi_free()
1482 midi->rmidi = NULL; in snd_emu10k1x_midi_free()
1486 struct emu10k1x_midi *midi, int device, in emu10k1x_midi_init() argument
1494 midi->emu = emu; in emu10k1x_midi_init()
1495 spin_lock_init(&midi->open_lock); in emu10k1x_midi_init()
1496 spin_lock_init(&midi->input_lock); in emu10k1x_midi_init()
1497 spin_lock_init(&midi->output_lock); in emu10k1x_midi_init()
1504 rmidi->private_data = midi; in emu10k1x_midi_init()
1506 midi->rmidi = rmidi; in emu10k1x_midi_init()
1512 struct emu10k1x_midi *midi = &emu->midi; in snd_emu10k1x_midi() local
1515 if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0) in snd_emu10k1x_midi()
1518 midi->tx_enable = INTE_MIDITXENABLE; in snd_emu10k1x_midi()
1519 midi->rx_enable = INTE_MIDIRXENABLE; in snd_emu10k1x_midi()
1520 midi->port = MUDATA; in snd_emu10k1x_midi()
1521 midi->ipr_tx = IPR_MIDITRANSBUFEMPTY; in snd_emu10k1x_midi()
1522 midi->ipr_rx = IPR_MIDIRECVBUFEMPTY; in snd_emu10k1x_midi()
1523 midi->interrupt = snd_emu10k1x_midi_interrupt; in snd_emu10k1x_midi()