Lines Matching refs:msynth
65 struct seq_midisynth *msynth; in snd_midi_input_event() local
73 msynth = runtime->private_data; in snd_midi_input_event()
74 if (msynth == NULL) in snd_midi_input_event()
81 if (msynth->parser == NULL) in snd_midi_input_event()
85 if (!snd_midi_event_encode_byte(msynth->parser, in snd_midi_input_event()
88 ev.source.port = msynth->seq_port; in snd_midi_input_event()
90 snd_seq_kernel_client_dispatch(msynth->seq_client, &ev, 1, 0); in snd_midi_input_event()
125 struct seq_midisynth *msynth = private_data; in event_process_midi() local
130 if (snd_BUG_ON(!msynth)) in event_process_midi()
132 substream = msynth->output_rfile.output; in event_process_midi()
142 snd_midi_event_reset_decode(msynth->parser); in event_process_midi()
144 if (msynth->parser == NULL) in event_process_midi()
146 len = snd_midi_event_decode(msynth->parser, msg, sizeof(msg), ev); in event_process_midi()
150 snd_midi_event_reset_decode(msynth->parser); in event_process_midi()
156 static int snd_seq_midisynth_new(struct seq_midisynth *msynth, in snd_seq_midisynth_new() argument
161 if (snd_midi_event_new(MAX_MIDI_EVENT_BUF, &msynth->parser) < 0) in snd_seq_midisynth_new()
163 msynth->card = card; in snd_seq_midisynth_new()
164 msynth->device = device; in snd_seq_midisynth_new()
165 msynth->subdevice = subdevice; in snd_seq_midisynth_new()
173 struct seq_midisynth *msynth = private_data; in midisynth_subscribe() local
178 err = snd_rawmidi_kernel_open(msynth->rmidi, msynth->subdevice, in midisynth_subscribe()
180 &msynth->input_rfile); in midisynth_subscribe()
185 runtime = msynth->input_rfile.input->runtime; in midisynth_subscribe()
189 err = snd_rawmidi_input_params(msynth->input_rfile.input, ¶ms); in midisynth_subscribe()
191 snd_rawmidi_kernel_release(&msynth->input_rfile); in midisynth_subscribe()
194 snd_midi_event_reset_encode(msynth->parser); in midisynth_subscribe()
196 runtime->private_data = msynth; in midisynth_subscribe()
197 snd_rawmidi_kernel_read(msynth->input_rfile.input, NULL, 0); in midisynth_subscribe()
205 struct seq_midisynth *msynth = private_data; in midisynth_unsubscribe() local
207 if (snd_BUG_ON(!msynth->input_rfile.input)) in midisynth_unsubscribe()
209 err = snd_rawmidi_kernel_release(&msynth->input_rfile); in midisynth_unsubscribe()
217 struct seq_midisynth *msynth = private_data; in midisynth_use() local
221 err = snd_rawmidi_kernel_open(msynth->rmidi, msynth->subdevice, in midisynth_use()
223 &msynth->output_rfile); in midisynth_use()
232 err = snd_rawmidi_output_params(msynth->output_rfile.output, ¶ms); in midisynth_use()
234 snd_rawmidi_kernel_release(&msynth->output_rfile); in midisynth_use()
237 snd_midi_event_reset_decode(msynth->parser); in midisynth_use()
244 struct seq_midisynth *msynth = private_data; in midisynth_unuse() local
246 if (snd_BUG_ON(!msynth->output_rfile.output)) in midisynth_unuse()
248 snd_rawmidi_drain_output(msynth->output_rfile.output); in midisynth_unuse()
249 return snd_rawmidi_kernel_release(&msynth->output_rfile); in midisynth_unuse()
253 static void snd_seq_midisynth_delete(struct seq_midisynth *msynth) in snd_seq_midisynth_delete() argument
255 if (msynth == NULL) in snd_seq_midisynth_delete()
258 if (msynth->seq_client > 0) { in snd_seq_midisynth_delete()
260 snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port); in snd_seq_midisynth_delete()
263 snd_midi_event_free(msynth->parser); in snd_seq_midisynth_delete()
272 struct seq_midisynth *msynth, *ms; in snd_seq_midisynth_probe() local
322 msynth = kcalloc(ports, sizeof(struct seq_midisynth), GFP_KERNEL); in snd_seq_midisynth_probe()
324 if (msynth == NULL || port == NULL) in snd_seq_midisynth_probe()
328 ms = &msynth[p]; in snd_seq_midisynth_probe()
394 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()
419 struct seq_midisynth *msynth; in snd_seq_midisynth_remove() local
429 msynth = client->ports[device]; in snd_seq_midisynth_remove()
432 snd_seq_midisynth_delete(&msynth[p]); in snd_seq_midisynth_remove()
433 kfree(msynth); in snd_seq_midisynth_remove()