Lines Matching refs:msynth
64 struct seq_midisynth *msynth; in snd_midi_input_event() local
72 msynth = runtime->private_data; in snd_midi_input_event()
73 if (msynth == NULL) in snd_midi_input_event()
80 if (msynth->parser == NULL) in snd_midi_input_event()
84 if (!snd_midi_event_encode_byte(msynth->parser, in snd_midi_input_event()
87 ev.source.port = msynth->seq_port; in snd_midi_input_event()
89 snd_seq_kernel_client_dispatch(msynth->seq_client, &ev, 1, 0); in snd_midi_input_event()
118 struct seq_midisynth *msynth = private_data; in event_process_midi() local
123 if (snd_BUG_ON(!msynth)) in event_process_midi()
125 substream = msynth->output_rfile.output; in event_process_midi()
135 snd_midi_event_reset_decode(msynth->parser); in event_process_midi()
137 if (msynth->parser == NULL) in event_process_midi()
139 len = snd_midi_event_decode(msynth->parser, msg, sizeof(msg), ev); in event_process_midi()
143 snd_midi_event_reset_decode(msynth->parser); in event_process_midi()
149 static int snd_seq_midisynth_new(struct seq_midisynth *msynth, in snd_seq_midisynth_new() argument
154 if (snd_midi_event_new(MAX_MIDI_EVENT_BUF, &msynth->parser) < 0) in snd_seq_midisynth_new()
156 msynth->card = card; in snd_seq_midisynth_new()
157 msynth->device = device; in snd_seq_midisynth_new()
158 msynth->subdevice = subdevice; in snd_seq_midisynth_new()
166 struct seq_midisynth *msynth = private_data; in midisynth_subscribe() local
171 err = snd_rawmidi_kernel_open(msynth->card, msynth->device, in midisynth_subscribe()
172 msynth->subdevice, in midisynth_subscribe()
174 &msynth->input_rfile); in midisynth_subscribe()
179 runtime = msynth->input_rfile.input->runtime; in midisynth_subscribe()
183 err = snd_rawmidi_input_params(msynth->input_rfile.input, ¶ms); in midisynth_subscribe()
185 snd_rawmidi_kernel_release(&msynth->input_rfile); in midisynth_subscribe()
188 snd_midi_event_reset_encode(msynth->parser); in midisynth_subscribe()
190 runtime->private_data = msynth; in midisynth_subscribe()
191 snd_rawmidi_kernel_read(msynth->input_rfile.input, NULL, 0); in midisynth_subscribe()
199 struct seq_midisynth *msynth = private_data; in midisynth_unsubscribe() local
201 if (snd_BUG_ON(!msynth->input_rfile.input)) in midisynth_unsubscribe()
203 err = snd_rawmidi_kernel_release(&msynth->input_rfile); in midisynth_unsubscribe()
211 struct seq_midisynth *msynth = private_data; in midisynth_use() local
215 err = snd_rawmidi_kernel_open(msynth->card, msynth->device, in midisynth_use()
216 msynth->subdevice, in midisynth_use()
218 &msynth->output_rfile); in midisynth_use()
227 err = snd_rawmidi_output_params(msynth->output_rfile.output, ¶ms); in midisynth_use()
229 snd_rawmidi_kernel_release(&msynth->output_rfile); in midisynth_use()
232 snd_midi_event_reset_decode(msynth->parser); in midisynth_use()
239 struct seq_midisynth *msynth = private_data; in midisynth_unuse() local
241 if (snd_BUG_ON(!msynth->output_rfile.output)) in midisynth_unuse()
243 snd_rawmidi_drain_output(msynth->output_rfile.output); in midisynth_unuse()
244 return snd_rawmidi_kernel_release(&msynth->output_rfile); in midisynth_unuse()
248 static void snd_seq_midisynth_delete(struct seq_midisynth *msynth) in snd_seq_midisynth_delete() argument
250 if (msynth == NULL) in snd_seq_midisynth_delete()
253 if (msynth->seq_client > 0) { in snd_seq_midisynth_delete()
255 snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port); in snd_seq_midisynth_delete()
258 snd_midi_event_free(msynth->parser); in snd_seq_midisynth_delete()
267 struct seq_midisynth *msynth, *ms; in snd_seq_midisynth_probe() local
324 msynth = kcalloc(ports, sizeof(struct seq_midisynth), GFP_KERNEL); in snd_seq_midisynth_probe()
326 if (msynth == NULL || port == NULL) in snd_seq_midisynth_probe()
330 ms = &msynth[p]; in snd_seq_midisynth_probe()
391 client->ports[device] = msynth; in snd_seq_midisynth_probe()
401 if (msynth != NULL) { in snd_seq_midisynth_probe()
403 snd_seq_midisynth_delete(&msynth[p]); in snd_seq_midisynth_probe()
404 kfree(msynth); in snd_seq_midisynth_probe()
422 struct seq_midisynth *msynth; in snd_seq_midisynth_remove() local
434 msynth = client->ports[device]; in snd_seq_midisynth_remove()
437 snd_seq_midisynth_delete(&msynth[p]); in snd_seq_midisynth_remove()
438 kfree(msynth); in snd_seq_midisynth_remove()