}
else if ((uart->filemode & SERIAL_MODE_INPUT_OPEN) && (uart->midi_input[substream] != NULL)) {
snd_rawmidi_receive(uart->midi_input[substream], &c, 1);
- }
+ }
} else if ((uart->filemode & SERIAL_MODE_INPUT_OPEN) && (uart->midi_input[substream] != NULL)) {
snd_rawmidi_receive(uart->midi_input[substream], &c, 1);
}
/* When the polling mode, this function calls snd_uart16550_io_loop. */
static void snd_uart16550_buffer_timer(unsigned long data)
{
+ unsigned long flags;
snd_uart16550_t *uart;
uart = (snd_uart16550_t *)data;
- spin_lock(&uart->open_lock);
+ spin_lock_irqsave(&uart->open_lock, flags);
snd_uart16550_del_timer(uart);
snd_uart16550_io_loop(uart);
- spin_unlock(&uart->open_lock);
+ spin_unlock_irqrestore(&uart->open_lock, flags);
}
/*
return 0;
}
+static void __init snd_uart16550_substreams(snd_rawmidi_str_t *stream)
+{
+ struct list_head *list;
+
+ list_for_each(list, &stream->substreams) {
+ snd_rawmidi_substream_t *substream = list_entry(list, snd_rawmidi_substream_t, list);
+ sprintf(substream->name, "Serial MIDI %d", substream->number + 1);
+ }
+}
+
static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, snd_rawmidi_t **rmidi)
{
snd_rawmidi_t *rrawmidi;
return err;
snd_rawmidi_set_ops(rrawmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_uart16550_input);
snd_rawmidi_set_ops(rrawmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_uart16550_output);
- sprintf(rrawmidi->name, "uart16550 MIDI #%d", device);
+ strcpy(rrawmidi->name, "Serial MIDI");
+ snd_uart16550_substreams(&rrawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]);
+ snd_uart16550_substreams(&rrawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]);
rrawmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
SNDRV_RAWMIDI_INFO_INPUT |
SNDRV_RAWMIDI_INFO_DUPLEX;
return -ENOMEM;
strcpy(card->driver, "Serial");
- strcpy(card->shortname, "Serial midi (uart16550A)");
+ strcpy(card->shortname, "Serial MIDI (UART16550A)");
if ((err = snd_uart16550_create(card,
port[dev],