Commit 7af96d58 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] add port names for serial MIDI ports

Generic drivers
Give each of the MIDI ports created by snd-serial-u16550
a unique name.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent 62d2146d
......@@ -840,6 +840,16 @@ static int __init snd_uart16550_create(snd_card_t * card,
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;
......@@ -849,7 +859,9 @@ static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int out
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;
......@@ -906,7 +918,7 @@ static int __init snd_serial_probe(int dev)
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],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment