diff options
Diffstat (limited to 'sound/usb/caiaq/midi.c')
-rw-r--r-- | sound/usb/caiaq/midi.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c index 8fa8cd88d763..538e8c00d31a 100644 --- a/sound/usb/caiaq/midi.c +++ b/sound/usb/caiaq/midi.c | |||
@@ -40,7 +40,7 @@ static void snd_usb_caiaq_midi_input_trigger(struct snd_rawmidi_substream *subst | |||
40 | 40 | ||
41 | if (!dev) | 41 | if (!dev) |
42 | return; | 42 | return; |
43 | 43 | ||
44 | dev->midi_receive_substream = up ? substream : NULL; | 44 | dev->midi_receive_substream = up ? substream : NULL; |
45 | } | 45 | } |
46 | 46 | ||
@@ -64,18 +64,18 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, | |||
64 | struct snd_rawmidi_substream *substream) | 64 | struct snd_rawmidi_substream *substream) |
65 | { | 65 | { |
66 | int len, ret; | 66 | int len, ret; |
67 | 67 | ||
68 | dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; | 68 | dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; |
69 | dev->midi_out_buf[1] = 0; /* port */ | 69 | dev->midi_out_buf[1] = 0; /* port */ |
70 | len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3, | 70 | len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3, |
71 | EP1_BUFSIZE - 3); | 71 | EP1_BUFSIZE - 3); |
72 | 72 | ||
73 | if (len <= 0) | 73 | if (len <= 0) |
74 | return; | 74 | return; |
75 | 75 | ||
76 | dev->midi_out_buf[2] = len; | 76 | dev->midi_out_buf[2] = len; |
77 | dev->midi_out_urb.transfer_buffer_length = len+3; | 77 | dev->midi_out_urb.transfer_buffer_length = len+3; |
78 | 78 | ||
79 | ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); | 79 | ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); |
80 | if (ret < 0) | 80 | if (ret < 0) |
81 | log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed," | 81 | log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed," |
@@ -88,7 +88,7 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, | |||
88 | static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) | 88 | static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
89 | { | 89 | { |
90 | struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; | 90 | struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; |
91 | 91 | ||
92 | if (up) { | 92 | if (up) { |
93 | dev->midi_out_substream = substream; | 93 | dev->midi_out_substream = substream; |
94 | if (!dev->midi_out_active) | 94 | if (!dev->midi_out_active) |
@@ -113,12 +113,12 @@ static struct snd_rawmidi_ops snd_usb_caiaq_midi_input = | |||
113 | .trigger = snd_usb_caiaq_midi_input_trigger, | 113 | .trigger = snd_usb_caiaq_midi_input_trigger, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | void snd_usb_caiaq_midi_handle_input(struct snd_usb_caiaqdev *dev, | 116 | void snd_usb_caiaq_midi_handle_input(struct snd_usb_caiaqdev *dev, |
117 | int port, const char *buf, int len) | 117 | int port, const char *buf, int len) |
118 | { | 118 | { |
119 | if (!dev->midi_receive_substream) | 119 | if (!dev->midi_receive_substream) |
120 | return; | 120 | return; |
121 | 121 | ||
122 | snd_rawmidi_receive(dev->midi_receive_substream, buf, len); | 122 | snd_rawmidi_receive(dev->midi_receive_substream, buf, len); |
123 | } | 123 | } |
124 | 124 | ||
@@ -142,16 +142,16 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) | |||
142 | 142 | ||
143 | if (device->spec.num_midi_out > 0) { | 143 | if (device->spec.num_midi_out > 0) { |
144 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; | 144 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; |
145 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, | 145 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, |
146 | &snd_usb_caiaq_midi_output); | 146 | &snd_usb_caiaq_midi_output); |
147 | } | 147 | } |
148 | 148 | ||
149 | if (device->spec.num_midi_in > 0) { | 149 | if (device->spec.num_midi_in > 0) { |
150 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; | 150 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; |
151 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, | 151 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, |
152 | &snd_usb_caiaq_midi_input); | 152 | &snd_usb_caiaq_midi_input); |
153 | } | 153 | } |
154 | 154 | ||
155 | device->rmidi = rmidi; | 155 | device->rmidi = rmidi; |
156 | 156 | ||
157 | return 0; | 157 | return 0; |
@@ -160,7 +160,7 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) | |||
160 | void snd_usb_caiaq_midi_output_done(struct urb* urb) | 160 | void snd_usb_caiaq_midi_output_done(struct urb* urb) |
161 | { | 161 | { |
162 | struct snd_usb_caiaqdev *dev = urb->context; | 162 | struct snd_usb_caiaqdev *dev = urb->context; |
163 | 163 | ||
164 | dev->midi_out_active = 0; | 164 | dev->midi_out_active = 0; |
165 | if (urb->status != 0) | 165 | if (urb->status != 0) |
166 | return; | 166 | return; |