diff options
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r-- | drivers/staging/line6/Kconfig | 37 | ||||
-rw-r--r-- | drivers/staging/line6/Makefile | 2 | ||||
-rw-r--r-- | drivers/staging/line6/audio.c | 8 | ||||
-rw-r--r-- | drivers/staging/line6/capture.c | 13 | ||||
-rw-r--r-- | drivers/staging/line6/control.c | 995 | ||||
-rw-r--r-- | drivers/staging/line6/control.h | 195 | ||||
-rw-r--r-- | drivers/staging/line6/driver.c | 85 | ||||
-rw-r--r-- | drivers/staging/line6/driver.h | 10 | ||||
-rw-r--r-- | drivers/staging/line6/dumprequest.c | 135 | ||||
-rw-r--r-- | drivers/staging/line6/dumprequest.h | 76 | ||||
-rw-r--r-- | drivers/staging/line6/midi.c | 126 | ||||
-rw-r--r-- | drivers/staging/line6/midi.h | 10 | ||||
-rw-r--r-- | drivers/staging/line6/midibuf.c | 6 | ||||
-rw-r--r-- | drivers/staging/line6/pcm.c | 4 | ||||
-rw-r--r-- | drivers/staging/line6/pcm.h | 2 | ||||
-rw-r--r-- | drivers/staging/line6/playback.c | 17 | ||||
-rw-r--r-- | drivers/staging/line6/pod.c | 879 | ||||
-rw-r--r-- | drivers/staging/line6/pod.h | 105 | ||||
-rw-r--r-- | drivers/staging/line6/toneport.c | 8 | ||||
-rw-r--r-- | drivers/staging/line6/usbdefs.h | 10 | ||||
-rw-r--r-- | drivers/staging/line6/variax.c | 484 | ||||
-rw-r--r-- | drivers/staging/line6/variax.h | 60 |
22 files changed, 67 insertions, 3200 deletions
diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig index 43120ff..b635436 100644 --- a/drivers/staging/line6/Kconfig +++ b/drivers/staging/line6/Kconfig @@ -23,32 +23,6 @@ menuconfig LINE6_USB if LINE6_USB -config LINE6_USB_DEBUG - bool "print debug messages" - default n - help - Say Y here to write debug messages to the syslog. - - If unsure, say N. - -config LINE6_USB_DUMP_CTRL - bool "dump control messages" - default n - help - Say Y here to write control messages sent to and received from - Line6 devices to the syslog. - - If unsure, say N. - -config LINE6_USB_DUMP_MIDI - bool "dump MIDI messages" - default n - help - Say Y here to write MIDI messages sent to and received from - Line6 devices to the syslog. - - If unsure, say N. - config LINE6_USB_DUMP_PCM bool "dump PCM data" default n @@ -59,17 +33,6 @@ config LINE6_USB_DUMP_PCM If unsure, say N. -config LINE6_USB_RAW - bool "raw data communication" - default n - help - Say Y here to create special files which allow to send raw data - to the device. This bypasses any sanity checks, so if you discover - the code to erase the firmware, feel free to render your device - useless, but only after reading the GPL section "NO WARRANTY". - - If unsure, say N. - config LINE6_USB_IMPULSE_RESPONSE bool "measure impulse response" default n diff --git a/drivers/staging/line6/Makefile b/drivers/staging/line6/Makefile index 34a2dda..ae5c374 100644 --- a/drivers/staging/line6/Makefile +++ b/drivers/staging/line6/Makefile @@ -3,9 +3,7 @@ obj-$(CONFIG_LINE6_USB) += line6usb.o line6usb-y := \ audio.o \ capture.o \ - control.o \ driver.o \ - dumprequest.o \ midi.o \ midibuf.o \ pcm.o \ diff --git a/drivers/staging/line6/audio.c b/drivers/staging/line6/audio.c index 8e73983..a92e21f 100644 --- a/drivers/staging/line6/audio.c +++ b/drivers/staging/line6/audio.c @@ -16,20 +16,16 @@ #include "driver.h" #include "audio.h" -static int line6_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; -static char *line6_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; - /* Initialize the Line6 USB audio system. */ int line6_init_audio(struct usb_line6 *line6) { - static int dev; struct snd_card *card; int err; - err = snd_card_create(line6_index[dev], line6_id[dev], THIS_MODULE, 0, - &card); + err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, + THIS_MODULE, 0, &card); if (err < 0) return err; diff --git a/drivers/staging/line6/capture.c b/drivers/staging/line6/capture.c index c85c5b6..389c41f 100644 --- a/drivers/staging/line6/capture.c +++ b/drivers/staging/line6/capture.c @@ -256,8 +256,8 @@ static void audio_in_callback(struct urb *urb) #ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE if (!(line6pcm->flags & LINE6_BITS_PCM_IMPULSE)) #endif - if (test_bit(LINE6_INDEX_PCM_ALSA_CAPTURE_STREAM, &line6pcm->flags) - && (fsize > 0)) + if (test_bit(LINE6_INDEX_PCM_ALSA_CAPTURE_STREAM, + &line6pcm->flags) && (fsize > 0)) line6_capture_copy(line6pcm, fbuf, fsize); } @@ -274,7 +274,8 @@ static void audio_in_callback(struct urb *urb) #ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE if (!(line6pcm->flags & LINE6_BITS_PCM_IMPULSE)) #endif - if (test_bit(LINE6_INDEX_PCM_ALSA_CAPTURE_STREAM, &line6pcm->flags)) + if (test_bit(LINE6_INDEX_PCM_ALSA_CAPTURE_STREAM, + &line6pcm->flags)) line6_capture_check_period(line6pcm, length); } } @@ -356,7 +357,8 @@ int snd_line6_capture_trigger(struct snd_line6_pcm *line6pcm, int cmd) #ifdef CONFIG_PM case SNDRV_PCM_TRIGGER_RESUME: #endif - err = line6_pcm_acquire(line6pcm, LINE6_BIT_PCM_ALSA_CAPTURE_STREAM); + err = line6_pcm_acquire(line6pcm, + LINE6_BIT_PCM_ALSA_CAPTURE_STREAM); if (err < 0) return err; @@ -367,7 +369,8 @@ int snd_line6_capture_trigger(struct snd_line6_pcm *line6pcm, int cmd) #ifdef CONFIG_PM case SNDRV_PCM_TRIGGER_SUSPEND: #endif - err = line6_pcm_release(line6pcm, LINE6_BIT_PCM_ALSA_CAPTURE_STREAM); + err = line6_pcm_release(line6pcm, + LINE6_BIT_PCM_ALSA_CAPTURE_STREAM); if (err < 0) return err; diff --git a/drivers/staging/line6/control.c b/drivers/staging/line6/control.c deleted file mode 100644 index f8326f5..0000000 --- a/drivers/staging/line6/control.c +++ /dev/null @@ -1,995 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#include <linux/usb.h> - -#include "control.h" -#include "driver.h" -#include "pod.h" -#include "usbdefs.h" -#include "variax.h" - -#define DEVICE_ATTR2(_name1, _name2, _mode, _show, _store) \ -struct device_attribute dev_attr_##_name1 = __ATTR(_name2, _mode, _show, _store) - -#define LINE6_PARAM_R(PREFIX, prefix, type, param) \ -static ssize_t prefix##_get_##param(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - return prefix##_get_param_##type(dev, buf, PREFIX##_##param); \ -} - -#define LINE6_PARAM_RW(PREFIX, prefix, type, param) \ -LINE6_PARAM_R(PREFIX, prefix, type, param); \ -static ssize_t prefix##_set_##param(struct device *dev, \ - struct device_attribute *attr, const char *buf, size_t count) \ -{ \ - return prefix##_set_param_##type(dev, buf, count, PREFIX##_##param); \ -} - -#define POD_PARAM_R(type, param) LINE6_PARAM_R(POD, pod, type, param) -#define POD_PARAM_RW(type, param) LINE6_PARAM_RW(POD, pod, type, param) -#define VARIAX_PARAM_R(type, param) LINE6_PARAM_R(VARIAX, variax, type, param) -#define VARIAX_PARAM_RW(type, param) LINE6_PARAM_RW(VARIAX, variax, type, param) - -static ssize_t pod_get_param_int(struct device *dev, char *buf, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&pod->dumpreq); - if (retval < 0) - return retval; - return sprintf(buf, "%d\n", pod->prog_data.control[param]); -} - -static ssize_t pod_set_param_int(struct device *dev, const char *buf, - size_t count, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - u8 value; - int retval; - - retval = kstrtou8(buf, 10, &value); - if (retval) - return retval; - - line6_pod_transmit_parameter(pod, param, value); - return count; -} - -static ssize_t variax_get_param_int(struct device *dev, char *buf, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_variax *variax = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - return sprintf(buf, "%d\n", variax->model_data.control[param]); -} - -static ssize_t variax_get_param_float(struct device *dev, char *buf, int param) -{ - /* - We do our own floating point handling here since at the time - this code was written (Jan 2006) it was highly discouraged to - use floating point arithmetic in the kernel. If you think that - this no longer applies, feel free to replace this by generic - floating point code. - */ - - static const int BIAS = 0x7f; - static const int OFFSET = 0xf; - static const int PRECISION = 1000; - - int len = 0; - unsigned part_int, part_frac; - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_variax *variax = usb_get_intfdata(interface); - const unsigned char *p = variax->model_data.control + param; - int retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - - if ((p[0] == 0) && (p[1] == 0) && (p[2] == 0)) - part_int = part_frac = 0; - else { - int exponent = (((p[0] & 0x7f) << 1) | (p[1] >> 7)) - BIAS; - unsigned mantissa = (p[1] << 8) | p[2] | 0x8000; - exponent -= OFFSET; - - if (exponent >= 0) { - part_int = mantissa << exponent; - part_frac = 0; - } else { - part_int = mantissa >> -exponent; - part_frac = (mantissa << (32 + exponent)) & 0xffffffff; - } - - part_frac = - (part_frac / ((1UL << 31) / (PRECISION / 2 * 10)) + 5) / 10; - } - - len += - sprintf(buf + len, "%s%d.%03d\n", ((p[0] & 0x80) ? "-" : ""), - part_int, part_frac); - return len; -} - -POD_PARAM_RW(int, tweak); -POD_PARAM_RW(int, wah_position); -POD_PARAM_RW(int, compression_gain); -POD_PARAM_RW(int, vol_pedal_position); -POD_PARAM_RW(int, compression_threshold); -POD_PARAM_RW(int, pan); -POD_PARAM_RW(int, amp_model_setup); -POD_PARAM_RW(int, amp_model); -POD_PARAM_RW(int, drive); -POD_PARAM_RW(int, bass); -POD_PARAM_RW(int, mid); -POD_PARAM_RW(int, lowmid); -POD_PARAM_RW(int, treble); -POD_PARAM_RW(int, highmid); -POD_PARAM_RW(int, chan_vol); -POD_PARAM_RW(int, reverb_mix); -POD_PARAM_RW(int, effect_setup); -POD_PARAM_RW(int, band_1_frequency); -POD_PARAM_RW(int, presence); -POD_PARAM_RW(int, treble__bass); -POD_PARAM_RW(int, noise_gate_enable); -POD_PARAM_RW(int, gate_threshold); -POD_PARAM_RW(int, gate_decay_time); -POD_PARAM_RW(int, stomp_enable); -POD_PARAM_RW(int, comp_enable); -POD_PARAM_RW(int, stomp_time); -POD_PARAM_RW(int, delay_enable); -POD_PARAM_RW(int, mod_param_1); -POD_PARAM_RW(int, delay_param_1); -POD_PARAM_RW(int, delay_param_1_note_value); -POD_PARAM_RW(int, band_2_frequency__bass); -POD_PARAM_RW(int, delay_param_2); -POD_PARAM_RW(int, delay_volume_mix); -POD_PARAM_RW(int, delay_param_3); -POD_PARAM_RW(int, reverb_enable); -POD_PARAM_RW(int, reverb_type); -POD_PARAM_RW(int, reverb_decay); -POD_PARAM_RW(int, reverb_tone); -POD_PARAM_RW(int, reverb_pre_delay); -POD_PARAM_RW(int, reverb_pre_post); -POD_PARAM_RW(int, band_2_frequency); -POD_PARAM_RW(int, band_3_frequency__bass); -POD_PARAM_RW(int, wah_enable); -POD_PARAM_RW(int, modulation_lo_cut); -POD_PARAM_RW(int, delay_reverb_lo_cut); -POD_PARAM_RW(int, volume_pedal_minimum); -POD_PARAM_RW(int, eq_pre_post); -POD_PARAM_RW(int, volume_pre_post); -POD_PARAM_RW(int, di_model); -POD_PARAM_RW(int, di_delay); -POD_PARAM_RW(int, mod_enable); -POD_PARAM_RW(int, mod_param_1_note_value); -POD_PARAM_RW(int, mod_param_2); -POD_PARAM_RW(int, mod_param_3); -POD_PARAM_RW(int, mod_param_4); -POD_PARAM_RW(int, mod_param_5); -POD_PARAM_RW(int, mod_volume_mix); -POD_PARAM_RW(int, mod_pre_post); -POD_PARAM_RW(int, modulation_model); -POD_PARAM_RW(int, band_3_frequency); -POD_PARAM_RW(int, band_4_frequency__bass); -POD_PARAM_RW(int, mod_param_1_double_precision); -POD_PARAM_RW(int, delay_param_1_double_precision); -POD_PARAM_RW(int, eq_enable); -POD_PARAM_RW(int, tap); -POD_PARAM_RW(int, volume_tweak_pedal_assign); -POD_PARAM_RW(int, band_5_frequency); -POD_PARAM_RW(int, tuner); -POD_PARAM_RW(int, mic_selection); -POD_PARAM_RW(int, cabinet_model); -POD_PARAM_RW(int, stomp_model); -POD_PARAM_RW(int, roomlevel); -POD_PARAM_RW(int, band_4_frequency); -POD_PARAM_RW(int, band_6_frequency); -POD_PARAM_RW(int, stomp_param_1_note_value); -POD_PARAM_RW(int, stomp_param_2); -POD_PARAM_RW(int, stomp_param_3); -POD_PARAM_RW(int, stomp_param_4); -POD_PARAM_RW(int, stomp_param_5); -POD_PARAM_RW(int, stomp_param_6); -POD_PARAM_RW(int, amp_switch_select); -POD_PARAM_RW(int, delay_param_4); -POD_PARAM_RW(int, delay_param_5); -POD_PARAM_RW(int, delay_pre_post); -POD_PARAM_RW(int, delay_model); -POD_PARAM_RW(int, delay_verb_model); -POD_PARAM_RW(int, tempo_msb); -POD_PARAM_RW(int, tempo_lsb); -POD_PARAM_RW(int, wah_model); -POD_PARAM_RW(int, bypass_volume); -POD_PARAM_RW(int, fx_loop_on_off); -POD_PARAM_RW(int, tweak_param_select); -POD_PARAM_RW(int, amp1_engage); -POD_PARAM_RW(int, band_1_gain); -POD_PARAM_RW(int, band_2_gain__bass); -POD_PARAM_RW(int, band_2_gain); -POD_PARAM_RW(int, band_3_gain__bass); -POD_PARAM_RW(int, band_3_gain); -POD_PARAM_RW(int, band_4_gain__bass); -POD_PARAM_RW(int, band_5_gain__bass); -POD_PARAM_RW(int, band_4_gain); -POD_PARAM_RW(int, band_6_gain__bass); -VARIAX_PARAM_R(int, body); -VARIAX_PARAM_R(int, pickup1_enable); -VARIAX_PARAM_R(int, pickup1_type); -VARIAX_PARAM_R(float, pickup1_position); -VARIAX_PARAM_R(float, pickup1_angle); -VARIAX_PARAM_R(float, pickup1_level); -VARIAX_PARAM_R(int, pickup2_enable); -VARIAX_PARAM_R(int, pickup2_type); -VARIAX_PARAM_R(float, pickup2_position); -VARIAX_PARAM_R(float, pickup2_angle); -VARIAX_PARAM_R(float, pickup2_level); -VARIAX_PARAM_R(int, pickup_phase); -VARIAX_PARAM_R(float, capacitance); -VARIAX_PARAM_R(float, tone_resistance); -VARIAX_PARAM_R(float, volume_resistance); -VARIAX_PARAM_R(int, taper); -VARIAX_PARAM_R(float, tone_dump); -VARIAX_PARAM_R(int, save_tone); -VARIAX_PARAM_R(float, volume_dump); -VARIAX_PARAM_R(int, tuning_enable); -VARIAX_PARAM_R(int, tuning6); -VARIAX_PARAM_R(int, tuning5); -VARIAX_PARAM_R(int, tuning4); -VARIAX_PARAM_R(int, tuning3); -VARIAX_PARAM_R(int, tuning2); -VARIAX_PARAM_R(int, tuning1); -VARIAX_PARAM_R(float, detune6); -VARIAX_PARAM_R(float, detune5); -VARIAX_PARAM_R(float, detune4); -VARIAX_PARAM_R(float, detune3); -VARIAX_PARAM_R(float, detune2); -VARIAX_PARAM_R(float, detune1); -VARIAX_PARAM_R(float, mix6); -VARIAX_PARAM_R(float, mix5); -VARIAX_PARAM_R(float, mix4); -VARIAX_PARAM_R(float, mix3); -VARIAX_PARAM_R(float, mix2); -VARIAX_PARAM_R(float, mix1); -VARIAX_PARAM_R(int, pickup_wiring); - -static DEVICE_ATTR(tweak, S_IWUSR | S_IRUGO, pod_get_tweak, pod_set_tweak); -static DEVICE_ATTR(wah_position, S_IWUSR | S_IRUGO, pod_get_wah_position, - pod_set_wah_position); -static DEVICE_ATTR(compression_gain, S_IWUSR | S_IRUGO, - pod_get_compression_gain, pod_set_compression_gain); -static DEVICE_ATTR(vol_pedal_position, S_IWUSR | S_IRUGO, - pod_get_vol_pedal_position, pod_set_vol_pedal_position); -static DEVICE_ATTR(compression_threshold, S_IWUSR | S_IRUGO, - pod_get_compression_threshold, - pod_set_compression_threshold); -static DEVICE_ATTR(pan, S_IWUSR | S_IRUGO, pod_get_pan, pod_set_pan); -static DEVICE_ATTR(amp_model_setup, S_IWUSR | S_IRUGO, pod_get_amp_model_setup, - pod_set_amp_model_setup); -static DEVICE_ATTR(amp_model, S_IWUSR | S_IRUGO, pod_get_amp_model, - pod_set_amp_model); -static DEVICE_ATTR(drive, S_IWUSR | S_IRUGO, pod_get_drive, pod_set_drive); -static DEVICE_ATTR(bass, S_IWUSR | S_IRUGO, pod_get_bass, pod_set_bass); -static DEVICE_ATTR(mid, S_IWUSR | S_IRUGO, pod_get_mid, pod_set_mid); -static DEVICE_ATTR(lowmid, S_IWUSR | S_IRUGO, pod_get_lowmid, pod_set_lowmid); -static DEVICE_ATTR(treble, S_IWUSR | S_IRUGO, pod_get_treble, pod_set_treble); -static DEVICE_ATTR(highmid, S_IWUSR | S_IRUGO, pod_get_highmid, - pod_set_highmid); -static DEVICE_ATTR(chan_vol, S_IWUSR | S_IRUGO, pod_get_chan_vol, - pod_set_chan_vol); -static DEVICE_ATTR(reverb_mix, S_IWUSR | S_IRUGO, pod_get_reverb_mix, - pod_set_reverb_mix); -static DEVICE_ATTR(effect_setup, S_IWUSR | S_IRUGO, pod_get_effect_setup, - pod_set_effect_setup); -static DEVICE_ATTR(band_1_frequency, S_IWUSR | S_IRUGO, - pod_get_band_1_frequency, pod_set_band_1_frequency); -static DEVICE_ATTR(presence, S_IWUSR | S_IRUGO, pod_get_presence, - pod_set_presence); -static DEVICE_ATTR2(treble__bass, treble, S_IWUSR | S_IRUGO, - pod_get_treble__bass, pod_set_treble__bass); -static DEVICE_ATTR(noise_gate_enable, S_IWUSR | S_IRUGO, - pod_get_noise_gate_enable, pod_set_noise_gate_enable); -static DEVICE_ATTR(gate_threshold, S_IWUSR | S_IRUGO, pod_get_gate_threshold, - pod_set_gate_threshold); -static DEVICE_ATTR(gate_decay_time, S_IWUSR | S_IRUGO, pod_get_gate_decay_time, - pod_set_gate_decay_time); -static DEVICE_ATTR(stomp_enable, S_IWUSR | S_IRUGO, pod_get_stomp_enable, - pod_set_stomp_enable); -static DEVICE_ATTR(comp_enable, S_IWUSR | S_IRUGO, pod_get_comp_enable, - pod_set_comp_enable); -static DEVICE_ATTR(stomp_time, S_IWUSR | S_IRUGO, pod_get_stomp_time, - pod_set_stomp_time); -static DEVICE_ATTR(delay_enable, S_IWUSR | S_IRUGO, pod_get_delay_enable, - pod_set_delay_enable); -static DEVICE_ATTR(mod_param_1, S_IWUSR | S_IRUGO, pod_get_mod_param_1, - pod_set_mod_param_1); -static DEVICE_ATTR(delay_param_1, S_IWUSR | S_IRUGO, pod_get_delay_param_1, - pod_set_delay_param_1); -static DEVICE_ATTR(delay_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_delay_param_1_note_value, - pod_set_delay_param_1_note_value); -static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUSR | S_IRUGO, - pod_get_band_2_frequency__bass, - pod_set_band_2_frequency__bass); -static DEVICE_ATTR(delay_param_2, S_IWUSR | S_IRUGO, pod_get_delay_param_2, - pod_set_delay_param_2); -static DEVICE_ATTR(delay_volume_mix, S_IWUSR | S_IRUGO, - pod_get_delay_volume_mix, pod_set_delay_volume_mix); -static DEVICE_ATTR(delay_param_3, S_IWUSR | S_IRUGO, pod_get_delay_param_3, - pod_set_delay_param_3); -static DEVICE_ATTR(reverb_enable, S_IWUSR | S_IRUGO, pod_get_reverb_enable, - pod_set_reverb_enable); -static DEVICE_ATTR(reverb_type, S_IWUSR | S_IRUGO, pod_get_reverb_type, - pod_set_reverb_type); -static DEVICE_ATTR(reverb_decay, S_IWUSR | S_IRUGO, pod_get_reverb_decay, - pod_set_reverb_decay); -static DEVICE_ATTR(reverb_tone, S_IWUSR | S_IRUGO, pod_get_reverb_tone, - pod_set_reverb_tone); -static DEVICE_ATTR(reverb_pre_delay, S_IWUSR | S_IRUGO, - pod_get_reverb_pre_delay, pod_set_reverb_pre_delay); -static DEVICE_ATTR(reverb_pre_post, S_IWUSR | S_IRUGO, pod_get_reverb_pre_post, - pod_set_reverb_pre_post); -static DEVICE_ATTR(band_2_frequency, S_IWUSR | S_IRUGO, - pod_get_band_2_frequency, pod_set_band_2_frequency); -static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUSR | S_IRUGO, - pod_get_band_3_frequency__bass, - pod_set_band_3_frequency__bass); -static DEVICE_ATTR(wah_enable, S_IWUSR | S_IRUGO, pod_get_wah_enable, - pod_set_wah_enable); -static DEVICE_ATTR(modulation_lo_cut, S_IWUSR | S_IRUGO, - pod_get_modulation_lo_cut, pod_set_modulation_lo_cut); -static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUSR | S_IRUGO, - pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut); -static DEVICE_ATTR(volume_pedal_minimum, S_IWUSR | S_IRUGO, - pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum); -static DEVICE_ATTR(eq_pre_post, S_IWUSR | S_IRUGO, pod_get_eq_pre_post, - pod_set_eq_pre_post); -static DEVICE_ATTR(volume_pre_post, S_IWUSR | S_IRUGO, pod_get_volume_pre_post, - pod_set_volume_pre_post); -static DEVICE_ATTR(di_model, S_IWUSR | S_IRUGO, pod_get_di_model, - pod_set_di_model); -static DEVICE_ATTR(di_delay, S_IWUSR | S_IRUGO, pod_get_di_delay, - pod_set_di_delay); -static DEVICE_ATTR(mod_enable, S_IWUSR | S_IRUGO, pod_get_mod_enable, - pod_set_mod_enable); -static DEVICE_ATTR(mod_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_mod_param_1_note_value, - pod_set_mod_param_1_note_value); -static DEVICE_ATTR(mod_param_2, S_IWUSR | S_IRUGO, pod_get_mod_param_2, - pod_set_mod_param_2); -static DEVICE_ATTR(mod_param_3, S_IWUSR | S_IRUGO, pod_get_mod_param_3, - pod_set_mod_param_3); -static DEVICE_ATTR(mod_param_4, S_IWUSR | S_IRUGO, pod_get_mod_param_4, - pod_set_mod_param_4); -static DEVICE_ATTR(mod_param_5, S_IWUSR | S_IRUGO, pod_get_mod_param_5, - pod_set_mod_param_5); -static DEVICE_ATTR(mod_volume_mix, S_IWUSR | S_IRUGO, pod_get_mod_volume_mix, - pod_set_mod_volume_mix); -static DEVICE_ATTR(mod_pre_post, S_IWUSR | S_IRUGO, pod_get_mod_pre_post, - pod_set_mod_pre_post); -static DEVICE_ATTR(modulation_model, S_IWUSR | S_IRUGO, - pod_get_modulation_model, pod_set_modulation_model); -static DEVICE_ATTR(band_3_frequency, S_IWUSR | S_IRUGO, - pod_get_band_3_frequency, pod_set_band_3_frequency); -static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUSR | S_IRUGO, - pod_get_band_4_frequency__bass, - pod_set_band_4_frequency__bass); -static DEVICE_ATTR(mod_param_1_double_precision, S_IWUSR | S_IRUGO, - pod_get_mod_param_1_double_precision, - pod_set_mod_param_1_double_precision); -static DEVICE_ATTR(delay_param_1_double_precision, S_IWUSR | S_IRUGO, - pod_get_delay_param_1_double_precision, - pod_set_delay_param_1_double_precision); -static DEVICE_ATTR(eq_enable, S_IWUSR | S_IRUGO, pod_get_eq_enable, - pod_set_eq_enable); -static DEVICE_ATTR(tap, S_IWUSR | S_IRUGO, pod_get_tap, pod_set_tap); -static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUSR | S_IRUGO, - pod_get_volume_tweak_pedal_assign, - pod_set_volume_tweak_pedal_assign); -static DEVICE_ATTR(band_5_frequency, S_IWUSR | S_IRUGO, - pod_get_band_5_frequency, pod_set_band_5_frequency); -static DEVICE_ATTR(tuner, S_IWUSR | S_IRUGO, pod_get_tuner, pod_set_tuner); -static DEVICE_ATTR(mic_selection, S_IWUSR | S_IRUGO, pod_get_mic_selection, - pod_set_mic_selection); -static DEVICE_ATTR(cabinet_model, S_IWUSR | S_IRUGO, pod_get_cabinet_model, - pod_set_cabinet_model); -static DEVICE_ATTR(stomp_model, S_IWUSR | S_IRUGO, pod_get_stomp_model, - pod_set_stomp_model); -static DEVICE_ATTR(roomlevel, S_IWUSR | S_IRUGO, pod_get_roomlevel, - pod_set_roomlevel); -static DEVICE_ATTR(band_4_frequency, S_IWUSR | S_IRUGO, - pod_get_band_4_frequency, pod_set_band_4_frequency); -static DEVICE_ATTR(band_6_frequency, S_IWUSR | S_IRUGO, - pod_get_band_6_frequency, pod_set_band_6_frequency); -static DEVICE_ATTR(stomp_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_stomp_param_1_note_value, - pod_set_stomp_param_1_note_value); -static DEVICE_ATTR(stomp_param_2, S_IWUSR | S_IRUGO, pod_get_stomp_param_2, - pod_set_stomp_param_2); -static DEVICE_ATTR(stomp_param_3, S_IWUSR | S_IRUGO, pod_get_stomp_param_3, - pod_set_stomp_param_3); -static DEVICE_ATTR(stomp_param_4, S_IWUSR | S_IRUGO, pod_get_stomp_param_4, - pod_set_stomp_param_4); -static DEVICE_ATTR(stomp_param_5, S_IWUSR | S_IRUGO, pod_get_stomp_param_5, - pod_set_stomp_param_5); -static DEVICE_ATTR(stomp_param_6, S_IWUSR | S_IRUGO, pod_get_stomp_param_6, - pod_set_stomp_param_6); -static DEVICE_ATTR(amp_switch_select, S_IWUSR | S_IRUGO, - pod_get_amp_switch_select, pod_set_amp_switch_select); -static DEVICE_ATTR(delay_param_4, S_IWUSR | S_IRUGO, pod_get_delay_param_4, - pod_set_delay_param_4); -static DEVICE_ATTR(delay_param_5, S_IWUSR | S_IRUGO, pod_get_delay_param_5, - pod_set_delay_param_5); -static DEVICE_ATTR(delay_pre_post, S_IWUSR | S_IRUGO, pod_get_delay_pre_post, - pod_set_delay_pre_post); -static DEVICE_ATTR(delay_model, S_IWUSR | S_IRUGO, pod_get_delay_model, - pod_set_delay_model); -static DEVICE_ATTR(delay_verb_model, S_IWUSR | S_IRUGO, - pod_get_delay_verb_model, pod_set_delay_verb_model); -static DEVICE_ATTR(tempo_msb, S_IWUSR | S_IRUGO, pod_get_tempo_msb, - pod_set_tempo_msb); -static DEVICE_ATTR(tempo_lsb, S_IWUSR | S_IRUGO, pod_get_tempo_lsb, - pod_set_tempo_lsb); -static DEVICE_ATTR(wah_model, S_IWUSR | S_IRUGO, pod_get_wah_model, - pod_set_wah_model); -static DEVICE_ATTR(bypass_volume, S_IWUSR | S_IRUGO, pod_get_bypass_volume, - pod_set_bypass_volume); -static DEVICE_ATTR(fx_loop_on_off, S_IWUSR | S_IRUGO, pod_get_fx_loop_on_off, - pod_set_fx_loop_on_off); -static DEVICE_ATTR(tweak_param_select, S_IWUSR | S_IRUGO, - pod_get_tweak_param_select, pod_set_tweak_param_select); -static DEVICE_ATTR(amp1_engage, S_IWUSR | S_IRUGO, pod_get_amp1_engage, - pod_set_amp1_engage); -static DEVICE_ATTR(band_1_gain, S_IWUSR | S_IRUGO, pod_get_band_1_gain, - pod_set_band_1_gain); -static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUSR | S_IRUGO, - pod_get_band_2_gain__bass, pod_set_band_2_gain__bass); -static DEVICE_ATTR(band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain, - pod_set_band_2_gain); -static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUSR | S_IRUGO, - pod_get_band_3_gain__bass, pod_set_band_3_gain__bass); -static DEVICE_ATTR(band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain, - pod_set_band_3_gain); -static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUSR | S_IRUGO, - pod_get_band_4_gain__bass, pod_set_band_4_gain__bass); -static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUSR | S_IRUGO, - pod_get_band_5_gain__bass, pod_set_band_5_gain__bass); -static DEVICE_ATTR(band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain, - pod_set_band_4_gain); -static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUSR | S_IRUGO, - pod_get_band_6_gain__bass, pod_set_band_6_gain__bass); -static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write); -static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable, - line6_nop_write); -static DEVICE_ATTR(pickup1_type, S_IRUGO, variax_get_pickup1_type, - line6_nop_write); -static DEVICE_ATTR(pickup1_position, S_IRUGO, variax_get_pickup1_position, - line6_nop_write); -static DEVICE_ATTR(pickup1_angle, S_IRUGO, variax_get_pickup1_angle, - line6_nop_write); -static DEVICE_ATTR(pickup1_level, S_IRUGO, variax_get_pickup1_level, - line6_nop_write); -static DEVICE_ATTR(pickup2_enable, S_IRUGO, variax_get_pickup2_enable, - line6_nop_write); -static DEVICE_ATTR(pickup2_type, S_IRUGO, variax_get_pickup2_type, - line6_nop_write); -static DEVICE_ATTR(pickup2_position, S_IRUGO, variax_get_pickup2_position, - line6_nop_write); -static DEVICE_ATTR(pickup2_angle, S_IRUGO, variax_get_pickup2_angle, - line6_nop_write); -static DEVICE_ATTR(pickup2_level, S_IRUGO, variax_get_pickup2_level, - line6_nop_write); -static DEVICE_ATTR(pickup_phase, S_IRUGO, variax_get_pickup_phase, - line6_nop_write); -static DEVICE_ATTR(capacitance, S_IRUGO, variax_get_capacitance, - line6_nop_write); -static DEVICE_ATTR(tone_resistance, S_IRUGO, variax_get_tone_resistance, - line6_nop_write); -static DEVICE_ATTR(volume_resistance, S_IRUGO, variax_get_volume_resistance, - line6_nop_write); -static DEVICE_ATTR(taper, S_IRUGO, variax_get_taper, line6_nop_write); -static DEVICE_ATTR(tone_dump, S_IRUGO, variax_get_tone_dump, line6_nop_write); -static DEVICE_ATTR(save_tone, S_IRUGO, variax_get_save_tone, line6_nop_write); -static DEVICE_ATTR(volume_dump, S_IRUGO, variax_get_volume_dump, - line6_nop_write); -static DEVICE_ATTR(tuning_enable, S_IRUGO, variax_get_tuning_enable, - line6_nop_write); -static DEVICE_ATTR(tuning6, S_IRUGO, variax_get_tuning6, line6_nop_write); -static DEVICE_ATTR(tuning5, S_IRUGO, variax_get_tuning5, line6_nop_write); -static DEVICE_ATTR(tuning4, S_IRUGO, variax_get_tuning4, line6_nop_write); -static DEVICE_ATTR(tuning3, S_IRUGO, variax_get_tuning3, line6_nop_write); -static DEVICE_ATTR(tuning2, S_IRUGO, variax_get_tuning2, line6_nop_write); -static DEVICE_ATTR(tuning1, S_IRUGO, variax_get_tuning1, line6_nop_write); -static DEVICE_ATTR(detune6, S_IRUGO, variax_get_detune6, line6_nop_write); -static DEVICE_ATTR(detune5, S_IRUGO, variax_get_detune5, line6_nop_write); -static DEVICE_ATTR(detune4, S_IRUGO, variax_get_detune4, line6_nop_write); -static DEVICE_ATTR(detune3, S_IRUGO, variax_get_detune3, line6_nop_write); -static DEVICE_ATTR(detune2, S_IRUGO, variax_get_detune2, line6_nop_write); -static DEVICE_ATTR(detune1, S_IRUGO, variax_get_detune1, line6_nop_write); -static DEVICE_ATTR(mix6, S_IRUGO, variax_get_mix6, line6_nop_write); -static DEVICE_ATTR(mix5, S_IRUGO, variax_get_mix5, line6_nop_write); -static DEVICE_ATTR(mix4, S_IRUGO, variax_get_mix4, line6_nop_write); -static DEVICE_ATTR(mix3, S_IRUGO, variax_get_mix3, line6_nop_write); -static DEVICE_ATTR(mix2, S_IRUGO, variax_get_mix2, line6_nop_write); -static DEVICE_ATTR(mix1, S_IRUGO, variax_get_mix1, line6_nop_write); -static DEVICE_ATTR(pickup_wiring, S_IRUGO, variax_get_pickup_wiring, - line6_nop_write); - -int line6_pod_create_files(int firmware, int type, struct device *dev) -{ - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_tweak)); - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_position)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_compression_gain)); - CHECK_RETURN(device_create_file(dev, &dev_attr_vol_pedal_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_compression_threshold)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pan)); - CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model_setup)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_drive)); - CHECK_RETURN(device_create_file(dev, &dev_attr_bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_mid)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_lowmid)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_treble)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_highmid)); - CHECK_RETURN(device_create_file(dev, &dev_attr_chan_vol)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_effect_setup)); - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_1_frequency)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_presence)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_treble__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_noise_gate_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_gate_threshold)); - CHECK_RETURN(device_create_file(dev, &dev_attr_gate_decay_time)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_comp_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_time)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_1)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_param_1_note_value)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_frequency__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_volume_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_3)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_enable)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_type)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_decay)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_tone)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_reverb_pre_delay)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_reverb_pre_post)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_frequency__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_enable)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_modulation_lo_cut)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_reverb_lo_cut)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_volume_pedal_minimum)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_eq_pre_post)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_pre_post)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_di_model)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_di_delay)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1_note_value)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_4)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_volume_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_pre_post)); - CHECK_RETURN(device_create_file(dev, &dev_attr_modulation_model)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_frequency__bass)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_mod_param_1_double_precision)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_param_1_double_precision)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_eq_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tap)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_volume_tweak_pedal_assign)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_5_frequency)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mic_selection)); - CHECK_RETURN(device_create_file(dev, &dev_attr_cabinet_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_roomlevel)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_6_frequency)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_stomp_param_1_note_value)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_6)); - if ((type & (LINE6_BITS_LIVE)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_amp_switch_select)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_pre_post)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_model)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_verb_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_msb)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_lsb)); - if (firmware >= 300) - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_model)); - if (firmware >= 214) - CHECK_RETURN(device_create_file(dev, &dev_attr_bypass_volume)); - if ((type & (LINE6_BITS_PRO)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_fx_loop_on_off)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tweak_param_select)); - CHECK_RETURN(device_create_file(dev, &dev_attr_amp1_engage)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_band_1_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_gain__bass)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_5_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_6_gain__bass)); - return 0; -} - -void line6_pod_remove_files(int firmware, int type, struct device *dev) -{ - device_remove_file(dev, &dev_attr_tweak); - device_remove_file(dev, &dev_attr_wah_position); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_compression_gain); - device_remove_file(dev, &dev_attr_vol_pedal_position); - device_remove_file(dev, &dev_attr_compression_threshold); - device_remove_file(dev, &dev_attr_pan); - device_remove_file(dev, &dev_attr_amp_model_setup); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_amp_model); - device_remove_file(dev, &dev_attr_drive); - device_remove_file(dev, &dev_attr_bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_mid); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_lowmid); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_treble); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_highmid); - device_remove_file(dev, &dev_attr_chan_vol); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_mix); - device_remove_file(dev, &dev_attr_effect_setup); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_1_frequency); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_presence); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_treble__bass); - device_remove_file(dev, &dev_attr_noise_gate_enable); - device_remove_file(dev, &dev_attr_gate_threshold); - device_remove_file(dev, &dev_attr_gate_decay_time); - device_remove_file(dev, &dev_attr_stomp_enable); - device_remove_file(dev, &dev_attr_comp_enable); - device_remove_file(dev, &dev_attr_stomp_time); - device_remove_file(dev, &dev_attr_delay_enable); - device_remove_file(dev, &dev_attr_mod_param_1); - device_remove_file(dev, &dev_attr_delay_param_1); - device_remove_file(dev, &dev_attr_delay_param_1_note_value); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_2_frequency__bass); - device_remove_file(dev, &dev_attr_delay_param_2); - device_remove_file(dev, &dev_attr_delay_volume_mix); - device_remove_file(dev, &dev_attr_delay_param_3); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_enable); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_type); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_decay); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_tone); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_pre_delay); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_pre_post); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_3_frequency__bass); - device_remove_file(dev, &dev_attr_wah_enable); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_modulation_lo_cut); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_reverb_lo_cut); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_volume_pedal_minimum); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_eq_pre_post); - device_remove_file(dev, &dev_attr_volume_pre_post); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_di_model); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_di_delay); - device_remove_file(dev, &dev_attr_mod_enable); - device_remove_file(dev, &dev_attr_mod_param_1_note_value); - device_remove_file(dev, &dev_attr_mod_param_2); - device_remove_file(dev, &dev_attr_mod_param_3); - device_remove_file(dev, &dev_attr_mod_param_4); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_mod_param_5); - device_remove_file(dev, &dev_attr_mod_volume_mix); - device_remove_file(dev, &dev_attr_mod_pre_post); - device_remove_file(dev, &dev_attr_modulation_model); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_4_frequency__bass); - device_remove_file(dev, &dev_attr_mod_param_1_double_precision); - device_remove_file(dev, &dev_attr_delay_param_1_double_precision); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_eq_enable); - device_remove_file(dev, &dev_attr_tap); - device_remove_file(dev, &dev_attr_volume_tweak_pedal_assign); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_5_frequency); - device_remove_file(dev, &dev_attr_tuner); - device_remove_file(dev, &dev_attr_mic_selection); - device_remove_file(dev, &dev_attr_cabinet_model); - device_remove_file(dev, &dev_attr_stomp_model); - device_remove_file(dev, &dev_attr_roomlevel); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_6_frequency); - device_remove_file(dev, &dev_attr_stomp_param_1_note_value); - device_remove_file(dev, &dev_attr_stomp_param_2); - device_remove_file(dev, &dev_attr_stomp_param_3); - device_remove_file(dev, &dev_attr_stomp_param_4); - device_remove_file(dev, &dev_attr_stomp_param_5); - device_remove_file(dev, &dev_attr_stomp_param_6); - if ((type & (LINE6_BITS_LIVE)) != 0) - device_remove_file(dev, &dev_attr_amp_switch_select); - device_remove_file(dev, &dev_attr_delay_param_4); - device_remove_file(dev, &dev_attr_delay_param_5); - device_remove_file(dev, &dev_attr_delay_pre_post); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_model); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_verb_model); - device_remove_file(dev, &dev_attr_tempo_msb); - device_remove_file(dev, &dev_attr_tempo_lsb); - if (firmware >= 300) - device_remove_file(dev, &dev_attr_wah_model); - if (firmware >= 214) - device_remove_file(dev, &dev_attr_bypass_volume); - if ((type & (LINE6_BITS_PRO)) != 0) - device_remove_file(dev, &dev_attr_fx_loop_on_off); - device_remove_file(dev, &dev_attr_tweak_param_select); - device_remove_file(dev, &dev_attr_amp1_engage); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_1_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_gain__bass); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_5_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_6_gain__bass); -} - -int line6_variax_create_files(int firmware, int type, struct device *dev) -{ - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_body)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_type)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_angle)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_level)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_type)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_angle)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_level)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_phase)); - CHECK_RETURN(device_create_file(dev, &dev_attr_capacitance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tone_resistance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_resistance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_taper)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tone_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_save_tone)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_wiring)); - return 0; -} - -void line6_variax_remove_files(int firmware, int type, struct device *dev) -{ - device_remove_file(dev, &dev_attr_body); - device_remove_file(dev, &dev_attr_pickup1_enable); - device_remove_file(dev, &dev_attr_pickup1_type); - device_remove_file(dev, &dev_attr_pickup1_position); - device_remove_file(dev, &dev_attr_pickup1_angle); - device_remove_file(dev, &dev_attr_pickup1_level); - device_remove_file(dev, &dev_attr_pickup2_enable); - device_remove_file(dev, &dev_attr_pickup2_type); - device_remove_file(dev, &dev_attr_pickup2_position); - device_remove_file(dev, &dev_attr_pickup2_angle); - device_remove_file(dev, &dev_attr_pickup2_level); - device_remove_file(dev, &dev_attr_pickup_phase); - device_remove_file(dev, &dev_attr_capacitance); - device_remove_file(dev, &dev_attr_tone_resistance); - device_remove_file(dev, &dev_attr_volume_resistance); - device_remove_file(dev, &dev_attr_taper); - device_remove_file(dev, &dev_attr_tone_dump); - device_remove_file(dev, &dev_attr_save_tone); - device_remove_file(dev, &dev_attr_volume_dump); - device_remove_file(dev, &dev_attr_tuning_enable); - device_remove_file(dev, &dev_attr_tuning6); - device_remove_file(dev, &dev_attr_tuning5); - device_remove_file(dev, &dev_attr_tuning4); - device_remove_file(dev, &dev_attr_tuning3); - device_remove_file(dev, &dev_attr_tuning2); - device_remove_file(dev, &dev_attr_tuning1); - device_remove_file(dev, &dev_attr_detune6); - device_remove_file(dev, &dev_attr_detune5); - device_remove_file(dev, &dev_attr_detune4); - device_remove_file(dev, &dev_attr_detune3); - device_remove_file(dev, &dev_attr_detune2); - device_remove_file(dev, &dev_attr_detune1); - device_remove_file(dev, &dev_attr_mix6); - device_remove_file(dev, &dev_attr_mix5); - device_remove_file(dev, &dev_attr_mix4); - device_remove_file(dev, &dev_attr_mix3); - device_remove_file(dev, &dev_attr_mix2); - device_remove_file(dev, &dev_attr_mix1); - device_remove_file(dev, &dev_attr_pickup_wiring); -} diff --git a/drivers/staging/line6/control.h b/drivers/staging/line6/control.h deleted file mode 100644 index e4c5d2c..0000000 --- a/drivers/staging/line6/control.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#ifndef LINE6_CONTROL_H -#define LINE6_CONTROL_H - -/** - List of PODxt Pro controls. - See Appendix C of the "PODxt (Pro) Pilot's Handbook" by Line6. - Comments after the number refer to the PODxt Pro firmware version required - for this feature. - - Please *don't* reformat this file since "control.c" is created automatically - from "control.h", and this process depends on the exact formatting of the - code and the comments below! -*/ - -/* *INDENT-OFF* */ - -enum { - POD_tweak = 1, - POD_wah_position = 4, - POD_compression_gain = 5, /* device: LINE6_BITS_PODXTALL */ - POD_vol_pedal_position = 7, - POD_compression_threshold = 9, - POD_pan = 10, - POD_amp_model_setup = 11, - POD_amp_model = 12, /* firmware: 2.0 */ - POD_drive = 13, - POD_bass = 14, - POD_mid = 15, /* device: LINE6_BITS_PODXTALL */ - POD_lowmid = 15, /* device: LINE6_BITS_BASSPODXTALL */ - POD_treble = 16, /* device: LINE6_BITS_PODXTALL */ - POD_highmid = 16, /* device: LINE6_BITS_BASSPODXTALL */ - POD_chan_vol = 17, - POD_reverb_mix = 18, /* device: LINE6_BITS_PODXTALL */ - POD_effect_setup = 19, - POD_band_1_frequency = 20, /* firmware: 2.0 */ - POD_presence = 21, /* device: LINE6_BITS_PODXTALL */ - POD_treble__bass = 21, /* device: LINE6_BITS_BASSPODXTALL */ - POD_noise_gate_enable = 22, - POD_gate_threshold = 23, - POD_gate_decay_time = 24, - POD_stomp_enable = 25, - POD_comp_enable = 26, - POD_stomp_time = 27, - POD_delay_enable = 28, - POD_mod_param_1 = 29, - POD_delay_param_1 = 30, - POD_delay_param_1_note_value = 31, - POD_band_2_frequency__bass = 32, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_delay_param_2 = 33, - POD_delay_volume_mix = 34, - POD_delay_param_3 = 35, - POD_reverb_enable = 36, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_type = 37, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_decay = 38, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_tone = 39, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_pre_delay = 40, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_pre_post = 41, /* device: LINE6_BITS_PODXTALL */ - POD_band_2_frequency = 42, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_3_frequency__bass = 42, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_wah_enable = 43, - POD_modulation_lo_cut = 44, /* device: LINE6_BITS_BASSPODXTALL */ - POD_delay_reverb_lo_cut = 45, /* device: LINE6_BITS_BASSPODXTALL */ - POD_volume_pedal_minimum = 46, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_eq_pre_post = 46, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_volume_pre_post = 47, - POD_di_model = 48, /* device: LINE6_BITS_BASSPODXTALL */ - POD_di_delay = 49, /* device: LINE6_BITS_BASSPODXTALL */ - POD_mod_enable = 50, - POD_mod_param_1_note_value = 51, - POD_mod_param_2 = 52, - POD_mod_param_3 = 53, - POD_mod_param_4 = 54, - POD_mod_param_5 = 55, /* device: LINE6_BITS_BASSPODXTALL */ - POD_mod_volume_mix = 56, - POD_mod_pre_post = 57, - POD_modulation_model = 58, - POD_band_3_frequency = 60, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_4_frequency__bass = 60, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_mod_param_1_double_precision = 61, - POD_delay_param_1_double_precision = 62, - POD_eq_enable = 63, /* firmware: 2.0 */ - POD_tap = 64, - POD_volume_tweak_pedal_assign = 65, - POD_band_5_frequency = 68, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_tuner = 69, - POD_mic_selection = 70, - POD_cabinet_model = 71, - POD_stomp_model = 75, - POD_roomlevel = 76, - POD_band_4_frequency = 77, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_6_frequency = 77, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_stomp_param_1_note_value = 78, - POD_stomp_param_2 = 79, - POD_stomp_param_3 = 80, - POD_stomp_param_4 = 81, - POD_stomp_param_5 = 82, - POD_stomp_param_6 = 83, - POD_amp_switch_select = 84, /* device: LINE6_BITS_LIVE */ - POD_delay_param_4 = 85, - POD_delay_param_5 = 86, - POD_delay_pre_post = 87, - POD_delay_model = 88, /* device: LINE6_BITS_PODXTALL */ - POD_delay_verb_model = 88, /* device: LINE6_BITS_BASSPODXTALL */ - POD_tempo_msb = 89, - POD_tempo_lsb = 90, - POD_wah_model = 91, /* firmware: 3.0 */ - POD_bypass_volume = 105, /* firmware: 2.14 */ - POD_fx_loop_on_off = 107, /* device: LINE6_BITS_PRO */ - POD_tweak_param_select = 108, - POD_amp1_engage = 111, - POD_band_1_gain = 114, /* firmware: 2.0 */ - POD_band_2_gain__bass = 115, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_2_gain = 116, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_3_gain__bass = 116, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_3_gain = 117, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_4_gain__bass = 117, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_5_gain__bass = 118, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_4_gain = 119, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_6_gain__bass = 119 /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ -}; - -/** - List of Variax workbench controls (dump). -*/ -enum { - VARIAX_body = 3, - VARIAX_pickup1_enable = 4, /* 0: enabled, 1: disabled */ - VARIAX_pickup1_type = 8, - VARIAX_pickup1_position = 9, /* type: 24 bit float */ - VARIAX_pickup1_angle = 12, /* type: 24 bit float */ - VARIAX_pickup1_level = 15, /* type: 24 bit float */ - VARIAX_pickup2_enable = 18, /* 0: enabled, 1: disabled */ - VARIAX_pickup2_type = 22, - VARIAX_pickup2_position = 23, /* type: 24 bit float */ - VARIAX_pickup2_angle = 26, /* type: 24 bit float */ - VARIAX_pickup2_level = 29, /* type: 24 bit float */ - VARIAX_pickup_phase = 32, /* 0: in phase, 1: out of phase */ - VARIAX_capacitance = 33, /* type: 24 bit float */ - VARIAX_tone_resistance = 36, /* type: 24 bit float */ - VARIAX_volume_resistance = 39, /* type: 24 bit float */ - VARIAX_taper = 42, /* 0: Linear, 1: Audio */ - VARIAX_tone_dump = 43, /* type: 24 bit float */ - VARIAX_save_tone = 46, - VARIAX_volume_dump = 47, /* type: 24 bit float */ - VARIAX_tuning_enable = 50, - VARIAX_tuning6 = 51, - VARIAX_tuning5 = 52, - VARIAX_tuning4 = 53, - VARIAX_tuning3 = 54, - VARIAX_tuning2 = 55, - VARIAX_tuning1 = 56, - VARIAX_detune6 = 57, /* type: 24 bit float */ - VARIAX_detune5 = 60, /* type: 24 bit float */ - VARIAX_detune4 = 63, /* type: 24 bit float */ - VARIAX_detune3 = 66, /* type: 24 bit float */ - VARIAX_detune2 = 69, /* type: 24 bit float */ - VARIAX_detune1 = 72, /* type: 24 bit float */ - VARIAX_mix6 = 75, /* type: 24 bit float */ - VARIAX_mix5 = 78, /* type: 24 bit float */ - VARIAX_mix4 = 81, /* type: 24 bit float */ - VARIAX_mix3 = 84, /* type: 24 bit float */ - VARIAX_mix2 = 87, /* type: 24 bit float */ - VARIAX_mix1 = 90, /* type: 24 bit float */ - VARIAX_pickup_wiring = 96 /* 0: parallel, 1: series */ -}; - -/** - List of Variax workbench controls (MIDI). -*/ -enum { - VARIAXMIDI_volume = 7, - VARIAXMIDI_tone = 79, -}; - -/* *INDENT-ON* */ - -extern int line6_pod_create_files(int firmware, int type, struct device *dev); -extern void line6_pod_remove_files(int firmware, int type, struct device *dev); -extern int line6_variax_create_files(int firmware, int type, - struct device *dev); -extern void line6_variax_remove_files(int firmware, int type, - struct device *dev); - -#endif diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index b8358ca..1e4ce500 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -16,7 +16,6 @@ #include "audio.h" #include "capture.h" -#include "control.h" #include "driver.h" #include "midi.h" #include "playback.h" @@ -96,8 +95,6 @@ static const char line6_request_version[] = { 0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7 }; -struct usb_line6 *line6_devices[LINE6_MAX_DEVICES]; - /** Class for asynchronous messages. */ @@ -179,22 +176,6 @@ void line6_write_hexdump(struct usb_line6 *line6, char dir, } #endif -#ifdef CONFIG_LINE6_USB_DUMP_CTRL -/* - Dump URB data to syslog. -*/ -static void line6_dump_urb(struct urb *urb) -{ - struct usb_line6 *line6 = (struct usb_line6 *)urb->context; - - if (urb->status < 0) - return; - - line6_write_hexdump(line6, 'R', (unsigned char *)urb->transfer_buffer, - urb->actual_length); -} -#endif - /* Send raw message in pieces of wMaxPacketSize bytes. */ @@ -203,10 +184,6 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer, { int i, done = 0; -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_write_hexdump(line6, 'S', buffer, size); -#endif - for (i = 0; i < size; i += line6->max_packet_size) { int partial; const char *frag_buf = buffer + i; @@ -261,10 +238,6 @@ static int line6_send_raw_message_async_part(struct message *msg, (char *)msg->buffer + done, bytes, line6_async_request_sent, msg, line6->interval); -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_write_hexdump(line6, 'S', (char *)msg->buffer + done, bytes); -#endif - msg->done += bytes; retval = usb_submit_urb(urb, GFP_ATOMIC); @@ -405,19 +378,13 @@ static void line6_data_received(struct urb *urb) if (urb->status == -ESHUTDOWN) return; -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_dump_urb(urb); -#endif - done = line6_midibuf_write(mb, urb->transfer_buffer, urb->actual_length); if (done < urb->actual_length) { line6_midibuf_ignore(mb, done); - DEBUG_MESSAGES(dev_err - (line6->ifcdev, - "%d %d buffer overflow - message skipped\n", - done, urb->actual_length)); + dev_dbg(line6->ifcdev, "%d %d buffer overflow - message skipped\n", + done, urb->actual_length); } for (;;) { @@ -428,15 +395,7 @@ static void line6_data_received(struct urb *urb) if (done == 0) break; - /* MIDI input filter */ - if (line6_midibuf_skip_message - (mb, line6->line6midi->midi_mask_receive)) - continue; - line6->message_length = done; -#ifdef CONFIG_LINE6_USB_DUMP_MIDI - line6_write_hexdump(line6, 'r', line6->buffer_message, done); -#endif line6_midi_receive(line6, line6->buffer_message, done); switch (line6->usbdev->descriptor.idProduct) { @@ -506,10 +465,6 @@ int line6_send_program(struct usb_line6 *line6, u8 value) buffer[0] = LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST; buffer[1] = value; -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_write_hexdump(line6, 'S', buffer, 2); -#endif - retval = usb_interrupt_msg(line6->usbdev, usb_sndintpipe(line6->usbdev, line6->ep_control_write), @@ -543,10 +498,6 @@ int line6_transmit_parameter(struct usb_line6 *line6, int param, u8 value) buffer[1] = param; buffer[2] = value; -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_write_hexdump(line6, 'S', buffer, 3); -#endif - retval = usb_interrupt_msg(line6->usbdev, usb_sndintpipe(line6->usbdev, line6->ep_control_write), @@ -690,20 +641,6 @@ ssize_t line6_nop_write(struct device *dev, struct device_attribute *attr, } /* - "write" request on "raw" special file. -*/ -#ifdef CONFIG_LINE6_USB_RAW -ssize_t line6_set_raw(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - line6_send_raw_message(line6, buf, count); - return count; -} -#endif - -/* Generic destructor. */ static void line6_destruct(struct usb_interface *interface) @@ -740,7 +677,6 @@ static int line6_probe(struct usb_interface *interface, struct usb_device *usbdev; struct usb_line6 *line6; const struct line6_properties *properties; - int devnum; int interface_number, alternate = 0; int product; int size = 0; @@ -774,16 +710,6 @@ static int line6_probe(struct usb_interface *interface, goto err_put; } - /* find free slot in device table: */ - for (devnum = 0; devnum < LINE6_MAX_DEVICES; ++devnum) - if (line6_devices[devnum] == NULL) - break; - - if (devnum == LINE6_MAX_DEVICES) { - ret = -ENODEV; - goto err_put; - } - /* initialize device info: */ properties = &line6_properties_table[devtype]; dev_info(&interface->dev, "Line6 %s found\n", properties->name); @@ -1112,7 +1038,6 @@ static int line6_probe(struct usb_interface *interface, dev_info(&interface->dev, "Line6 %s now attached\n", line6->properties->name); - line6_devices[devnum] = line6; switch (product) { case LINE6_DEVID_PODX3: @@ -1141,7 +1066,7 @@ static void line6_disconnect(struct usb_interface *interface) { struct usb_line6 *line6; struct usb_device *usbdev; - int interface_number, i; + int interface_number; if (interface == NULL) return; @@ -1214,10 +1139,6 @@ static void line6_disconnect(struct usb_interface *interface) dev_info(&interface->dev, "Line6 %s now disconnected\n", line6->properties->name); - - for (i = LINE6_MAX_DEVICES; i--;) - if (line6_devices[i] == line6) - line6_devices[i] = NULL; } line6_destruct(interface); diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h index a3029eb..f0be5a2 100644 --- a/drivers/staging/line6/driver.h +++ b/drivers/staging/line6/driver.h @@ -20,12 +20,11 @@ #define DRIVER_NAME "line6usb" -#if defined(CONFIG_LINE6_USB_DUMP_CTRL) || defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM) +#if defined(CONFIG_LINE6_USB_DUMP_PCM) #define CONFIG_LINE6_USB_DUMP_ANY #endif #define LINE6_TIMEOUT 1 -#define LINE6_MAX_DEVICES 8 #define LINE6_BUFSIZE_LISTEN 32 #define LINE6_MESSAGE_MAXLEN 256 @@ -53,12 +52,6 @@ #define LINE6_CHANNEL_MASK 0x0f -#ifdef CONFIG_LINE6_USB_DEBUG -#define DEBUG_MESSAGES(x) (x) -#else -#define DEBUG_MESSAGES(x) -#endif - #define MISSING_CASE \ printk(KERN_ERR "line6usb driver bug: missing case in %s:%d\n", \ __FILE__, __LINE__) @@ -78,7 +71,6 @@ do { \ } while (0) extern const unsigned char line6_midi_id[3]; -extern struct usb_line6 *line6_devices[LINE6_MAX_DEVICES]; static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4; diff --git a/drivers/staging/line6/dumprequest.c b/drivers/staging/line6/dumprequest.c deleted file mode 100644 index 60c7bae..0000000 --- a/drivers/staging/line6/dumprequest.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#include <linux/slab.h> - -#include "driver.h" -#include "dumprequest.h" - -/* - Set "dump in progress" flag. -*/ -void line6_dump_started(struct line6_dump_request *l6dr, int dest) -{ - l6dr->in_progress = dest; -} - -/* - Invalidate current channel, i.e., set "dump in progress" flag. - Reading from the "dump" special file blocks until dump is completed. -*/ -void line6_invalidate_current(struct line6_dump_request *l6dr) -{ - line6_dump_started(l6dr, LINE6_DUMP_CURRENT); -} - -/* - Clear "dump in progress" flag and notify waiting processes. -*/ -void line6_dump_finished(struct line6_dump_request *l6dr) -{ - l6dr->in_progress = LINE6_DUMP_NONE; - wake_up(&l6dr->wait); -} - -/* - Send an asynchronous channel dump request. -*/ -int line6_dump_request_async(struct line6_dump_request *l6dr, - struct usb_line6 *line6, int num, int dest) -{ - int ret; - line6_dump_started(l6dr, dest); - ret = line6_send_raw_message_async(line6, l6dr->reqbufs[num].buffer, - l6dr->reqbufs[num].length); - - if (ret < 0) - line6_dump_finished(l6dr); - - return ret; -} - -/* - Wait for completion (interruptible). -*/ -int line6_dump_wait_interruptible(struct line6_dump_request *l6dr) -{ - return wait_event_interruptible(l6dr->wait, - l6dr->in_progress == LINE6_DUMP_NONE); -} - -/* - Wait for completion. -*/ -void line6_dump_wait(struct line6_dump_request *l6dr) -{ - wait_event(l6dr->wait, l6dr->in_progress == LINE6_DUMP_NONE); -} - -/* - Wait for completion (with timeout). -*/ -int line6_dump_wait_timeout(struct line6_dump_request *l6dr, long timeout) -{ - return wait_event_timeout(l6dr->wait, - l6dr->in_progress == LINE6_DUMP_NONE, - timeout); -} - -/* - Initialize dump request buffer. -*/ -int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, const void *buf, - size_t len, int num) -{ - l6dr->reqbufs[num].buffer = kmemdup(buf, len, GFP_KERNEL); - if (l6dr->reqbufs[num].buffer == NULL) - return -ENOMEM; - l6dr->reqbufs[num].length = len; - return 0; -} - -/* - Initialize dump request data structure (including one buffer). -*/ -int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf, - size_t len) -{ - int ret; - ret = line6_dumpreq_initbuf(l6dr, buf, len, 0); - if (ret < 0) - return ret; - init_waitqueue_head(&l6dr->wait); - return 0; -} - -/* - Destruct dump request data structure. -*/ -void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num) -{ - if (l6dr == NULL) - return; - if (l6dr->reqbufs[num].buffer == NULL) - return; - kfree(l6dr->reqbufs[num].buffer); - l6dr->reqbufs[num].buffer = NULL; -} - -/* - Destruct dump request data structure. -*/ -void line6_dumpreq_destruct(struct line6_dump_request *l6dr) -{ - if (l6dr->reqbufs[0].buffer == NULL) - return; - line6_dumpreq_destructbuf(l6dr, 0); -} diff --git a/drivers/staging/line6/dumprequest.h b/drivers/staging/line6/dumprequest.h deleted file mode 100644 index c17a262..0000000 --- a/drivers/staging/line6/dumprequest.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#ifndef DUMPREQUEST_H -#define DUMPREQUEST_H - -#include <linux/usb.h> -#include <linux/wait.h> -#include <sound/core.h> - -enum { - LINE6_DUMP_NONE, - LINE6_DUMP_CURRENT -}; - -struct line6_dump_reqbuf { - /** - Buffer for dump requests. - */ - unsigned char *buffer; - - /** - Size of dump request. - */ - size_t length; -}; - -/** - Provides the functionality to request channel/model/... dump data from a - Line6 device. -*/ -struct line6_dump_request { - /** - Wait queue for access to program dump data. - */ - wait_queue_head_t wait; - - /** - Indicates an unfinished program dump request. - 0: no dump - 1: dump current settings - Other device-specific values are also allowed. - */ - int in_progress; - - /** - Dump request buffers - */ - struct line6_dump_reqbuf reqbufs[1]; -}; - -extern void line6_dump_finished(struct line6_dump_request *l6dr); -extern int line6_dump_request_async(struct line6_dump_request *l6dr, - struct usb_line6 *line6, int num, int dest); -extern void line6_dump_started(struct line6_dump_request *l6dr, int dest); -extern void line6_dumpreq_destruct(struct line6_dump_request *l6dr); -extern void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num); -extern int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf, - size_t len); -extern int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, - const void *buf, size_t len, int num); -extern void line6_invalidate_current(struct line6_dump_request *l6dr); -extern void line6_dump_wait(struct line6_dump_request *l6dr); -extern int line6_dump_wait_interruptible(struct line6_dump_request *l6dr); -extern int line6_dump_wait_timeout(struct line6_dump_request *l6dr, - long timeout); - -#endif diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c index 5040729..6982eca 100644 --- a/drivers/staging/line6/midi.c +++ b/drivers/staging/line6/midi.c @@ -59,9 +59,6 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream) if (done == 0) break; -#ifdef CONFIG_LINE6_USB_DUMP_MIDI - line6_write_hexdump(line6, 's', chunk, done); -#endif line6_midibuf_write(mb, chunk, done); snd_rawmidi_transmit_ack(substream, done); } @@ -72,10 +69,6 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream) if (done == 0) break; - if (line6_midibuf_skip_message - (mb, line6midi->midi_mask_transmit)) - continue; - send_midi_async(line6, chunk, done); } @@ -131,9 +124,6 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, dev_err(line6->ifcdev, "Out of memory\n"); return -ENOMEM; } -#ifdef CONFIG_LINE6_USB_DUMP_CTRL - line6_write_hexdump(line6, 'S', data, length); -#endif transfer_buffer = kmemdup(data, length, GFP_ATOMIC); @@ -158,28 +148,6 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, } ++line6->line6midi->num_active_send_urbs; - - switch (line6->usbdev->descriptor.idProduct) { - case LINE6_DEVID_BASSPODXT: - case LINE6_DEVID_BASSPODXTLIVE: - case LINE6_DEVID_BASSPODXTPRO: - case LINE6_DEVID_PODXT: - case LINE6_DEVID_PODXTLIVE: - case LINE6_DEVID_PODXTPRO: - case LINE6_DEVID_POCKETPOD: - line6_pod_midi_postprocess((struct usb_line6_pod *)line6, data, - length); - break; - - case LINE6_DEVID_VARIAX: - case LINE6_DEVID_PODHD300: - case LINE6_DEVID_PODHD500: - break; - - default: - MISSING_CASE; - } - return 0; } @@ -287,83 +255,10 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi) return 0; } -/* - "read" request on "midi_mask_transmit" special file. -*/ -static ssize_t midi_get_midi_mask_transmit(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - return sprintf(buf, "%d\n", line6->line6midi->midi_mask_transmit); -} - -/* - "write" request on "midi_mask" special file. -*/ -static ssize_t midi_set_midi_mask_transmit(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - unsigned short value; - int ret; - - ret = kstrtou16(buf, 10, &value); - if (ret) - return ret; - - line6->line6midi->midi_mask_transmit = value; - return count; -} - -/* - "read" request on "midi_mask_receive" special file. -*/ -static ssize_t midi_get_midi_mask_receive(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - return sprintf(buf, "%d\n", line6->line6midi->midi_mask_receive); -} - -/* - "write" request on "midi_mask" special file. -*/ -static ssize_t midi_set_midi_mask_receive(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - unsigned short value; - int ret; - - ret = kstrtou16(buf, 10, &value); - if (ret) - return ret; - - line6->line6midi->midi_mask_receive = value; - return count; -} - -static DEVICE_ATTR(midi_mask_transmit, S_IWUSR | S_IRUGO, - midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); -static DEVICE_ATTR(midi_mask_receive, S_IWUSR | S_IRUGO, - midi_get_midi_mask_receive, midi_set_midi_mask_receive); - /* MIDI device destructor */ static int snd_line6_midi_free(struct snd_device *device) { struct snd_line6_midi *line6midi = device->device_data; - device_remove_file(line6midi->line6->ifcdev, - &dev_attr_midi_mask_transmit); - device_remove_file(line6midi->line6->ifcdev, - &dev_attr_midi_mask_receive); line6_midibuf_destroy(&line6midi->midibuf_in); line6_midibuf_destroy(&line6midi->midibuf_out); return 0; @@ -405,19 +300,6 @@ int line6_init_midi(struct usb_line6 *line6) } line6midi->line6 = line6; - - switch (line6->product) { - case LINE6_DEVID_PODHD300: - case LINE6_DEVID_PODHD500: - line6midi->midi_mask_transmit = 1; - line6midi->midi_mask_receive = 1; - break; - - default: - line6midi->midi_mask_transmit = 1; - line6midi->midi_mask_receive = 4; - } - line6->line6midi = line6midi; err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi, @@ -431,14 +313,6 @@ int line6_init_midi(struct usb_line6 *line6) if (err < 0) return err; - err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_transmit); - if (err < 0) - return err; - - err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_receive); - if (err < 0) - return err; - init_waitqueue_head(&line6midi->send_wait); spin_lock_init(&line6midi->send_urb_lock); spin_lock_init(&line6midi->midi_transmit_lock); diff --git a/drivers/staging/line6/midi.h b/drivers/staging/line6/midi.h index 4a9e9f9..19dabd5 100644 --- a/drivers/staging/line6/midi.h +++ b/drivers/staging/line6/midi.h @@ -55,16 +55,6 @@ struct snd_line6_midi { wait_queue_head_t send_wait; /** - Bit mask for output MIDI channels. - */ - unsigned short midi_mask_transmit; - - /** - Bit mask for input MIDI channels. - */ - unsigned short midi_mask_receive; - - /** Buffer for incoming MIDI stream. */ struct MidiBuffer midibuf_in; diff --git a/drivers/staging/line6/midibuf.c b/drivers/staging/line6/midibuf.c index 836e8c8..968e0de 100644 --- a/drivers/staging/line6/midibuf.c +++ b/drivers/staging/line6/midibuf.c @@ -64,9 +64,9 @@ int line6_midibuf_init(struct MidiBuffer *this, int size, int split) void line6_midibuf_status(struct MidiBuffer *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); + 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) diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c index 7fe44a6..6c1e313 100644 --- a/drivers/staging/line6/pcm.c +++ b/drivers/staging/line6/pcm.c @@ -109,7 +109,7 @@ int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int channels) line6pcm->prev_fbuf = NULL; if (test_flags(flags_old, flags_new, LINE6_BITS_CAPTURE_BUFFER)) { - /* We may be invoked multiple times in a row so allocate once only */ + /* Invoked multiple times in a row so allocate once only */ if (!line6pcm->buffer_in) { line6pcm->buffer_in = kmalloc(LINE6_ISO_BUFFERS * LINE6_ISO_PACKETS * @@ -148,7 +148,7 @@ int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int channels) } if (test_flags(flags_old, flags_new, LINE6_BITS_PLAYBACK_BUFFER)) { - /* We may be invoked multiple times in a row so allocate once only */ + /* Invoked multiple times in a row so allocate once only */ if (!line6pcm->buffer_out) { line6pcm->buffer_out = kmalloc(LINE6_ISO_BUFFERS * LINE6_ISO_PACKETS * diff --git a/drivers/staging/line6/pcm.h b/drivers/staging/line6/pcm.h index 5210ec8..6aa0d46 100644 --- a/drivers/staging/line6/pcm.h +++ b/drivers/staging/line6/pcm.h @@ -167,7 +167,7 @@ enum { #endif LINE6_BIT_PCM_ALSA_CAPTURE_STREAM | LINE6_BIT_PCM_MONITOR_CAPTURE_STREAM, - + LINE6_BITS_STREAM = LINE6_BITS_PLAYBACK_STREAM | LINE6_BITS_CAPTURE_STREAM diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c index a0ab9d0..4cf23af 100644 --- a/drivers/staging/line6/playback.c +++ b/drivers/staging/line6/playback.c @@ -185,7 +185,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) if (urb_size == 0) { /* can't determine URB size */ spin_unlock_irqrestore(&line6pcm->lock_audio_out, flags); - dev_err(line6pcm->line6->ifcdev, "driver bug: urb_size = 0\n"); /* this is somewhat paranoid */ + dev_err(line6pcm->line6->ifcdev, "driver bug: urb_size = 0\n"); return -EINVAL; } @@ -218,7 +218,8 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) len * bytes_per_frame, runtime->dma_area, (urb_frames - len) * bytes_per_frame); } else - dev_err(line6pcm->line6->ifcdev, "driver bug: len = %d\n", len); /* this is somewhat paranoid */ + dev_err(line6pcm->line6->ifcdev, "driver bug: len = %d\n", + len); } else { memcpy(urb_out->transfer_buffer, runtime->dma_area + @@ -319,7 +320,8 @@ void line6_unlink_audio_out_urbs(struct snd_line6_pcm *line6pcm) } /* - Wait until unlinking of all currently active playback URBs has been finished. + Wait until unlinking of all currently active playback URBs has been + finished. */ void line6_wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm) { @@ -413,7 +415,8 @@ static void audio_out_callback(struct urb *urb) if (!shutdown) { submit_audio_out_urb(line6pcm); - if (test_bit(LINE6_INDEX_PCM_ALSA_PLAYBACK_STREAM, &line6pcm->flags)) { + if (test_bit(LINE6_INDEX_PCM_ALSA_PLAYBACK_STREAM, + &line6pcm->flags)) { line6pcm->bytes_out += length; if (line6pcm->bytes_out >= line6pcm->period_out) { line6pcm->bytes_out %= line6pcm->period_out; @@ -499,7 +502,8 @@ int snd_line6_playback_trigger(struct snd_line6_pcm *line6pcm, int cmd) #ifdef CONFIG_PM case SNDRV_PCM_TRIGGER_RESUME: #endif - err = line6_pcm_acquire(line6pcm, LINE6_BIT_PCM_ALSA_PLAYBACK_STREAM); + err = line6_pcm_acquire(line6pcm, + LINE6_BIT_PCM_ALSA_PLAYBACK_STREAM); if (err < 0) return err; @@ -510,7 +514,8 @@ int snd_line6_playback_trigger(struct snd_line6_pcm *line6pcm, int cmd) #ifdef CONFIG_PM case SNDRV_PCM_TRIGGER_SUSPEND: #endif - err = line6_pcm_release(line6pcm, LINE6_BIT_PCM_ALSA_PLAYBACK_STREAM); + err = line6_pcm_release(line6pcm, + LINE6_BIT_PCM_ALSA_PLAYBACK_STREAM); if (err < 0) return err; diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index 9edd053..e542540 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -15,7 +15,6 @@ #include "audio.h" #include "capture.h" -#include "control.h" #include "driver.h" #include "playback.h" #include "pod.h" @@ -26,7 +25,6 @@ /* *INDENT-OFF* */ enum { - POD_SYSEX_CLIP = 0x0f, POD_SYSEX_SAVE = 0x24, POD_SYSEX_SYSTEM = 0x56, POD_SYSEX_SYSTEMREQ = 0x57, @@ -41,11 +39,6 @@ enum { enum { POD_monitor_level = 0x04, - POD_routing = 0x05, - POD_tuner_mute = 0x13, - POD_tuner_freq = 0x15, - POD_tuner_note = 0x16, - POD_tuner_pitch = 0x17, POD_system_invalid = 0x10000 }; @@ -118,10 +111,6 @@ static struct line6_pcm_properties pod_pcm_properties = { .bytes_per_frame = POD_BYTES_PER_FRAME }; -static const char pod_request_channel[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x03, 0x75, 0xf7 -}; - static const char pod_version_header[] = { 0xf2, 0x7e, 0x7f, 0x06, 0x02 }; @@ -129,18 +118,6 @@ static const char pod_version_header[] = { /* forward declarations: */ static void pod_startup2(unsigned long data); static void pod_startup3(struct usb_line6_pod *pod); -static void pod_startup4(struct usb_line6_pod *pod); - -/* - Mark all parameters as dirty and notify waiting processes. -*/ -static void pod_mark_batch_all_dirty(struct usb_line6_pod *pod) -{ - int i; - - for (i = 0; i < POD_CONTROL_SIZE; i++) - set_bit(i, pod->param_dirty); -} static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, int size) @@ -150,45 +127,6 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, } /* - Send channel dump data to the PODxt Pro. -*/ -static void pod_dump(struct usb_line6_pod *pod, const unsigned char *data) -{ - int size = 1 + sizeof(pod->prog_data); - char *sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_DUMP, size); - if (!sysex) - return; - /* Don't know what this is good for, but PODxt Pro transmits it, so we - * also do... */ - sysex[SYSEX_DATA_OFS] = 5; - memcpy(sysex + SYSEX_DATA_OFS + 1, data, sizeof(pod->prog_data)); - line6_send_sysex_message(&pod->line6, sysex, size); - memcpy(&pod->prog_data, data, sizeof(pod->prog_data)); - pod_mark_batch_all_dirty(pod); - kfree(sysex); -} - -/* - Store parameter value in driver memory and mark it as dirty. -*/ -static void pod_store_parameter(struct usb_line6_pod *pod, int param, int value) -{ - pod->prog_data.control[param] = value; - set_bit(param, pod->param_dirty); - pod->dirty = 1; -} - -/* - Handle SAVE button. -*/ -static void pod_save_button_pressed(struct usb_line6_pod *pod, int type, - int index) -{ - pod->dirty = 0; - set_bit(POD_SAVE_PRESSED, &pod->atomic_flags); -} - -/* Process a completely received message. */ void line6_pod_process_message(struct usb_line6_pod *pod) @@ -209,25 +147,11 @@ void line6_pod_process_message(struct usb_line6_pod *pod) /* process all remaining messages */ switch (buf[0]) { case LINE6_PARAM_CHANGE | LINE6_CHANNEL_DEVICE: - pod_store_parameter(pod, buf[1], buf[2]); - /* intentionally no break here! */ - case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - if ((buf[1] == POD_amp_model_setup) || - (buf[1] == POD_effect_setup)) - /* these also affect other settings */ - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); - break; case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - pod->channel_num = buf[1]; - pod->dirty = 0; - set_bit(POD_CHANNEL_DIRTY, &pod->atomic_flags); - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); break; case LINE6_SYSEX_BEGIN | LINE6_CHANNEL_DEVICE: @@ -235,43 +159,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { switch (buf[5]) { case POD_SYSEX_DUMP: - if (pod->line6.message_length == - sizeof(pod->prog_data) + 7) { - switch (pod->dumpreq.in_progress) { - case LINE6_DUMP_CURRENT: - memcpy(&pod->prog_data, buf + 7, - sizeof(pod->prog_data)); - pod_mark_batch_all_dirty(pod); - break; - - case POD_DUMP_MEMORY: - memcpy(&pod->prog_data_buf, - buf + 7, - sizeof - (pod->prog_data_buf)); - break; - - default: - DEBUG_MESSAGES(dev_err - (pod-> - line6.ifcdev, - "unknown dump code %02X\n", - pod-> - dumpreq.in_progress)); - } - - line6_dump_finished(&pod->dumpreq); - pod_startup3(pod); - } else - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "wrong size of channel dump message (%d instead of %d)\n", - pod-> - line6.message_length, - (int) - sizeof(pod->prog_data) + - 7)); - break; case POD_SYSEX_SYSTEM:{ @@ -280,35 +167,8 @@ void line6_pod_process_message(struct usb_line6_pod *pod) << 8) | ((int)buf[9] << 4) | (int)buf[10]; -#define PROCESS_SYSTEM_PARAM(x) \ - case POD_ ## x: \ - pod->x.value = value; \ - wake_up(&pod->x.wait); \ - break; - - switch (buf[6]) { - PROCESS_SYSTEM_PARAM - (monitor_level); - PROCESS_SYSTEM_PARAM(routing); - PROCESS_SYSTEM_PARAM - (tuner_mute); - PROCESS_SYSTEM_PARAM - (tuner_freq); - PROCESS_SYSTEM_PARAM - (tuner_note); - PROCESS_SYSTEM_PARAM - (tuner_pitch); - -#undef PROCESS_SYSTEM_PARAM - - default: - DEBUG_MESSAGES(dev_err - (pod-> - line6.ifcdev, - "unknown tuner/system response %02X\n", - buf[6])); - } - + if (buf[6] == POD_monitor_level) + pod->monitor_level = value; break; } @@ -317,29 +177,18 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; case POD_SYSEX_SAVE: - pod_save_button_pressed(pod, buf[6], buf[7]); - break; - - case POD_SYSEX_CLIP: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "audio clipped\n")); - pod->clipping.value = 1; - wake_up(&pod->clipping.wait); break; case POD_SYSEX_STORE: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "message %02X not yet implemented\n", - buf[5])); + dev_dbg(pod->line6.ifcdev, + "message %02X not yet implemented\n", + buf[5]); break; default: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "unknown sysex message %02X\n", - buf[5])); + dev_dbg(pod->line6.ifcdev, + "unknown sysex message %02X\n", + buf[5]); } } else if (memcmp @@ -350,11 +199,9 @@ void line6_pod_process_message(struct usb_line6_pod *pod) pod->device_id = ((int)buf[8] << 16) | ((int)buf[9] << 8) | (int) buf[10]; - pod_startup4(pod); + pod_startup3(pod); } else - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "unknown sysex header\n")); + dev_dbg(pod->line6.ifcdev, "unknown sysex header\n"); break; @@ -362,349 +209,22 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; default: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "POD: unknown message %02X\n", buf[0])); + dev_dbg(pod->line6.ifcdev, "POD: unknown message %02X\n", + buf[0]); } } /* - Detect some cases that require a channel dump after sending a command to the - device. Important notes: - *) The actual dump request can not be sent here since we are not allowed to - wait for the completion of the first message in this context, and sending - the dump request before completion of the previous message leaves the POD - in an undefined state. The dump request will be sent when the echoed - commands are received. - *) This method fails if a param change message is "chopped" after the first - byte. -*/ -void line6_pod_midi_postprocess(struct usb_line6_pod *pod, unsigned char *data, - int length) -{ - int i; - - if (!pod->midi_postprocess) - return; - - for (i = 0; i < length; ++i) { - if (data[i] == (LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST)) { - line6_invalidate_current(&pod->dumpreq); - break; - } else - if ((data[i] == (LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST)) - && (i < length - 1)) - if ((data[i + 1] == POD_amp_model_setup) - || (data[i + 1] == POD_effect_setup)) { - line6_invalidate_current(&pod->dumpreq); - break; - } - } -} - -/* - Send channel number (i.e., switch to a different sound). -*/ -static void pod_send_channel(struct usb_line6_pod *pod, u8 value) -{ - line6_invalidate_current(&pod->dumpreq); - - if (line6_send_program(&pod->line6, value) == 0) - pod->channel_num = value; - else - line6_dump_finished(&pod->dumpreq); -} - -/* Transmit PODxt Pro control parameter. */ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, u8 value) { - if (line6_transmit_parameter(&pod->line6, param, value) == 0) - pod_store_parameter(pod, param, value); - - if ((param == POD_amp_model_setup) || (param == POD_effect_setup)) /* these also affect other settings */ - line6_invalidate_current(&pod->dumpreq); -} - -/* - Resolve value to memory location. -*/ -static int pod_resolve(const char *buf, short block0, short block1, - unsigned char *location) -{ - u8 value; - short block; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - block = (value < 0x40) ? block0 : block1; - value &= 0x3f; - location[0] = block >> 7; - location[1] = value | (block & 0x7f); - return 0; -} - -/* - Send command to store channel/effects setup/amp setup to PODxt Pro. -*/ -static ssize_t pod_send_store_command(struct device *dev, const char *buf, - size_t count, short block0, short block1) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int ret; - int size = 3 + sizeof(pod->prog_data_buf); - char *sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_STORE, size); - - if (!sysex) - return 0; - - sysex[SYSEX_DATA_OFS] = 5; /* see pod_dump() */ - ret = pod_resolve(buf, block0, block1, sysex + SYSEX_DATA_OFS + 1); - if (ret) { - kfree(sysex); - return ret; - } - - memcpy(sysex + SYSEX_DATA_OFS + 3, &pod->prog_data_buf, - sizeof(pod->prog_data_buf)); - - line6_send_sysex_message(&pod->line6, sysex, size); - kfree(sysex); - /* needs some delay here on AMD64 platform */ - return count; -} - -/* - Send command to retrieve channel/effects setup/amp setup to PODxt Pro. -*/ -static ssize_t pod_send_retrieve_command(struct device *dev, const char *buf, - size_t count, short block0, - short block1) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int ret; - int size = 4; - char *sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_DUMPMEM, size); - - if (!sysex) - return 0; - - ret = pod_resolve(buf, block0, block1, sysex + SYSEX_DATA_OFS); - if (ret) { - kfree(sysex); - return ret; - } - sysex[SYSEX_DATA_OFS + 2] = 0; - sysex[SYSEX_DATA_OFS + 3] = 0; - line6_dump_started(&pod->dumpreq, POD_DUMP_MEMORY); - - if (line6_send_sysex_message(&pod->line6, sysex, size) < size) - line6_dump_finished(&pod->dumpreq); - - kfree(sysex); - /* needs some delay here on AMD64 platform */ - return count; -} - -/* - Generic get name function. -*/ -static ssize_t get_name_generic(struct usb_line6_pod *pod, const char *str, - char *buf) -{ - int length = 0; - const char *p1; - char *p2; - char *last_non_space = buf; - - int retval = line6_dump_wait_interruptible(&pod->dumpreq); - if (retval < 0) - return retval; - - for (p1 = str, p2 = buf; *p1; ++p1, ++p2) { - *p2 = *p1; - if (*p2 != ' ') - last_non_space = p2; - if (++length == POD_NAME_LENGTH) - break; - } - - *(last_non_space + 1) = '\n'; - return last_non_space - buf + 2; -} - -/* - "read" request on "channel" special file. -*/ -static ssize_t pod_get_channel(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - return sprintf(buf, "%d\n", pod->channel_num); -} - -/* - "write" request on "channel" special file. -*/ -static ssize_t pod_set_channel(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - pod_send_channel(pod, value); - return count; -} - -/* - "read" request on "name" special file. -*/ -static ssize_t pod_get_name(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - return get_name_generic(pod, pod->prog_data.header + POD_NAME_OFFSET, - buf); -} - -/* - "read" request on "name" special file. -*/ -static ssize_t pod_get_name_buf(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - return get_name_generic(pod, - pod->prog_data_buf.header + POD_NAME_OFFSET, - buf); -} - -/* - "read" request on "dump" special file. -*/ -static ssize_t pod_get_dump(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&pod->dumpreq); - if (retval < 0) - return retval; - memcpy(buf, &pod->prog_data, sizeof(pod->prog_data)); - return sizeof(pod->prog_data); -} - -/* - "write" request on "dump" special file. -*/ -static ssize_t pod_set_dump(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - - if (count != sizeof(pod->prog_data)) { - dev_err(pod->line6.ifcdev, - "data block must be exactly %d bytes\n", - (int)sizeof(pod->prog_data)); - return -EINVAL; - } - - pod_dump(pod, buf); - return sizeof(pod->prog_data); -} - -/* - Identify system parameters related to the tuner. -*/ -static bool pod_is_tuner(int code) -{ - return - (code == POD_tuner_mute) || - (code == POD_tuner_freq) || - (code == POD_tuner_note) || (code == POD_tuner_pitch); -} - -/* - Get system parameter (as integer). - @param tuner non-zero, if code refers to a tuner parameter -*/ -static int pod_get_system_param_int(struct usb_line6_pod *pod, int *value, - int code, struct ValueWait *param, int sign) -{ - char *sysex; - static const int size = 1; - int retval = 0; - - if (((pod->prog_data.control[POD_tuner] & 0x40) == 0) - && pod_is_tuner(code)) - return -ENODEV; - - /* send value request to device: */ - param->value = POD_system_invalid; - sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_SYSTEMREQ, size); - - if (!sysex) - return -ENOMEM; - - sysex[SYSEX_DATA_OFS] = code; - line6_send_sysex_message(&pod->line6, sysex, size); - kfree(sysex); - - /* wait for device to respond: */ - retval = - wait_event_interruptible(param->wait, - param->value != POD_system_invalid); - - if (retval < 0) - return retval; - - *value = sign ? (int)(signed short)param->value : (int)(unsigned short) - param->value; - - if (*value == POD_system_invalid) - *value = 0; /* don't report uninitialized values */ - - return 0; -} - -/* - Get system parameter (as string). - @param tuner non-zero, if code refers to a tuner parameter -*/ -static ssize_t pod_get_system_param_string(struct usb_line6_pod *pod, char *buf, - int code, struct ValueWait *param, - int sign) -{ - int retval, value = 0; - retval = pod_get_system_param_int(pod, &value, code, param, sign); - - if (retval < 0) - return retval; - - return sprintf(buf, "%d\n", value); + line6_transmit_parameter(&pod->line6, param, value); } /* Send system parameter (from integer). - @param tuner non-zero, if code refers to a tuner parameter */ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, int code) @@ -712,11 +232,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, char *sysex; static const int size = 5; - if (((pod->prog_data.control[POD_tuner] & 0x40) == 0) - && pod_is_tuner(code)) - return -EINVAL; - - /* send value to tuner: */ sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_SYSTEM, size); if (!sysex) return -ENOMEM; @@ -731,179 +246,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, } /* - Send system parameter (from string). - @param tuner non-zero, if code refers to a tuner parameter -*/ -static ssize_t pod_set_system_param_string(struct usb_line6_pod *pod, - const char *buf, int count, int code, - unsigned short mask) -{ - int retval; - unsigned short value = simple_strtoul(buf, NULL, 10) & mask; - retval = pod_set_system_param_int(pod, value, code); - return (retval < 0) ? retval : count; -} - -/* - "read" request on "dump_buf" special file. -*/ -static ssize_t pod_get_dump_buf(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&pod->dumpreq); - if (retval < 0) - return retval; - memcpy(buf, &pod->prog_data_buf, sizeof(pod->prog_data_buf)); - return sizeof(pod->prog_data_buf); -} - -/* - "write" request on "dump_buf" special file. -*/ -static ssize_t pod_set_dump_buf(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - - if (count != sizeof(pod->prog_data)) { - dev_err(pod->line6.ifcdev, - "data block must be exactly %d bytes\n", - (int)sizeof(pod->prog_data)); - return -EINVAL; - } - - memcpy(&pod->prog_data_buf, buf, sizeof(pod->prog_data)); - return sizeof(pod->prog_data); -} - -/* - "write" request on "finish" special file. -*/ -static ssize_t pod_set_finish(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int size = 0; - char *sysex = pod_alloc_sysex_buffer(pod, POD_SYSEX_FINISH, size); - if (!sysex) - return 0; - line6_send_sysex_message(&pod->line6, sysex, size); - kfree(sysex); - return count; -} - -/* - "write" request on "store_channel" special file. -*/ -static ssize_t pod_set_store_channel(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_store_command(dev, buf, count, 0x0000, 0x00c0); -} - -/* - "write" request on "store_effects_setup" special file. -*/ -static ssize_t pod_set_store_effects_setup(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_store_command(dev, buf, count, 0x0080, 0x0080); -} - -/* - "write" request on "store_amp_setup" special file. -*/ -static ssize_t pod_set_store_amp_setup(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_store_command(dev, buf, count, 0x0040, 0x0100); -} - -/* - "write" request on "retrieve_channel" special file. -*/ -static ssize_t pod_set_retrieve_channel(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_retrieve_command(dev, buf, count, 0x0000, 0x00c0); -} - -/* - "write" request on "retrieve_effects_setup" special file. -*/ -static ssize_t pod_set_retrieve_effects_setup(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_retrieve_command(dev, buf, count, 0x0080, 0x0080); -} - -/* - "write" request on "retrieve_amp_setup" special file. -*/ -static ssize_t pod_set_retrieve_amp_setup(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return pod_send_retrieve_command(dev, buf, count, 0x0040, 0x0100); -} - -/* - "read" request on "dirty" special file. -*/ -static ssize_t pod_get_dirty(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - buf[0] = pod->dirty ? '1' : '0'; - buf[1] = '\n'; - return 2; -} - -/* - "read" request on "midi_postprocess" special file. -*/ -static ssize_t pod_get_midi_postprocess(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - return sprintf(buf, "%d\n", pod->midi_postprocess); -} - -/* - "write" request on "midi_postprocess" special file. -*/ -static ssize_t pod_set_midi_postprocess(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - pod->midi_postprocess = value ? 1 : 0; - return count; -} - -/* "read" request on "serial_number" special file. */ static ssize_t pod_get_serial_number(struct device *dev, @@ -939,18 +281,6 @@ static ssize_t pod_get_device_id(struct device *dev, } /* - "read" request on "clip" special file. -*/ -static ssize_t pod_wait_for_clip(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - return wait_event_interruptible(pod->clipping.wait, - pod->clipping.value != 0); -} - -/* POD startup procedure. This is a sequence of functions with special requirements (e.g., must not run immediately after initialization, must not run in interrupt @@ -969,22 +299,6 @@ static void pod_startup1(struct usb_line6_pod *pod) static void pod_startup2(unsigned long data) { struct usb_line6_pod *pod = (struct usb_line6_pod *)data; - - /* schedule another startup procedure until startup is complete: */ - if (pod->startup_progress >= POD_STARTUP_LAST) - return; - - pod->startup_progress = POD_STARTUP_DUMPREQ; - line6_start_timer(&pod->startup_timer, POD_STARTUP_DELAY, pod_startup2, - (unsigned long)pod); - - /* current channel dump: */ - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); -} - -static void pod_startup3(struct usb_line6_pod *pod) -{ struct usb_line6 *line6 = &pod->line6; CHECK_STARTUP_PROGRESS(pod->startup_progress, POD_STARTUP_VERSIONREQ); @@ -992,7 +306,7 @@ static void pod_startup3(struct usb_line6_pod *pod) line6_version_request_async(line6); } -static void pod_startup4(struct usb_line6_pod *pod) +static void pod_startup3(struct usb_line6_pod *pod) { CHECK_STARTUP_PROGRESS(pod->startup_progress, POD_STARTUP_WORKQUEUE); @@ -1000,7 +314,7 @@ static void pod_startup4(struct usb_line6_pod *pod) schedule_work(&pod->startup_work); } -static void pod_startup5(struct work_struct *work) +static void pod_startup4(struct work_struct *work) { struct usb_line6_pod *pod = container_of(work, struct usb_line6_pod, startup_work); @@ -1013,87 +327,14 @@ static void pod_startup5(struct work_struct *work) /* ALSA audio interface: */ line6_register_audio(line6); - - /* device files: */ - line6_pod_create_files(pod->firmware_version, - line6->properties->device_bit, line6->ifcdev); -} - -#define POD_GET_SYSTEM_PARAM(code, sign) \ -static ssize_t pod_get_ ## code(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - struct usb_interface *interface = to_usb_interface(dev); \ - struct usb_line6_pod *pod = usb_get_intfdata(interface); \ - return pod_get_system_param_string(pod, buf, POD_ ## code, \ - &pod->code, sign); \ -} - -#define POD_GET_SET_SYSTEM_PARAM(code, mask, sign) \ -POD_GET_SYSTEM_PARAM(code, sign) \ -static ssize_t pod_set_ ## code(struct device *dev, \ - struct device_attribute *attr, \ - const char *buf, size_t count) \ -{ \ - struct usb_interface *interface = to_usb_interface(dev); \ - struct usb_line6_pod *pod = usb_get_intfdata(interface); \ - return pod_set_system_param_string(pod, buf, count, POD_ ## code, mask); \ } -POD_GET_SET_SYSTEM_PARAM(monitor_level, 0xffff, 0); -POD_GET_SET_SYSTEM_PARAM(routing, 0x0003, 0); -POD_GET_SET_SYSTEM_PARAM(tuner_mute, 0x0001, 0); -POD_GET_SET_SYSTEM_PARAM(tuner_freq, 0xffff, 0); -POD_GET_SYSTEM_PARAM(tuner_note, 1); -POD_GET_SYSTEM_PARAM(tuner_pitch, 1); - -#undef GET_SET_SYSTEM_PARAM -#undef GET_SYSTEM_PARAM - /* POD special files: */ -static DEVICE_ATTR(channel, S_IWUSR | S_IRUGO, pod_get_channel, - pod_set_channel); -static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); -static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); -static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump); -static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, - pod_set_dump_buf); -static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish); static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); -static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, - pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(monitor_level, S_IWUSR | S_IRUGO, pod_get_monitor_level, - pod_set_monitor_level); -static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); -static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); -static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, - pod_set_retrieve_amp_setup); -static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read, - pod_set_retrieve_channel); -static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read, - pod_set_retrieve_effects_setup); -static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, - pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(store_amp_setup, S_IWUSR, line6_nop_read, - pod_set_store_amp_setup); -static DEVICE_ATTR(store_channel, S_IWUSR, line6_nop_read, - pod_set_store_channel); -static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read, - pod_set_store_effects_setup); -static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq, - pod_set_tuner_freq); -static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, - pod_set_tuner_mute); -static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write); -static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write); - -#ifdef CONFIG_LINE6_USB_RAW -static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); -#endif /* control info callback */ static int snd_pod_control_monitor_info(struct snd_kcontrol *kcontrol, @@ -1112,7 +353,7 @@ static int snd_pod_control_monitor_get(struct snd_kcontrol *kcontrol, { struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); struct usb_line6_pod *pod = (struct usb_line6_pod *)line6pcm->line6; - ucontrol->value.integer.value[0] = pod->monitor_level.value; + ucontrol->value.integer.value[0] = pod->monitor_level; return 0; } @@ -1123,10 +364,10 @@ static int snd_pod_control_monitor_put(struct snd_kcontrol *kcontrol, struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); struct usb_line6_pod *pod = (struct usb_line6_pod *)line6pcm->line6; - if (ucontrol->value.integer.value[0] == pod->monitor_level.value) + if (ucontrol->value.integer.value[0] == pod->monitor_level) return 0; - pod->monitor_level.value = ucontrol->value.integer.value[0]; + pod->monitor_level = ucontrol->value.integer.value[0]; pod_set_system_param_int(pod, ucontrol->value.integer.value[0], POD_monitor_level); return 1; @@ -1156,9 +397,6 @@ static void pod_destruct(struct usb_interface *interface) del_timer(&pod->startup_timer); cancel_work_sync(&pod->startup_work); - - /* free dump request data: */ - line6_dumpreq_destruct(&pod->dumpreq); } /* @@ -1168,35 +406,9 @@ static int pod_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_channel)); - CHECK_RETURN(device_create_file(dev, &dev_attr_clip)); CHECK_RETURN(device_create_file(dev, &dev_attr_device_id)); - CHECK_RETURN(device_create_file(dev, &dev_attr_dirty)); - CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_dump_buf)); - CHECK_RETURN(device_create_file(dev, &dev_attr_finish)); CHECK_RETURN(device_create_file(dev, &dev_attr_firmware_version)); - CHECK_RETURN(device_create_file(dev, &dev_attr_midi_postprocess)); - CHECK_RETURN(device_create_file(dev, &dev_attr_monitor_level)); - CHECK_RETURN(device_create_file(dev, &dev_attr_name)); - CHECK_RETURN(device_create_file(dev, &dev_attr_name_buf)); - CHECK_RETURN(device_create_file(dev, &dev_attr_retrieve_amp_setup)); - CHECK_RETURN(device_create_file(dev, &dev_attr_retrieve_channel)); - CHECK_RETURN(device_create_file(dev, &dev_attr_retrieve_effects_setup)); - CHECK_RETURN(device_create_file(dev, &dev_attr_routing)); CHECK_RETURN(device_create_file(dev, &dev_attr_serial_number)); - CHECK_RETURN(device_create_file(dev, &dev_attr_store_amp_setup)); - CHECK_RETURN(device_create_file(dev, &dev_attr_store_channel)); - CHECK_RETURN(device_create_file(dev, &dev_attr_store_effects_setup)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner_freq)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner_mute)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner_note)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner_pitch)); - -#ifdef CONFIG_LINE6_USB_RAW - CHECK_RETURN(device_create_file(dev, &dev_attr_raw)); -#endif - return 0; } @@ -1210,32 +422,11 @@ static int pod_try_init(struct usb_interface *interface, struct usb_line6 *line6 = &pod->line6; init_timer(&pod->startup_timer); - INIT_WORK(&pod->startup_work, pod_startup5); + INIT_WORK(&pod->startup_work, pod_startup4); if ((interface == NULL) || (pod == NULL)) return -ENODEV; - pod->channel_num = 255; - - /* initialize wait queues: */ - init_waitqueue_head(&pod->monitor_level.wait); - init_waitqueue_head(&pod->routing.wait); - init_waitqueue_head(&pod->tuner_mute.wait); - init_waitqueue_head(&pod->tuner_freq.wait); - init_waitqueue_head(&pod->tuner_note.wait); - init_waitqueue_head(&pod->tuner_pitch.wait); - init_waitqueue_head(&pod->clipping.wait); - - memset(pod->param_dirty, 0xff, sizeof(pod->param_dirty)); - - /* initialize USB buffers: */ - err = line6_dumpreq_init(&pod->dumpreq, pod_request_channel, - sizeof(pod_request_channel)); - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return -ENOMEM; - } - /* create sysfs entries: */ err = pod_create_files2(&interface->dev); if (err < 0) @@ -1269,7 +460,7 @@ static int pod_try_init(struct usb_interface *interface, */ if (pod->line6.properties->capabilities & LINE6_BIT_CONTROL) { - pod->monitor_level.value = POD_system_invalid; + pod->monitor_level = POD_system_invalid; /* initiate startup procedure: */ pod_startup1(pod); @@ -1311,39 +502,9 @@ void line6_pod_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ - line6_pod_remove_files(pod->firmware_version, - pod->line6. - properties->device_bit, dev); - - device_remove_file(dev, &dev_attr_channel); - device_remove_file(dev, &dev_attr_clip); device_remove_file(dev, &dev_attr_device_id); - device_remove_file(dev, &dev_attr_dirty); - device_remove_file(dev, &dev_attr_dump); - device_remove_file(dev, &dev_attr_dump_buf); - device_remove_file(dev, &dev_attr_finish); device_remove_file(dev, &dev_attr_firmware_version); - device_remove_file(dev, &dev_attr_midi_postprocess); - device_remove_file(dev, &dev_attr_monitor_level); - device_remove_file(dev, &dev_attr_name); - device_remove_file(dev, &dev_attr_name_buf); - device_remove_file(dev, &dev_attr_retrieve_amp_setup); - device_remove_file(dev, &dev_attr_retrieve_channel); - device_remove_file(dev, - &dev_attr_retrieve_effects_setup); - device_remove_file(dev, &dev_attr_routing); device_remove_file(dev, &dev_attr_serial_number); - device_remove_file(dev, &dev_attr_store_amp_setup); - device_remove_file(dev, &dev_attr_store_channel); - device_remove_file(dev, &dev_attr_store_effects_setup); - device_remove_file(dev, &dev_attr_tuner_freq); - device_remove_file(dev, &dev_attr_tuner_mute); - device_remove_file(dev, &dev_attr_tuner_note); - device_remove_file(dev, &dev_attr_tuner_pitch); - -#ifdef CONFIG_LINE6_USB_RAW - device_remove_file(dev, &dev_attr_raw); -#endif } } diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h index 47e0d1a..3e3f167 100644 --- a/drivers/staging/line6/pod.h +++ b/drivers/staging/line6/pod.h @@ -15,12 +15,10 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/usb.h> -#include <linux/wait.h> #include <sound/core.h> #include "driver.h" -#include "dumprequest.h" /* PODxt Live interfaces @@ -46,37 +44,12 @@ */ enum { POD_STARTUP_INIT = 1, - POD_STARTUP_DUMPREQ, POD_STARTUP_VERSIONREQ, POD_STARTUP_WORKQUEUE, POD_STARTUP_SETUP, POD_STARTUP_LAST = POD_STARTUP_SETUP - 1 }; -/** - Data structure for values that need to be requested explicitly. - This is the case for system and tuner settings. -*/ -struct ValueWait { - int value; - wait_queue_head_t wait; -}; - -/** - Binary PODxt Pro program dump -*/ -struct pod_program { - /** - Header information (including program name). - */ - unsigned char header[0x20]; - - /** - Program parameters. - */ - unsigned char control[POD_CONTROL_SIZE]; -}; - struct usb_line6_pod { /** Generic Line6 USB data. @@ -84,63 +57,9 @@ struct usb_line6_pod { struct usb_line6 line6; /** - Dump request structure. - */ - struct line6_dump_request dumpreq; - - /** - Current program number. - */ - unsigned char channel_num; - - /** - Current program settings. - */ - struct pod_program prog_data; - - /** - Buffer for data retrieved from or to be stored on PODxt Pro. - */ - struct pod_program prog_data_buf; - - /** - Tuner mute mode. - */ - struct ValueWait tuner_mute; - - /** - Tuner base frequency (typically 440Hz). - */ - struct ValueWait tuner_freq; - - /** - Note received from tuner. - */ - struct ValueWait tuner_note; - - /** - Pitch value received from tuner. - */ - struct ValueWait tuner_pitch; - - /** Instrument monitor level. */ - struct ValueWait monitor_level; - - /** - Audio routing mode. - 0: send processed guitar - 1: send clean guitar - 2: send clean guitar re-amp playback - 3: send re-amp playback - */ - struct ValueWait routing; - - /** - Wait for audio clipping event. - */ - struct ValueWait clipping; + int monitor_level; /** Timer for device initializaton. @@ -158,16 +77,6 @@ struct usb_line6_pod { int startup_progress; /** - Dirty flags for access to parameter data. - */ - unsigned long param_dirty[POD_CONTROL_SIZE / sizeof(unsigned long)]; - - /** - Some atomic flags. - */ - unsigned long atomic_flags; - - /** Serial number of device. */ int serial_number; @@ -181,23 +90,11 @@ struct usb_line6_pod { Device ID. */ int device_id; - - /** - Flag to indicate modification of current program settings. - */ - char dirty; - - /** - Flag to enable MIDI postprocessing. - */ - char midi_postprocess; }; extern void line6_pod_disconnect(struct usb_interface *interface); extern int line6_pod_init(struct usb_interface *interface, struct usb_line6_pod *pod); -extern void line6_pod_midi_postprocess(struct usb_line6_pod *pod, - unsigned char *data, int length); extern void line6_pod_process_message(struct usb_line6_pod *pod); extern void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, u8 value); diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index 31b624b..a529dd3 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c @@ -127,13 +127,11 @@ static ssize_t toneport_set_led_red(struct device *dev, const char *buf, size_t count) { int retval; - long value; - retval = strict_strtol(buf, 10, &value); + retval = kstrtoint(buf, 10, &led_red); if (retval) return retval; - led_red = value; toneport_update_led(dev); return count; } @@ -143,13 +141,11 @@ static ssize_t toneport_set_led_green(struct device *dev, const char *buf, size_t count) { int retval; - long value; - retval = strict_strtol(buf, 10, &value); + retval = kstrtoint(buf, 10, &led_green); if (retval) return retval; - led_green = value; toneport_update_led(dev); return count; } diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbdefs.h index 353d59d..43eb540 100644 --- a/drivers/staging/line6/usbdefs.h +++ b/drivers/staging/line6/usbdefs.h @@ -83,11 +83,15 @@ enum { LINE6_BIT(VARIAX), LINE6_BITS_PRO = LINE6_BIT_BASSPODXTPRO | LINE6_BIT_PODXTPRO, - LINE6_BITS_LIVE = LINE6_BIT_BASSPODXTLIVE | LINE6_BIT_PODXTLIVE | LINE6_BIT_PODX3LIVE, - LINE6_BITS_PODXTALL = LINE6_BIT_PODXT | LINE6_BIT_PODXTLIVE | LINE6_BIT_PODXTPRO, + LINE6_BITS_LIVE = LINE6_BIT_BASSPODXTLIVE | LINE6_BIT_PODXTLIVE | + LINE6_BIT_PODX3LIVE, + LINE6_BITS_PODXTALL = LINE6_BIT_PODXT | LINE6_BIT_PODXTLIVE | + LINE6_BIT_PODXTPRO, LINE6_BITS_PODX3ALL = LINE6_BIT_PODX3 | LINE6_BIT_PODX3LIVE, LINE6_BITS_PODHDALL = LINE6_BIT_PODHD300 | LINE6_BIT_PODHD500, - LINE6_BITS_BASSPODXTALL = LINE6_BIT_BASSPODXT | LINE6_BIT_BASSPODXTLIVE | LINE6_BIT_BASSPODXTPRO + LINE6_BITS_BASSPODXTALL = LINE6_BIT_BASSPODXT | + LINE6_BIT_BASSPODXTLIVE | + LINE6_BIT_BASSPODXTPRO }; /* device supports settings parameter via USB */ diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index f97416b..4fca58f 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -12,28 +12,13 @@ #include <linux/slab.h> #include "audio.h" -#include "control.h" #include "driver.h" #include "variax.h" -#define VARIAX_SYSEX_CODE 7 -#define VARIAX_SYSEX_PARAM 0x3b -#define VARIAX_SYSEX_ACTIVATE 0x2a -#define VARIAX_MODEL_HEADER_LENGTH 7 -#define VARIAX_MODEL_MESSAGE_LENGTH 199 #define VARIAX_OFFSET_ACTIVATE 7 /* This message is sent by the device during initialization and identifies - the connected guitar model. -*/ -static const char variax_init_model[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x69, 0x02, - 0x00 -}; - -/* - This message is sent by the device during initialization and identifies the connected guitar version. */ static const char variax_init_version[] = { @@ -53,43 +38,11 @@ static const char variax_activate[] = { 0xf7 }; -static const char variax_request_bank[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x6d, 0xf7 -}; - -static const char variax_request_model1[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x3c, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x03, - 0x00, 0x00, 0x00, 0xf7 -}; - -static const char variax_request_model2[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x3c, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x03, - 0x00, 0x00, 0x00, 0xf7 -}; - /* forward declarations: */ -static int variax_create_files2(struct device *dev); static void variax_startup2(unsigned long data); static void variax_startup4(unsigned long data); static void variax_startup5(unsigned long data); -/* - Decode data transmitted by workbench. -*/ -static void variax_decode(const unsigned char *raw_data, unsigned char *data, - int raw_size) -{ - for (; raw_size > 0; raw_size -= 6) { - data[2] = raw_data[0] | (raw_data[1] << 4); - data[1] = raw_data[2] | (raw_data[3] << 4); - data[0] = raw_data[4] | (raw_data[5] << 4); - raw_data += 6; - data += 3; - } -} - static void variax_activate_async(struct usb_line6_variax *variax, int a) { variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = a; @@ -155,37 +108,21 @@ static void variax_startup5(unsigned long data) { struct usb_line6_variax *variax = (struct usb_line6_variax *)data; CHECK_STARTUP_PROGRESS(variax->startup_progress, - VARIAX_STARTUP_DUMPREQ); - - /* current model dump: */ - line6_dump_request_async(&variax->dumpreq, &variax->line6, 0, - VARIAX_DUMP_PASS1); - /* passes 2 and 3 are performed implicitly before entering variax_startup6 */ -} - -static void variax_startup6(struct usb_line6_variax *variax) -{ - CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_WORKQUEUE); /* schedule work for global work queue: */ schedule_work(&variax->startup_work); } -static void variax_startup7(struct work_struct *work) +static void variax_startup6(struct work_struct *work) { struct usb_line6_variax *variax = container_of(work, struct usb_line6_variax, startup_work); - struct usb_line6 *line6 = &variax->line6; CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_SETUP); /* ALSA audio interface: */ line6_register_audio(&variax->line6); - - /* device files: */ - line6_variax_create_files(0, 0, line6->ifcdev); - variax_create_files2(line6->ifcdev); } /* @@ -197,22 +134,10 @@ void line6_variax_process_message(struct usb_line6_variax *variax) switch (buf[0]) { case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - switch (buf[1]) { - case VARIAXMIDI_volume: - variax->volume = buf[2]; - break; - - case VARIAXMIDI_tone: - variax->tone = buf[2]; - } - break; case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - variax->model = buf[1]; - line6_dump_request_async(&variax->dumpreq, &variax->line6, 0, - VARIAX_DUMP_PASS1); break; case LINE6_RESET: @@ -220,352 +145,25 @@ void line6_variax_process_message(struct usb_line6_variax *variax) break; case LINE6_SYSEX_BEGIN: - if (memcmp(buf + 1, variax_request_model1 + 1, - VARIAX_MODEL_HEADER_LENGTH - 1) == 0) { - if (variax->line6.message_length == - VARIAX_MODEL_MESSAGE_LENGTH) { - switch (variax->dumpreq.in_progress) { - case VARIAX_DUMP_PASS1: - variax_decode(buf + - VARIAX_MODEL_HEADER_LENGTH, - (unsigned char *) - &variax->model_data, - (sizeof - (variax->model_data. - name) + - sizeof(variax-> - model_data. - control) - / 2) * 2); - line6_dump_request_async - (&variax->dumpreq, &variax->line6, - 1, VARIAX_DUMP_PASS2); - break; - - case VARIAX_DUMP_PASS2: - /* model name is transmitted twice, so skip it here: */ - variax_decode(buf + - VARIAX_MODEL_HEADER_LENGTH, - (unsigned char *) - &variax-> - model_data.control + - sizeof(variax->model_data. - control) - / 2, - sizeof(variax->model_data. - control) - / 2 * 2); - line6_dump_request_async - (&variax->dumpreq, &variax->line6, - 2, VARIAX_DUMP_PASS3); - } - } else { - DEBUG_MESSAGES(dev_err - (variax->line6.ifcdev, - "illegal length %d of model data\n", - variax->line6.message_length)); - line6_dump_finished(&variax->dumpreq); - } - } else if (memcmp(buf + 1, variax_request_bank + 1, - sizeof(variax_request_bank) - 2) == 0) { - memcpy(variax->bank, - buf + sizeof(variax_request_bank) - 1, - sizeof(variax->bank)); - line6_dump_finished(&variax->dumpreq); - variax_startup6(variax); - } else if (memcmp(buf + 1, variax_init_model + 1, - sizeof(variax_init_model) - 1) == 0) { - memcpy(variax->guitar, - buf + sizeof(variax_init_model), - sizeof(variax->guitar)); - } else if (memcmp(buf + 1, variax_init_version + 1, - sizeof(variax_init_version) - 1) == 0) { + if (memcmp(buf + 1, variax_init_version + 1, + sizeof(variax_init_version) - 1) == 0) { variax_startup3(variax); } else if (memcmp(buf + 1, variax_init_done + 1, sizeof(variax_init_done) - 1) == 0) { /* notify of complete initialization: */ variax_startup4((unsigned long)variax); } - break; case LINE6_SYSEX_END: break; default: - DEBUG_MESSAGES(dev_err - (variax->line6.ifcdev, - "Variax: unknown message %02X\n", buf[0])); - } -} - -/* - "read" request on "volume" special file. -*/ -static ssize_t variax_get_volume(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", variax->volume); -} - -/* - "write" request on "volume" special file. -*/ -static ssize_t variax_set_volume(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_volume, - value) == 0) - variax->volume = value; - - return count; -} - -/* - "read" request on "model" special file. -*/ -static ssize_t variax_get_model(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", variax->model); -} - -/* - "write" request on "model" special file. -*/ -static ssize_t variax_set_model(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - if (line6_send_program(&variax->line6, value) == 0) - variax->model = value; - - return count; -} - -/* - "read" request on "active" special file. -*/ -static ssize_t variax_get_active(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", - variax->buffer_activate[VARIAX_OFFSET_ACTIVATE]); -} - -/* - "write" request on "active" special file. -*/ -static ssize_t variax_set_active(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - variax_activate_async(variax, value ? 1 : 0); - return count; -} - -/* - "read" request on "tone" special file. -*/ -static ssize_t variax_get_tone(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", variax->tone); -} - -/* - "write" request on "tone" special file. -*/ -static ssize_t variax_set_tone(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_tone, - value) == 0) - variax->tone = value; - - return count; -} - -static ssize_t get_string(char *buf, const char *data, int length) -{ - int i; - memcpy(buf, data, length); - - for (i = length; i--;) { - char c = buf[i]; - - if ((c != 0) && (c != ' ')) - break; - } - - buf[i + 1] = '\n'; - return i + 2; -} - -/* - "read" request on "name" special file. -*/ -static ssize_t variax_get_name(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - line6_dump_wait_interruptible(&variax->dumpreq); - return get_string(buf, variax->model_data.name, - sizeof(variax->model_data.name)); -} - -/* - "read" request on "bank" special file. -*/ -static ssize_t variax_get_bank(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - line6_dump_wait_interruptible(&variax->dumpreq); - return get_string(buf, variax->bank, sizeof(variax->bank)); -} - -/* - "read" request on "dump" special file. -*/ -static ssize_t variax_get_dump(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - int retval; - retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - memcpy(buf, &variax->model_data.control, - sizeof(variax->model_data.control)); - return sizeof(variax->model_data.control); -} - -/* - "read" request on "guitar" special file. -*/ -static ssize_t variax_get_guitar(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%s\n", variax->guitar); -} - -#ifdef CONFIG_LINE6_USB_RAW - -static char *variax_alloc_sysex_buffer(struct usb_line6_variax *variax, - int code, int size) -{ - return line6_alloc_sysex_buffer(&variax->line6, VARIAX_SYSEX_CODE, code, - size); -} - -/* - "write" request on "raw" special file. -*/ -static ssize_t variax_set_raw2(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - int size; - int i; - char *sysex; - - count -= count % 3; - size = count * 2; - sysex = variax_alloc_sysex_buffer(variax, VARIAX_SYSEX_PARAM, size); - - if (!sysex) - return 0; - - for (i = 0; i < count; i += 3) { - const unsigned char *p1 = buf + i; - char *p2 = sysex + SYSEX_DATA_OFS + i * 2; - p2[0] = p1[2] & 0x0f; - p2[1] = p1[2] >> 4; - p2[2] = p1[1] & 0x0f; - p2[3] = p1[1] >> 4; - p2[4] = p1[0] & 0x0f; - p2[5] = p1[0] >> 4; + dev_dbg(variax->line6.ifcdev, + "Variax: unknown message %02X\n", buf[0]); } - - line6_send_sysex_message(&variax->line6, sysex, size); - kfree(sysex); - return count; } -#endif - -/* Variax workbench special files: */ -static DEVICE_ATTR(model, S_IWUSR | S_IRUGO, variax_get_model, - variax_set_model); -static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO, variax_get_volume, - variax_set_volume); -static DEVICE_ATTR(tone, S_IWUSR | S_IRUGO, variax_get_tone, variax_set_tone); -static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); -static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); -static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); -static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, - variax_set_active); -static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); - -#ifdef CONFIG_LINE6_USB_RAW -static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); -static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2); -#endif - /* Variax destructor. */ @@ -581,36 +179,10 @@ static void variax_destruct(struct usb_interface *interface) del_timer(&variax->startup_timer2); cancel_work_sync(&variax->startup_work); - /* free dump request data: */ - line6_dumpreq_destructbuf(&variax->dumpreq, 2); - line6_dumpreq_destructbuf(&variax->dumpreq, 1); - line6_dumpreq_destruct(&variax->dumpreq); - kfree(variax->buffer_activate); } /* - Create sysfs entries. -*/ -static int variax_create_files2(struct device *dev) -{ - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tone)); - CHECK_RETURN(device_create_file(dev, &dev_attr_name)); - CHECK_RETURN(device_create_file(dev, &dev_attr_bank)); - CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_active)); - CHECK_RETURN(device_create_file(dev, &dev_attr_guitar)); -#ifdef CONFIG_LINE6_USB_RAW - CHECK_RETURN(device_create_file(dev, &dev_attr_raw)); - CHECK_RETURN(device_create_file(dev, &dev_attr_raw2)); -#endif - return 0; -} - -/* Try to init workbench device. */ static int variax_try_init(struct usb_interface *interface, @@ -620,36 +192,12 @@ static int variax_try_init(struct usb_interface *interface, init_timer(&variax->startup_timer1); init_timer(&variax->startup_timer2); - INIT_WORK(&variax->startup_work, variax_startup7); + INIT_WORK(&variax->startup_work, variax_startup6); if ((interface == NULL) || (variax == NULL)) return -ENODEV; /* initialize USB buffers: */ - err = line6_dumpreq_init(&variax->dumpreq, variax_request_model1, - sizeof(variax_request_model1)); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - - err = line6_dumpreq_initbuf(&variax->dumpreq, variax_request_model2, - sizeof(variax_request_model2), 1); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - - err = line6_dumpreq_initbuf(&variax->dumpreq, variax_request_bank, - sizeof(variax_request_bank), 2); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - variax->buffer_activate = kmemdup(variax_activate, sizeof(variax_activate), GFP_KERNEL); @@ -692,28 +240,8 @@ int line6_variax_init(struct usb_interface *interface, */ void line6_variax_disconnect(struct usb_interface *interface) { - struct device *dev; - if (interface == NULL) return; - dev = &interface->dev; - - if (dev != NULL) { - /* remove sysfs entries: */ - line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_model); - device_remove_file(dev, &dev_attr_volume); - device_remove_file(dev, &dev_attr_tone); - device_remove_file(dev, &dev_attr_name); - device_remove_file(dev, &dev_attr_bank); - device_remove_file(dev, &dev_attr_dump); - device_remove_file(dev, &dev_attr_active); - device_remove_file(dev, &dev_attr_guitar); -#ifdef CONFIG_LINE6_USB_RAW - device_remove_file(dev, &dev_attr_raw); - device_remove_file(dev, &dev_attr_raw2); -#endif - } variax_destruct(interface); } diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index e2999ab..24de796 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -18,7 +18,6 @@ #include <sound/core.h> #include "driver.h" -#include "dumprequest.h" #define VARIAX_STARTUP_DELAY1 1000 #define VARIAX_STARTUP_DELAY3 100 @@ -32,33 +31,11 @@ enum { VARIAX_STARTUP_VERSIONREQ, VARIAX_STARTUP_WAIT, VARIAX_STARTUP_ACTIVATE, - VARIAX_STARTUP_DUMPREQ, VARIAX_STARTUP_WORKQUEUE, VARIAX_STARTUP_SETUP, VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1 }; -enum { - VARIAX_DUMP_PASS1 = LINE6_DUMP_CURRENT, - VARIAX_DUMP_PASS2, - VARIAX_DUMP_PASS3 -}; - -/** - Binary Variax model dump -*/ -struct variax_model { - /** - Header information (including program name). - */ - unsigned char name[18]; - - /** - Model parameters. - */ - unsigned char control[78 * 2]; -}; - struct usb_line6_variax { /** Generic Line6 USB data. @@ -66,48 +43,11 @@ struct usb_line6_variax { struct usb_line6 line6; /** - Dump request structure. - Append two extra buffers for 3-pass data query. - */ - struct line6_dump_request dumpreq; - struct line6_dump_reqbuf extrabuf[2]; - - /** Buffer for activation code. */ unsigned char *buffer_activate; /** - Model number. - */ - int model; - - /** - Current model settings. - */ - struct variax_model model_data; - - /** - Name of connected guitar. - */ - unsigned char guitar[18]; - - /** - Name of current model bank. - */ - unsigned char bank[18]; - - /** - Position of volume dial. - */ - int volume; - - /** - Position of tone control dial. - */ - int tone; - - /** Handler for device initializaton. */ struct work_struct startup_work; |