Commit a7b928ac authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[ALSA] rawmidi: add get_port_info callback for sequencer information flags

Add a get_port_info callback to the snd_rawmidi_global_ops structure to
allow the USB MIDI driver to supply information flags for the sequencer
ports created by seq_midi.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent 450047a7
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
struct snd_rawmidi; struct snd_rawmidi;
struct snd_rawmidi_substream; struct snd_rawmidi_substream;
struct snd_seq_port_info;
struct snd_rawmidi_ops { struct snd_rawmidi_ops {
int (*open) (struct snd_rawmidi_substream * substream); int (*open) (struct snd_rawmidi_substream * substream);
...@@ -57,6 +58,8 @@ struct snd_rawmidi_ops { ...@@ -57,6 +58,8 @@ struct snd_rawmidi_ops {
struct snd_rawmidi_global_ops { struct snd_rawmidi_global_ops {
int (*dev_register) (struct snd_rawmidi * rmidi); int (*dev_register) (struct snd_rawmidi * rmidi);
int (*dev_unregister) (struct snd_rawmidi * rmidi); int (*dev_unregister) (struct snd_rawmidi * rmidi);
void (*get_port_info)(struct snd_rawmidi *rmidi, int number,
struct snd_seq_port_info *info);
}; };
struct snd_rawmidi_runtime { struct snd_rawmidi_runtime {
......
...@@ -278,6 +278,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) ...@@ -278,6 +278,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
struct seq_midisynth *msynth, *ms; struct seq_midisynth *msynth, *ms;
struct snd_seq_port_info *port; struct snd_seq_port_info *port;
struct snd_rawmidi_info *info; struct snd_rawmidi_info *info;
struct snd_rawmidi *rmidi = dev->private_data;
int newclient = 0; int newclient = 0;
unsigned int p, ports; unsigned int p, ports;
struct snd_seq_port_callback pcallbacks; struct snd_seq_port_callback pcallbacks;
...@@ -389,6 +390,8 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) ...@@ -389,6 +390,8 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
pcallbacks.unuse = midisynth_unuse; pcallbacks.unuse = midisynth_unuse;
pcallbacks.event_input = event_process_midi; pcallbacks.event_input = event_process_midi;
port->kernel = &pcallbacks; port->kernel = &pcallbacks;
if (rmidi->ops && rmidi->ops->get_port_info)
rmidi->ops->get_port_info(rmidi, p, port);
if (snd_seq_kernel_client_ctl(client->seq_client, SNDRV_SEQ_IOCTL_CREATE_PORT, port)<0) if (snd_seq_kernel_client_ctl(client->seq_client, SNDRV_SEQ_IOCTL_CREATE_PORT, port)<0)
goto __nomem; goto __nomem;
ms->seq_client = client->seq_client; ms->seq_client = client->seq_client;
......
This diff is collapsed.
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