diff options
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r-- | drivers/staging/line6/Kconfig | 10 | ||||
-rw-r--r-- | drivers/staging/line6/capture.c | 10 | ||||
-rw-r--r-- | drivers/staging/line6/driver.c | 86 | ||||
-rw-r--r-- | drivers/staging/line6/driver.h | 13 | ||||
-rw-r--r-- | drivers/staging/line6/midi.c | 2 | ||||
-rw-r--r-- | drivers/staging/line6/midi.h | 4 | ||||
-rw-r--r-- | drivers/staging/line6/midibuf.c | 25 | ||||
-rw-r--r-- | drivers/staging/line6/midibuf.h | 22 | ||||
-rw-r--r-- | drivers/staging/line6/pcm.c | 36 | ||||
-rw-r--r-- | drivers/staging/line6/playback.c | 9 | ||||
-rw-r--r-- | drivers/staging/line6/pod.c | 105 | ||||
-rw-r--r-- | drivers/staging/line6/toneport.c | 6 | ||||
-rw-r--r-- | drivers/staging/line6/variax.c | 14 |
13 files changed, 81 insertions, 261 deletions
diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig index b63543658b2e..4f1219b4c692 100644 --- a/drivers/staging/line6/Kconfig +++ b/drivers/staging/line6/Kconfig @@ -23,16 +23,6 @@ menuconfig LINE6_USB if LINE6_USB -config LINE6_USB_DUMP_PCM - bool "dump PCM data" - default n - help - Say Y here to write PCM data sent to and received from Line6 - devices to the syslog. This will produce a huge amount of - syslog data during playback and capture. - - If unsure, say N. - config LINE6_USB_IMPULSE_RESPONSE bool "measure impulse response" default n diff --git a/drivers/staging/line6/capture.c b/drivers/staging/line6/capture.c index 389c41fd1b74..f8316b71f13d 100644 --- a/drivers/staging/line6/capture.c +++ b/drivers/staging/line6/capture.c @@ -216,16 +216,6 @@ static void audio_in_callback(struct urb *urb) if (urb == line6pcm->urb_audio_in[index]) break; -#ifdef CONFIG_LINE6_USB_DUMP_PCM - for (i = 0; i < LINE6_ISO_PACKETS; ++i) { - struct usb_iso_packet_descriptor *fout = - &urb->iso_frame_desc[i]; - line6_write_hexdump(line6pcm->line6, 'C', - urb->transfer_buffer + fout->offset, - fout->length); - } -#endif - spin_lock_irqsave(&line6pcm->lock_audio_in, flags); for (i = 0; i < LINE6_ISO_PACKETS; ++i) { diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index 1e4ce50069a9..6252aca82866 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -135,47 +135,6 @@ static void line6_stop_listen(struct usb_line6 *line6) usb_kill_urb(line6->urb_listen); } -#ifdef CONFIG_LINE6_USB_DUMP_ANY -/* - Write hexdump to syslog. -*/ -void line6_write_hexdump(struct usb_line6 *line6, char dir, - const unsigned char *buffer, int size) -{ - static const int BYTES_PER_LINE = 8; - char hexdump[100]; - char asc[BYTES_PER_LINE + 1]; - int i, j; - - for (i = 0; i < size; i += BYTES_PER_LINE) { - int hexdumpsize = sizeof(hexdump); - char *p = hexdump; - int n = min(size - i, BYTES_PER_LINE); - asc[n] = 0; - - for (j = 0; j < BYTES_PER_LINE; ++j) { - int bytes; - - if (j < n) { - unsigned char val = buffer[i + j]; - bytes = snprintf(p, hexdumpsize, " %02X", val); - asc[j] = ((val >= 0x20) - && (val < 0x7f)) ? val : '.'; - } else - bytes = snprintf(p, hexdumpsize, " "); - - if (bytes > hexdumpsize) - break; /* buffer overflow */ - - p += bytes; - hexdumpsize -= bytes; - } - - dev_info(line6->ifcdev, "%c%04X:%s %s\n", dir, i, hexdump, asc); - } -} -#endif - /* Send raw message in pieces of wMaxPacketSize bytes. */ @@ -274,11 +233,8 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, /* create message: */ msg = kmalloc(sizeof(struct message), GFP_ATOMIC); - - if (msg == NULL) { - dev_err(line6->ifcdev, "Out of memory\n"); + if (msg == NULL) return -ENOMEM; - } /* create URB: */ urb = usb_alloc_urb(0, GFP_ATOMIC); @@ -307,14 +263,13 @@ int line6_version_request_async(struct usb_line6 *line6) char *buffer; int retval; - buffer = kmalloc(sizeof(line6_request_version), GFP_ATOMIC); + buffer = kmemdup(line6_request_version, + sizeof(line6_request_version), GFP_ATOMIC); if (buffer == NULL) { dev_err(line6->ifcdev, "Out of memory"); return -ENOMEM; } - memcpy(buffer, line6_request_version, sizeof(line6_request_version)); - retval = line6_send_raw_message_async(line6, buffer, sizeof(line6_request_version)); kfree(buffer); @@ -333,17 +288,6 @@ int line6_send_sysex_message(struct usb_line6 *line6, const char *buffer, } /* - Send sysex message in pieces of wMaxPacketSize bytes. -*/ -int line6_send_sysex_message_async(struct usb_line6 *line6, const char *buffer, - int size) -{ - return line6_send_raw_message_async(line6, buffer, - size + SYSEX_EXTRA_SIZE) - - SYSEX_EXTRA_SIZE; -} - -/* Allocate buffer for sysex message and prepare header. @param code sysex message code @param size number of bytes between code and sysex end @@ -353,10 +297,8 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, { char *buffer = kmalloc(size + SYSEX_EXTRA_SIZE, GFP_ATOMIC); - if (!buffer) { - dev_err(line6->ifcdev, "out of memory\n"); + if (!buffer) return NULL; - } buffer[0] = LINE6_SYSEX_BEGIN; memcpy(buffer + 1, line6_midi_id, sizeof(line6_midi_id)); @@ -372,7 +314,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, static void line6_data_received(struct urb *urb) { struct usb_line6 *line6 = (struct usb_line6 *)urb->context; - struct MidiBuffer *mb = &line6->line6midi->midibuf_in; + struct midi_buffer *mb = &line6->line6midi->midibuf_in; int done; if (urb->status == -ESHUTDOWN) @@ -456,11 +398,8 @@ int line6_send_program(struct usb_line6 *line6, u8 value) int partial; buffer = kmalloc(2, GFP_KERNEL); - - if (!buffer) { - dev_err(line6->ifcdev, "out of memory\n"); + if (!buffer) return -ENOMEM; - } buffer[0] = LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST; buffer[1] = value; @@ -488,11 +427,8 @@ int line6_transmit_parameter(struct usb_line6 *line6, int param, u8 value) int partial; buffer = kmalloc(3, GFP_KERNEL); - - if (!buffer) { - dev_err(line6->ifcdev, "out of memory\n"); + if (!buffer) return -ENOMEM; - } buffer[0] = LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST; buffer[1] = param; @@ -532,7 +468,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, return ret; } - /* Wait for data length. We'll get a couple of 0xff until length arrives. */ + /* Wait for data length. We'll get 0xff until length arrives. */ do { ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | @@ -887,9 +823,7 @@ static int line6_probe(struct usb_interface *interface, } line6 = kzalloc(size, GFP_KERNEL); - if (line6 == NULL) { - dev_err(&interface->dev, "Out of memory\n"); ret = -ENODEV; goto err_put; } @@ -928,18 +862,14 @@ static int line6_probe(struct usb_interface *interface, /* initialize USB buffers: */ line6->buffer_listen = kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL); - if (line6->buffer_listen == NULL) { - dev_err(&interface->dev, "Out of memory\n"); ret = -ENOMEM; goto err_destruct; } line6->buffer_message = kmalloc(LINE6_MESSAGE_MAXLEN, GFP_KERNEL); - if (line6->buffer_message == NULL) { - dev_err(&interface->dev, "Out of memory\n"); ret = -ENOMEM; goto err_destruct; } diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h index f0be5a2adaba..a8341f9fdb98 100644 --- a/drivers/staging/line6/driver.h +++ b/drivers/staging/line6/driver.h @@ -20,10 +20,6 @@ #define DRIVER_NAME "line6usb" -#if defined(CONFIG_LINE6_USB_DUMP_PCM) -#define CONFIG_LINE6_USB_DUMP_ANY -#endif - #define LINE6_TIMEOUT 1 #define LINE6_BUFSIZE_LISTEN 32 #define LINE6_MESSAGE_MAXLEN 256 @@ -53,7 +49,7 @@ #define LINE6_CHANNEL_MASK 0x0f #define MISSING_CASE \ - printk(KERN_ERR "line6usb driver bug: missing case in %s:%d\n", \ + pr_err("line6usb driver bug: missing case in %s:%d\n", \ __FILE__, __LINE__) #define CHECK_RETURN(x) \ @@ -208,8 +204,6 @@ extern int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, int size); extern int line6_send_sysex_message(struct usb_line6 *line6, const char *buffer, int size); -extern int line6_send_sysex_message_async(struct usb_line6 *line6, - const char *buffer, int size); extern ssize_t line6_set_raw(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); extern void line6_start_timer(struct timer_list *timer, unsigned int msecs, @@ -221,9 +215,4 @@ extern int line6_version_request_async(struct usb_line6 *line6); extern int line6_write_data(struct usb_line6 *line6, int address, void *data, size_t datalen); -#ifdef CONFIG_LINE6_USB_DUMP_ANY -extern void line6_write_hexdump(struct usb_line6 *line6, char dir, - const unsigned char *buffer, int size); -#endif - #endif diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c index 6982eca661bd..e3f9a53dbd96 100644 --- a/drivers/staging/line6/midi.c +++ b/drivers/staging/line6/midi.c @@ -45,7 +45,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream) struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6; struct snd_line6_midi *line6midi = line6->line6midi; - struct MidiBuffer *mb = &line6midi->midibuf_out; + struct midi_buffer *mb = &line6midi->midibuf_out; unsigned long flags; unsigned char chunk[line6->max_packet_size]; int req, done; diff --git a/drivers/staging/line6/midi.h b/drivers/staging/line6/midi.h index 19dabd54051a..78f903fb4d41 100644 --- a/drivers/staging/line6/midi.h +++ b/drivers/staging/line6/midi.h @@ -57,12 +57,12 @@ struct snd_line6_midi { /** Buffer for incoming MIDI stream. */ - struct MidiBuffer midibuf_in; + struct midi_buffer midibuf_in; /** Buffer for outgoing MIDI stream. */ - struct MidiBuffer midibuf_out; + struct midi_buffer midibuf_out; }; extern int line6_init_midi(struct usb_line6 *line6); diff --git a/drivers/staging/line6/midibuf.c b/drivers/staging/line6/midibuf.c index 968e0de83dab..f0adb7baa603 100644 --- a/drivers/staging/line6/midibuf.c +++ b/drivers/staging/line6/midibuf.c @@ -33,23 +33,23 @@ static int midibuf_message_length(unsigned char code) } } -static int midibuf_is_empty(struct MidiBuffer *this) +static int midibuf_is_empty(struct midi_buffer *this) { return (this->pos_read == this->pos_write) && !this->full; } -static int midibuf_is_full(struct MidiBuffer *this) +static int midibuf_is_full(struct midi_buffer *this) { return this->full; } -void line6_midibuf_reset(struct MidiBuffer *this) +void line6_midibuf_reset(struct midi_buffer *this) { this->pos_read = this->pos_write = this->full = 0; this->command_prev = -1; } -int line6_midibuf_init(struct MidiBuffer *this, int size, int split) +int line6_midibuf_init(struct midi_buffer *this, int size, int split) { this->buf = kmalloc(size, GFP_KERNEL); @@ -62,14 +62,14 @@ int line6_midibuf_init(struct MidiBuffer *this, int size, int split) return 0; } -void line6_midibuf_status(struct MidiBuffer *this) +void line6_midibuf_status(struct midi_buffer *this) { pr_debug("midibuf size=%d split=%d pos_read=%d pos_write=%d full=%d command_prev=%02x\n", this->size, this->split, this->pos_read, this->pos_write, this->full, this->command_prev); } -int line6_midibuf_bytes_free(struct MidiBuffer *this) +int line6_midibuf_bytes_free(struct midi_buffer *this) { return midibuf_is_full(this) ? @@ -78,7 +78,7 @@ int line6_midibuf_bytes_free(struct MidiBuffer *this) 1; } -int line6_midibuf_bytes_used(struct MidiBuffer *this) +int line6_midibuf_bytes_used(struct midi_buffer *this) { return midibuf_is_empty(this) ? @@ -87,7 +87,7 @@ int line6_midibuf_bytes_used(struct MidiBuffer *this) 1; } -int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data, +int line6_midibuf_write(struct midi_buffer *this, unsigned char *data, int length) { int bytes_free; @@ -130,7 +130,8 @@ int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data, return length + skip_active_sense; } -int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length) +int line6_midibuf_read(struct midi_buffer *this, unsigned char *data, + int length) { int bytes_used; int length1, length2; @@ -234,7 +235,7 @@ int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length) return length + repeat; } -int line6_midibuf_ignore(struct MidiBuffer *this, int length) +int line6_midibuf_ignore(struct midi_buffer *this, int length) { int bytes_used = line6_midibuf_bytes_used(this); @@ -246,7 +247,7 @@ int line6_midibuf_ignore(struct MidiBuffer *this, int length) return length; } -int line6_midibuf_skip_message(struct MidiBuffer *this, unsigned short mask) +int line6_midibuf_skip_message(struct midi_buffer *this, unsigned short mask) { int cmd = this->command_prev; @@ -257,7 +258,7 @@ int line6_midibuf_skip_message(struct MidiBuffer *this, unsigned short mask) return 0; } -void line6_midibuf_destroy(struct MidiBuffer *this) +void line6_midibuf_destroy(struct midi_buffer *this) { kfree(this->buf); this->buf = NULL; diff --git a/drivers/staging/line6/midibuf.h b/drivers/staging/line6/midibuf.h index 444cb3a12d72..707482b940e4 100644 --- a/drivers/staging/line6/midibuf.h +++ b/drivers/staging/line6/midibuf.h @@ -12,7 +12,7 @@ #ifndef MIDIBUF_H #define MIDIBUF_H -struct MidiBuffer { +struct midi_buffer { unsigned char *buf; int size; int split; @@ -21,18 +21,18 @@ struct MidiBuffer { int command_prev; }; -extern int line6_midibuf_bytes_used(struct MidiBuffer *mb); -extern int line6_midibuf_bytes_free(struct MidiBuffer *mb); -extern void line6_midibuf_destroy(struct MidiBuffer *mb); -extern int line6_midibuf_ignore(struct MidiBuffer *mb, int length); -extern int line6_midibuf_init(struct MidiBuffer *mb, int size, int split); -extern int line6_midibuf_read(struct MidiBuffer *mb, unsigned char *data, +extern int line6_midibuf_bytes_used(struct midi_buffer *mb); +extern int line6_midibuf_bytes_free(struct midi_buffer *mb); +extern void line6_midibuf_destroy(struct midi_buffer *mb); +extern int line6_midibuf_ignore(struct midi_buffer *mb, int length); +extern int line6_midibuf_init(struct midi_buffer *mb, int size, int split); +extern int line6_midibuf_read(struct midi_buffer *mb, unsigned char *data, int length); -extern void line6_midibuf_reset(struct MidiBuffer *mb); -extern int line6_midibuf_skip_message(struct MidiBuffer *mb, +extern void line6_midibuf_reset(struct midi_buffer *mb); +extern int line6_midibuf_skip_message(struct midi_buffer *mb, unsigned short mask); -extern void line6_midibuf_status(struct MidiBuffer *mb); -extern int line6_midibuf_write(struct MidiBuffer *mb, unsigned char *data, +extern void line6_midibuf_status(struct midi_buffer *mb); +extern int line6_midibuf_write(struct midi_buffer *mb, unsigned char *data, int length); #endif diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c index 6c1e31335d19..02f77d74809f 100644 --- a/drivers/staging/line6/pcm.c +++ b/drivers/staging/line6/pcm.c @@ -49,11 +49,11 @@ static ssize_t pcm_set_impulse_volume(struct device *dev, { struct snd_line6_pcm *line6pcm = dev2pcm(dev); int value; - int rv; + int ret; - rv = kstrtoint(buf, 10, &value); - if (rv < 0) - return rv; + ret = kstrtoint(buf, 10, &value); + if (ret < 0) + return ret; line6pcm->impulse_volume = value; @@ -81,7 +81,14 @@ static ssize_t pcm_set_impulse_period(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - dev2pcm(dev)->impulse_period = simple_strtoul(buf, NULL, 10); + int value; + int ret; + + ret = kstrtoint(buf, 10, &value); + if (ret < 0) + return ret; + + dev2pcm(dev)->impulse_period = value; return count; } @@ -114,10 +121,7 @@ int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int channels) line6pcm->buffer_in = kmalloc(LINE6_ISO_BUFFERS * LINE6_ISO_PACKETS * line6pcm->max_packet_size, GFP_KERNEL); - if (!line6pcm->buffer_in) { - dev_err(line6pcm->line6->ifcdev, - "cannot malloc capture buffer\n"); err = -ENOMEM; goto pcm_acquire_error; } @@ -153,10 +157,7 @@ int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int channels) line6pcm->buffer_out = kmalloc(LINE6_ISO_BUFFERS * LINE6_ISO_PACKETS * line6pcm->max_packet_size, GFP_KERNEL); - if (!line6pcm->buffer_out) { - dev_err(line6pcm->line6->ifcdev, - "cannot malloc playback buffer\n"); err = -ENOMEM; goto pcm_acquire_error; } @@ -455,13 +456,12 @@ int line6_init_pcm(struct usb_line6 *line6, ep_write = 0x01; break; - /* this is for interface_number == 1: - case LINE6_DEVID_TONEPORT_UX2: - case LINE6_DEVID_PODSTUDIO_UX2: - ep_read = 0x87; - ep_write = 0x00; - break; - */ + /* this is for interface_number == 1: + case LINE6_DEVID_TONEPORT_UX2: + case LINE6_DEVID_PODSTUDIO_UX2: + ep_read = 0x87; + ep_write = 0x00; + break; */ default: MISSING_CASE; diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c index 4cf23af9c627..f9135c7cb195 100644 --- a/drivers/staging/line6/playback.c +++ b/drivers/staging/line6/playback.c @@ -264,15 +264,6 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) } #endif } -#ifdef CONFIG_LINE6_USB_DUMP_PCM - for (i = 0; i < LINE6_ISO_PACKETS; ++i) { - struct usb_iso_packet_descriptor *fout = - &urb_out->iso_frame_desc[i]; - line6_write_hexdump(line6pcm->line6, 'P', - urb_out->transfer_buffer + fout->offset, - fout->length); - } -#endif ret = usb_submit_urb(urb_out, GFP_ATOMIC); diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index e542540d0db3..74898c3c9f90 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -34,12 +34,14 @@ enum { POD_SYSEX_DUMPMEM = 0x73, POD_SYSEX_DUMP = 0x74, POD_SYSEX_DUMPREQ = 0x75 - /* POD_SYSEX_DUMPMEM2 = 0x76 */ /* dumps entire internal memory of PODxt Pro */ + + /* dumps entire internal memory of PODxt Pro */ + /* POD_SYSEX_DUMPMEM2 = 0x76 */ }; enum { - POD_monitor_level = 0x04, - POD_system_invalid = 0x10000 + POD_MONITOR_LEVEL = 0x04, + POD_SYSTEM_INVALID = 0x10000 }; /* *INDENT-ON* */ @@ -133,84 +135,27 @@ void line6_pod_process_message(struct usb_line6_pod *pod) { const unsigned char *buf = pod->line6.buffer_message; - /* filter messages by type */ - switch (buf[0] & 0xf0) { - case LINE6_PARAM_CHANGE: - case LINE6_PROGRAM_CHANGE: - case LINE6_SYSEX_BEGIN: - break; /* handle these further down */ + if (memcmp(buf, pod_version_header, sizeof(pod_version_header)) == 0) { + pod->firmware_version = buf[13] * 100 + buf[14] * 10 + buf[15]; + pod->device_id = ((int)buf[8] << 16) | ((int)buf[9] << 8) | + (int) buf[10]; + pod_startup3(pod); + return; + } - default: - return; /* ignore all others */ + /* Only look for sysex messages from this device */ + if (buf[0] != (LINE6_SYSEX_BEGIN | LINE6_CHANNEL_DEVICE) && + buf[0] != (LINE6_SYSEX_BEGIN | LINE6_CHANNEL_UNKNOWN)) { + return; + } + if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) != 0) { + return; } - /* process all remaining messages */ - switch (buf[0]) { - case LINE6_PARAM_CHANGE | LINE6_CHANNEL_DEVICE: - case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - break; - - case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: - case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - break; - - case LINE6_SYSEX_BEGIN | LINE6_CHANNEL_DEVICE: - case LINE6_SYSEX_BEGIN | LINE6_CHANNEL_UNKNOWN: - if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { - switch (buf[5]) { - case POD_SYSEX_DUMP: - break; - - case POD_SYSEX_SYSTEM:{ - short value = - ((int)buf[7] << 12) | ((int)buf[8] - << 8) | - ((int)buf[9] << 4) | (int)buf[10]; - - if (buf[6] == POD_monitor_level) - pod->monitor_level = value; - break; - } - - case POD_SYSEX_FINISH: - /* do we need to respond to this? */ - break; - - case POD_SYSEX_SAVE: - break; - - case POD_SYSEX_STORE: - dev_dbg(pod->line6.ifcdev, - "message %02X not yet implemented\n", - buf[5]); - break; - - default: - dev_dbg(pod->line6.ifcdev, - "unknown sysex message %02X\n", - buf[5]); - } - } else - if (memcmp - (buf, pod_version_header, - sizeof(pod_version_header)) == 0) { - pod->firmware_version = - buf[13] * 100 + buf[14] * 10 + buf[15]; - pod->device_id = - ((int)buf[8] << 16) | ((int)buf[9] << 8) | (int) - buf[10]; - pod_startup3(pod); - } else - dev_dbg(pod->line6.ifcdev, "unknown sysex header\n"); - - break; - - case LINE6_SYSEX_END: - break; - - default: - dev_dbg(pod->line6.ifcdev, "POD: unknown message %02X\n", - buf[0]); + if (buf[5] == POD_SYSEX_SYSTEM && buf[6] == POD_MONITOR_LEVEL) { + short value = ((int)buf[7] << 12) | ((int)buf[8] << 8) | + ((int)buf[9] << 4) | (int)buf[10]; + pod->monitor_level = value; } } @@ -369,7 +314,7 @@ static int snd_pod_control_monitor_put(struct snd_kcontrol *kcontrol, pod->monitor_level = ucontrol->value.integer.value[0]; pod_set_system_param_int(pod, ucontrol->value.integer.value[0], - POD_monitor_level); + POD_MONITOR_LEVEL); return 1; } @@ -460,7 +405,7 @@ static int pod_try_init(struct usb_interface *interface, */ if (pod->line6.properties->capabilities & LINE6_BIT_CONTROL) { - pod->monitor_level = POD_system_invalid; + pod->monitor_level = POD_SYSTEM_INVALID; /* initiate startup procedure: */ pod_startup1(pod); diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index a529dd3d604e..2f44d56700af 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c @@ -87,12 +87,10 @@ static struct line6_pcm_properties toneport_pcm_properties = { static int led_red = 0x00; static int led_green = 0x26; -struct ToneportSourceInfo { +static const struct { const char *name; int code; -}; - -static const struct ToneportSourceInfo toneport_source_info[] = { +} toneport_source_info[] = { {"Microphone", 0x0a01}, {"Line", 0x0801}, {"Instrument", 0x0b01}, diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 4fca58f11245..bd0f694fa8d8 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -133,13 +133,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) const unsigned char *buf = variax->line6.buffer_message; switch (buf[0]) { - case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - break; - - case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: - case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - break; - case LINE6_RESET: dev_info(variax->line6.ifcdev, "VARIAX reset\n"); break; @@ -154,13 +147,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) variax_startup4((unsigned long)variax); } break; - - case LINE6_SYSEX_END: - break; - - default: - dev_dbg(variax->line6.ifcdev, - "Variax: unknown message %02X\n", buf[0]); } } |