aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/line6
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r--drivers/staging/line6/config.h48
-rw-r--r--drivers/staging/line6/control.c995
-rw-r--r--drivers/staging/line6/control.h195
-rw-r--r--drivers/staging/line6/dumprequest.c135
-rw-r--r--drivers/staging/line6/dumprequest.h76
5 files changed, 1449 insertions, 0 deletions
diff --git a/drivers/staging/line6/config.h b/drivers/staging/line6/config.h
new file mode 100644
index 00000000000..f8a5149e3da
--- /dev/null
+++ b/drivers/staging/line6/config.h
@@ -0,0 +1,48 @@
1/*
2 * Line6 Linux USB driver - 0.8.0
3 *
4 * Copyright (C) 2004-2009 Markus Grabner (grabner@icg.tugraz.at)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#ifndef CONFIG_H
13#define CONFIG_H
14
15
16#ifdef CONFIG_USB_DEBUG
17#define DEBUG 1
18#endif
19
20
21/*
22 * Development tools.
23 */
24#define DO_DEBUG_MESSAGES 0
25#define DO_DUMP_URB_SEND DO_DEBUG_MESSAGES
26#define DO_DUMP_URB_RECEIVE DO_DEBUG_MESSAGES
27#define DO_DUMP_PCM_SEND 0
28#define DO_DUMP_PCM_RECEIVE 0
29#define DO_DUMP_MIDI_SEND DO_DEBUG_MESSAGES
30#define DO_DUMP_MIDI_RECEIVE DO_DEBUG_MESSAGES
31#define DO_DUMP_ANY (DO_DUMP_URB_SEND || DO_DUMP_URB_RECEIVE || \
32 DO_DUMP_PCM_SEND || DO_DUMP_PCM_RECEIVE || \
33 DO_DUMP_MIDI_SEND || DO_DUMP_MIDI_RECEIVE)
34#define CREATE_RAW_FILE 0
35
36#if DO_DEBUG_MESSAGES
37#define CHECKPOINT printk(KERN_INFO "line6usb: %s (%s:%d)\n", \
38 __func__, __FILE__, __LINE__)
39#endif
40
41#if DO_DEBUG_MESSAGES
42#define DEBUG_MESSAGES(x) (x)
43#else
44#define DEBUG_MESSAGES(x)
45#endif
46
47
48#endif
diff --git a/drivers/staging/line6/control.c b/drivers/staging/line6/control.c
new file mode 100644
index 00000000000..67e23b6e2d3
--- /dev/null
+++ b/drivers/staging/line6/control.c
@@ -0,0 +1,995 @@
1/*
2 * Line6 Linux USB driver - 0.9.1beta
3 *
4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#include <linux/usb.h>
13
14#include "control.h"
15#include "driver.h"
16#include "pod.h"
17#include "usbdefs.h"
18#include "variax.h"
19
20#define DEVICE_ATTR2(_name1, _name2, _mode, _show, _store) \
21struct device_attribute dev_attr_##_name1 = __ATTR(_name2, _mode, _show, _store)
22
23#define LINE6_PARAM_R(PREFIX, prefix, type, param) \
24static ssize_t prefix##_get_##param(struct device *dev, \
25 struct device_attribute *attr, char *buf) \
26{ \
27 return prefix##_get_param_##type(dev, buf, PREFIX##_##param); \
28}
29
30#define LINE6_PARAM_RW(PREFIX, prefix, type, param) \
31LINE6_PARAM_R(PREFIX, prefix, type, param); \
32static ssize_t prefix##_set_##param(struct device *dev, \
33 struct device_attribute *attr, const char *buf, size_t count) \
34{ \
35 return prefix##_set_param_##type(dev, buf, count, PREFIX##_##param); \
36}
37
38#define POD_PARAM_R(type, param) LINE6_PARAM_R(POD, pod, type, param)
39#define POD_PARAM_RW(type, param) LINE6_PARAM_RW(POD, pod, type, param)
40#define VARIAX_PARAM_R(type, param) LINE6_PARAM_R(VARIAX, variax, type, param)
41#define VARIAX_PARAM_RW(type, param) LINE6_PARAM_RW(VARIAX, variax, type, param)
42
43static ssize_t pod_get_param_int(struct device *dev, char *buf, int param)
44{
45 struct usb_interface *interface = to_usb_interface(dev);
46 struct usb_line6_pod *pod = usb_get_intfdata(interface);
47 int retval = line6_dump_wait_interruptible(&pod->dumpreq);
48 if (retval < 0)
49 return retval;
50 return sprintf(buf, "%d\n", pod->prog_data.control[param]);
51}
52
53static ssize_t pod_set_param_int(struct device *dev, const char *buf,
54 size_t count, int param)
55{
56 struct usb_interface *interface = to_usb_interface(dev);
57 struct usb_line6_pod *pod = usb_get_intfdata(interface);
58 unsigned long value;
59 int retval;
60
61 retval = strict_strtoul(buf, 10, &value);
62 if (retval)
63 return retval;
64
65 line6_pod_transmit_parameter(pod, param, value);
66 return count;
67}
68
69static ssize_t variax_get_param_int(struct device *dev, char *buf, int param)
70{
71 struct usb_interface *interface = to_usb_interface(dev);
72 struct usb_line6_variax *variax = usb_get_intfdata(interface);
73 int retval = line6_dump_wait_interruptible(&variax->dumpreq);
74 if (retval < 0)
75 return retval;
76 return sprintf(buf, "%d\n", variax->model_data.control[param]);
77}
78
79static ssize_t variax_get_param_float(struct device *dev, char *buf, int param)
80{
81 /*
82 We do our own floating point handling here since at the time
83 this code was written (Jan 2006) it was highly discouraged to
84 use floating point arithmetic in the kernel. If you think that
85 this no longer applies, feel free to replace this by generic
86 floating point code.
87 */
88
89 static const int BIAS = 0x7f;
90 static const int OFFSET = 0xf;
91 static const int PRECISION = 1000;
92
93 int len = 0;
94 unsigned part_int, part_frac;
95 struct usb_interface *interface = to_usb_interface(dev);
96 struct usb_line6_variax *variax = usb_get_intfdata(interface);
97 const unsigned char *p = variax->model_data.control + param;
98 int retval = line6_dump_wait_interruptible(&variax->dumpreq);
99 if (retval < 0)
100 return retval;
101
102 if ((p[0] == 0) && (p[1] == 0) && (p[2] == 0))
103 part_int = part_frac = 0;
104 else {
105 int exponent = (((p[0] & 0x7f) << 1) | (p[1] >> 7)) - BIAS;
106 unsigned mantissa = (p[1] << 8) | p[2] | 0x8000;
107 exponent -= OFFSET;
108
109 if (exponent >= 0) {
110 part_int = mantissa << exponent;
111 part_frac = 0;
112 } else {
113 part_int = mantissa >> -exponent;
114 part_frac = (mantissa << (32 + exponent)) & 0xffffffff;
115 }
116
117 part_frac =
118 (part_frac / ((1UL << 31) / (PRECISION / 2 * 10)) + 5) / 10;
119 }
120
121 len +=
122 sprintf(buf + len, "%s%d.%03d\n", ((p[0] & 0x80) ? "-" : ""),
123 part_int, part_frac);
124 return len;
125}
126
127POD_PARAM_RW(int, tweak);
128POD_PARAM_RW(int, wah_position);
129POD_PARAM_RW(int, compression_gain);
130POD_PARAM_RW(int, vol_pedal_position);
131POD_PARAM_RW(int, compression_threshold);
132POD_PARAM_RW(int, pan);
133POD_PARAM_RW(int, amp_model_setup);
134POD_PARAM_RW(int, amp_model);
135POD_PARAM_RW(int, drive);
136POD_PARAM_RW(int, bass);
137POD_PARAM_RW(int, mid);
138POD_PARAM_RW(int, lowmid);
139POD_PARAM_RW(int, treble);
140POD_PARAM_RW(int, highmid);
141POD_PARAM_RW(int, chan_vol);
142POD_PARAM_RW(int, reverb_mix);
143POD_PARAM_RW(int, effect_setup);
144POD_PARAM_RW(int, band_1_frequency);
145POD_PARAM_RW(int, presence);
146POD_PARAM_RW(int, treble__bass);
147POD_PARAM_RW(int, noise_gate_enable);
148POD_PARAM_RW(int, gate_threshold);
149POD_PARAM_RW(int, gate_decay_time);
150POD_PARAM_RW(int, stomp_enable);
151POD_PARAM_RW(int, comp_enable);
152POD_PARAM_RW(int, stomp_time);
153POD_PARAM_RW(int, delay_enable);
154POD_PARAM_RW(int, mod_param_1);
155POD_PARAM_RW(int, delay_param_1);
156POD_PARAM_RW(int, delay_param_1_note_value);
157POD_PARAM_RW(int, band_2_frequency__bass);
158POD_PARAM_RW(int, delay_param_2);
159POD_PARAM_RW(int, delay_volume_mix);
160POD_PARAM_RW(int, delay_param_3);
161POD_PARAM_RW(int, reverb_enable);
162POD_PARAM_RW(int, reverb_type);
163POD_PARAM_RW(int, reverb_decay);
164POD_PARAM_RW(int, reverb_tone);
165POD_PARAM_RW(int, reverb_pre_delay);
166POD_PARAM_RW(int, reverb_pre_post);
167POD_PARAM_RW(int, band_2_frequency);
168POD_PARAM_RW(int, band_3_frequency__bass);
169POD_PARAM_RW(int, wah_enable);
170POD_PARAM_RW(int, modulation_lo_cut);
171POD_PARAM_RW(int, delay_reverb_lo_cut);
172POD_PARAM_RW(int, volume_pedal_minimum);
173POD_PARAM_RW(int, eq_pre_post);
174POD_PARAM_RW(int, volume_pre_post);
175POD_PARAM_RW(int, di_model);
176POD_PARAM_RW(int, di_delay);
177POD_PARAM_RW(int, mod_enable);
178POD_PARAM_RW(int, mod_param_1_note_value);
179POD_PARAM_RW(int, mod_param_2);
180POD_PARAM_RW(int, mod_param_3);
181POD_PARAM_RW(int, mod_param_4);
182POD_PARAM_RW(int, mod_param_5);
183POD_PARAM_RW(int, mod_volume_mix);
184POD_PARAM_RW(int, mod_pre_post);
185POD_PARAM_RW(int, modulation_model);
186POD_PARAM_RW(int, band_3_frequency);
187POD_PARAM_RW(int, band_4_frequency__bass);
188POD_PARAM_RW(int, mod_param_1_double_precision);
189POD_PARAM_RW(int, delay_param_1_double_precision);
190POD_PARAM_RW(int, eq_enable);
191POD_PARAM_RW(int, tap);
192POD_PARAM_RW(int, volume_tweak_pedal_assign);
193POD_PARAM_RW(int, band_5_frequency);
194POD_PARAM_RW(int, tuner);
195POD_PARAM_RW(int, mic_selection);
196POD_PARAM_RW(int, cabinet_model);
197POD_PARAM_RW(int, stomp_model);
198POD_PARAM_RW(int, roomlevel);
199POD_PARAM_RW(int, band_4_frequency);
200POD_PARAM_RW(int, band_6_frequency);
201POD_PARAM_RW(int, stomp_param_1_note_value);
202POD_PARAM_RW(int, stomp_param_2);
203POD_PARAM_RW(int, stomp_param_3);
204POD_PARAM_RW(int, stomp_param_4);
205POD_PARAM_RW(int, stomp_param_5);
206POD_PARAM_RW(int, stomp_param_6);
207POD_PARAM_RW(int, amp_switch_select);
208POD_PARAM_RW(int, delay_param_4);
209POD_PARAM_RW(int, delay_param_5);
210POD_PARAM_RW(int, delay_pre_post);
211POD_PARAM_RW(int, delay_model);
212POD_PARAM_RW(int, delay_verb_model);
213POD_PARAM_RW(int, tempo_msb);
214POD_PARAM_RW(int, tempo_lsb);
215POD_PARAM_RW(int, wah_model);
216POD_PARAM_RW(int, bypass_volume);
217POD_PARAM_RW(int, fx_loop_on_off);
218POD_PARAM_RW(int, tweak_param_select);
219POD_PARAM_RW(int, amp1_engage);
220POD_PARAM_RW(int, band_1_gain);
221POD_PARAM_RW(int, band_2_gain__bass);
222POD_PARAM_RW(int, band_2_gain);
223POD_PARAM_RW(int, band_3_gain__bass);
224POD_PARAM_RW(int, band_3_gain);
225POD_PARAM_RW(int, band_4_gain__bass);
226POD_PARAM_RW(int, band_5_gain__bass);
227POD_PARAM_RW(int, band_4_gain);
228POD_PARAM_RW(int, band_6_gain__bass);
229VARIAX_PARAM_R(int, body);
230VARIAX_PARAM_R(int, pickup1_enable);
231VARIAX_PARAM_R(int, pickup1_type);
232VARIAX_PARAM_R(float, pickup1_position);
233VARIAX_PARAM_R(float, pickup1_angle);
234VARIAX_PARAM_R(float, pickup1_level);
235VARIAX_PARAM_R(int, pickup2_enable);
236VARIAX_PARAM_R(int, pickup2_type);
237VARIAX_PARAM_R(float, pickup2_position);
238VARIAX_PARAM_R(float, pickup2_angle);
239VARIAX_PARAM_R(float, pickup2_level);
240VARIAX_PARAM_R(int, pickup_phase);
241VARIAX_PARAM_R(float, capacitance);
242VARIAX_PARAM_R(float, tone_resistance);
243VARIAX_PARAM_R(float, volume_resistance);
244VARIAX_PARAM_R(int, taper);
245VARIAX_PARAM_R(float, tone_dump);
246VARIAX_PARAM_R(int, save_tone);
247VARIAX_PARAM_R(float, volume_dump);
248VARIAX_PARAM_R(int, tuning_enable);
249VARIAX_PARAM_R(int, tuning6);
250VARIAX_PARAM_R(int, tuning5);
251VARIAX_PARAM_R(int, tuning4);
252VARIAX_PARAM_R(int, tuning3);
253VARIAX_PARAM_R(int, tuning2);
254VARIAX_PARAM_R(int, tuning1);
255VARIAX_PARAM_R(float, detune6);
256VARIAX_PARAM_R(float, detune5);
257VARIAX_PARAM_R(float, detune4);
258VARIAX_PARAM_R(float, detune3);
259VARIAX_PARAM_R(float, detune2);
260VARIAX_PARAM_R(float, detune1);
261VARIAX_PARAM_R(float, mix6);
262VARIAX_PARAM_R(float, mix5);
263VARIAX_PARAM_R(float, mix4);
264VARIAX_PARAM_R(float, mix3);
265VARIAX_PARAM_R(float, mix2);
266VARIAX_PARAM_R(float, mix1);
267VARIAX_PARAM_R(int, pickup_wiring);
268
269static DEVICE_ATTR(tweak, S_IWUSR | S_IRUGO, pod_get_tweak, pod_set_tweak);
270static DEVICE_ATTR(wah_position, S_IWUSR | S_IRUGO, pod_get_wah_position,
271 pod_set_wah_position);
272static DEVICE_ATTR(compression_gain, S_IWUSR | S_IRUGO,
273 pod_get_compression_gain, pod_set_compression_gain);
274static DEVICE_ATTR(vol_pedal_position, S_IWUSR | S_IRUGO,
275 pod_get_vol_pedal_position, pod_set_vol_pedal_position);
276static DEVICE_ATTR(compression_threshold, S_IWUSR | S_IRUGO,
277 pod_get_compression_threshold,
278 pod_set_compression_threshold);
279static DEVICE_ATTR(pan, S_IWUSR | S_IRUGO, pod_get_pan, pod_set_pan);
280static DEVICE_ATTR(amp_model_setup, S_IWUSR | S_IRUGO, pod_get_amp_model_setup,
281 pod_set_amp_model_setup);
282static DEVICE_ATTR(amp_model, S_IWUSR | S_IRUGO, pod_get_amp_model,
283 pod_set_amp_model);
284static DEVICE_ATTR(drive, S_IWUSR | S_IRUGO, pod_get_drive, pod_set_drive);
285static DEVICE_ATTR(bass, S_IWUSR | S_IRUGO, pod_get_bass, pod_set_bass);
286static DEVICE_ATTR(mid, S_IWUSR | S_IRUGO, pod_get_mid, pod_set_mid);
287static DEVICE_ATTR(lowmid, S_IWUSR | S_IRUGO, pod_get_lowmid, pod_set_lowmid);
288static DEVICE_ATTR(treble, S_IWUSR | S_IRUGO, pod_get_treble, pod_set_treble);
289static DEVICE_ATTR(highmid, S_IWUSR | S_IRUGO, pod_get_highmid,
290 pod_set_highmid);
291static DEVICE_ATTR(chan_vol, S_IWUSR | S_IRUGO, pod_get_chan_vol,
292 pod_set_chan_vol);
293static DEVICE_ATTR(reverb_mix, S_IWUSR | S_IRUGO, pod_get_reverb_mix,
294 pod_set_reverb_mix);
295static DEVICE_ATTR(effect_setup, S_IWUSR | S_IRUGO, pod_get_effect_setup,
296 pod_set_effect_setup);
297static DEVICE_ATTR(band_1_frequency, S_IWUSR | S_IRUGO,
298 pod_get_band_1_frequency, pod_set_band_1_frequency);
299static DEVICE_ATTR(presence, S_IWUSR | S_IRUGO, pod_get_presence,
300 pod_set_presence);
301static DEVICE_ATTR2(treble__bass, treble, S_IWUSR | S_IRUGO,
302 pod_get_treble__bass, pod_set_treble__bass);
303static DEVICE_ATTR(noise_gate_enable, S_IWUSR | S_IRUGO,
304 pod_get_noise_gate_enable, pod_set_noise_gate_enable);
305static DEVICE_ATTR(gate_threshold, S_IWUSR | S_IRUGO, pod_get_gate_threshold,
306 pod_set_gate_threshold);
307static DEVICE_ATTR(gate_decay_time, S_IWUSR | S_IRUGO, pod_get_gate_decay_time,
308 pod_set_gate_decay_time);
309static DEVICE_ATTR(stomp_enable, S_IWUSR | S_IRUGO, pod_get_stomp_enable,
310 pod_set_stomp_enable);
311static DEVICE_ATTR(comp_enable, S_IWUSR | S_IRUGO, pod_get_comp_enable,
312 pod_set_comp_enable);
313static DEVICE_ATTR(stomp_time, S_IWUSR | S_IRUGO, pod_get_stomp_time,
314 pod_set_stomp_time);
315static DEVICE_ATTR(delay_enable, S_IWUSR | S_IRUGO, pod_get_delay_enable,
316 pod_set_delay_enable);
317static DEVICE_ATTR(mod_param_1, S_IWUSR | S_IRUGO, pod_get_mod_param_1,
318 pod_set_mod_param_1);
319static DEVICE_ATTR(delay_param_1, S_IWUSR | S_IRUGO, pod_get_delay_param_1,
320 pod_set_delay_param_1);
321static DEVICE_ATTR(delay_param_1_note_value, S_IWUSR | S_IRUGO,
322 pod_get_delay_param_1_note_value,
323 pod_set_delay_param_1_note_value);
324static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUSR | S_IRUGO,
325 pod_get_band_2_frequency__bass,
326 pod_set_band_2_frequency__bass);
327static DEVICE_ATTR(delay_param_2, S_IWUSR | S_IRUGO, pod_get_delay_param_2,
328 pod_set_delay_param_2);
329static DEVICE_ATTR(delay_volume_mix, S_IWUSR | S_IRUGO,
330 pod_get_delay_volume_mix, pod_set_delay_volume_mix);
331static DEVICE_ATTR(delay_param_3, S_IWUSR | S_IRUGO, pod_get_delay_param_3,
332 pod_set_delay_param_3);
333static DEVICE_ATTR(reverb_enable, S_IWUSR | S_IRUGO, pod_get_reverb_enable,
334 pod_set_reverb_enable);
335static DEVICE_ATTR(reverb_type, S_IWUSR | S_IRUGO, pod_get_reverb_type,
336 pod_set_reverb_type);
337static DEVICE_ATTR(reverb_decay, S_IWUSR | S_IRUGO, pod_get_reverb_decay,
338 pod_set_reverb_decay);
339static DEVICE_ATTR(reverb_tone, S_IWUSR | S_IRUGO, pod_get_reverb_tone,
340 pod_set_reverb_tone);
341static DEVICE_ATTR(reverb_pre_delay, S_IWUSR | S_IRUGO,
342 pod_get_reverb_pre_delay, pod_set_reverb_pre_delay);
343static DEVICE_ATTR(reverb_pre_post, S_IWUSR | S_IRUGO, pod_get_reverb_pre_post,
344 pod_set_reverb_pre_post);
345static DEVICE_ATTR(band_2_frequency, S_IWUSR | S_IRUGO,
346 pod_get_band_2_frequency, pod_set_band_2_frequency);
347static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUSR | S_IRUGO,
348 pod_get_band_3_frequency__bass,
349 pod_set_band_3_frequency__bass);
350static DEVICE_ATTR(wah_enable, S_IWUSR | S_IRUGO, pod_get_wah_enable,
351 pod_set_wah_enable);
352static DEVICE_ATTR(modulation_lo_cut, S_IWUSR | S_IRUGO,
353 pod_get_modulation_lo_cut, pod_set_modulation_lo_cut);
354static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUSR | S_IRUGO,
355 pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut);
356static DEVICE_ATTR(volume_pedal_minimum, S_IWUSR | S_IRUGO,
357 pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum);
358static DEVICE_ATTR(eq_pre_post, S_IWUSR | S_IRUGO, pod_get_eq_pre_post,
359 pod_set_eq_pre_post);
360static DEVICE_ATTR(volume_pre_post, S_IWUSR | S_IRUGO, pod_get_volume_pre_post,
361 pod_set_volume_pre_post);
362static DEVICE_ATTR(di_model, S_IWUSR | S_IRUGO, pod_get_di_model,
363 pod_set_di_model);
364static DEVICE_ATTR(di_delay, S_IWUSR | S_IRUGO, pod_get_di_delay,
365 pod_set_di_delay);
366static DEVICE_ATTR(mod_enable, S_IWUSR | S_IRUGO, pod_get_mod_enable,
367 pod_set_mod_enable);
368static DEVICE_ATTR(mod_param_1_note_value, S_IWUSR | S_IRUGO,
369 pod_get_mod_param_1_note_value,
370 pod_set_mod_param_1_note_value);
371static DEVICE_ATTR(mod_param_2, S_IWUSR | S_IRUGO, pod_get_mod_param_2,
372 pod_set_mod_param_2);
373static DEVICE_ATTR(mod_param_3, S_IWUSR | S_IRUGO, pod_get_mod_param_3,
374 pod_set_mod_param_3);
375static DEVICE_ATTR(mod_param_4, S_IWUSR | S_IRUGO, pod_get_mod_param_4,
376 pod_set_mod_param_4);
377static DEVICE_ATTR(mod_param_5, S_IWUSR | S_IRUGO, pod_get_mod_param_5,
378 pod_set_mod_param_5);
379static DEVICE_ATTR(mod_volume_mix, S_IWUSR | S_IRUGO, pod_get_mod_volume_mix,
380 pod_set_mod_volume_mix);
381static DEVICE_ATTR(mod_pre_post, S_IWUSR | S_IRUGO, pod_get_mod_pre_post,
382 pod_set_mod_pre_post);
383static DEVICE_ATTR(modulation_model, S_IWUSR | S_IRUGO,
384 pod_get_modulation_model, pod_set_modulation_model);
385static DEVICE_ATTR(band_3_frequency, S_IWUSR | S_IRUGO,
386 pod_get_band_3_frequency, pod_set_band_3_frequency);
387static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUSR | S_IRUGO,
388 pod_get_band_4_frequency__bass,
389 pod_set_band_4_frequency__bass);
390static DEVICE_ATTR(mod_param_1_double_precision, S_IWUSR | S_IRUGO,
391 pod_get_mod_param_1_double_precision,
392 pod_set_mod_param_1_double_precision);
393static DEVICE_ATTR(delay_param_1_double_precision, S_IWUSR | S_IRUGO,
394 pod_get_delay_param_1_double_precision,
395 pod_set_delay_param_1_double_precision);
396static DEVICE_ATTR(eq_enable, S_IWUSR | S_IRUGO, pod_get_eq_enable,
397 pod_set_eq_enable);
398static DEVICE_ATTR(tap, S_IWUSR | S_IRUGO, pod_get_tap, pod_set_tap);
399static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUSR | S_IRUGO,
400 pod_get_volume_tweak_pedal_assign,
401 pod_set_volume_tweak_pedal_assign);
402static DEVICE_ATTR(band_5_frequency, S_IWUSR | S_IRUGO,
403 pod_get_band_5_frequency, pod_set_band_5_frequency);
404static DEVICE_ATTR(tuner, S_IWUSR | S_IRUGO, pod_get_tuner, pod_set_tuner);
405static DEVICE_ATTR(mic_selection, S_IWUSR | S_IRUGO, pod_get_mic_selection,
406 pod_set_mic_selection);
407static DEVICE_ATTR(cabinet_model, S_IWUSR | S_IRUGO, pod_get_cabinet_model,
408 pod_set_cabinet_model);
409static DEVICE_ATTR(stomp_model, S_IWUSR | S_IRUGO, pod_get_stomp_model,
410 pod_set_stomp_model);
411static DEVICE_ATTR(roomlevel, S_IWUSR | S_IRUGO, pod_get_roomlevel,
412 pod_set_roomlevel);
413static DEVICE_ATTR(band_4_frequency, S_IWUSR | S_IRUGO,
414 pod_get_band_4_frequency, pod_set_band_4_frequency);
415static DEVICE_ATTR(band_6_frequency, S_IWUSR | S_IRUGO,
416 pod_get_band_6_frequency, pod_set_band_6_frequency);
417static DEVICE_ATTR(stomp_param_1_note_value, S_IWUSR | S_IRUGO,
418 pod_get_stomp_param_1_note_value,
419 pod_set_stomp_param_1_note_value);
420static DEVICE_ATTR(stomp_param_2, S_IWUSR | S_IRUGO, pod_get_stomp_param_2,
421 pod_set_stomp_param_2);
422static DEVICE_ATTR(stomp_param_3, S_IWUSR | S_IRUGO, pod_get_stomp_param_3,
423 pod_set_stomp_param_3);
424static DEVICE_ATTR(stomp_param_4, S_IWUSR | S_IRUGO, pod_get_stomp_param_4,
425 pod_set_stomp_param_4);
426static DEVICE_ATTR(stomp_param_5, S_IWUSR | S_IRUGO, pod_get_stomp_param_5,
427 pod_set_stomp_param_5);
428static DEVICE_ATTR(stomp_param_6, S_IWUSR | S_IRUGO, pod_get_stomp_param_6,
429 pod_set_stomp_param_6);
430static DEVICE_ATTR(amp_switch_select, S_IWUSR | S_IRUGO,
431 pod_get_amp_switch_select, pod_set_amp_switch_select);
432static DEVICE_ATTR(delay_param_4, S_IWUSR | S_IRUGO, pod_get_delay_param_4,
433 pod_set_delay_param_4);
434static DEVICE_ATTR(delay_param_5, S_IWUSR | S_IRUGO, pod_get_delay_param_5,
435 pod_set_delay_param_5);
436static DEVICE_ATTR(delay_pre_post, S_IWUSR | S_IRUGO, pod_get_delay_pre_post,
437 pod_set_delay_pre_post);
438static DEVICE_ATTR(delay_model, S_IWUSR | S_IRUGO, pod_get_delay_model,
439 pod_set_delay_model);
440static DEVICE_ATTR(delay_verb_model, S_IWUSR | S_IRUGO,
441 pod_get_delay_verb_model, pod_set_delay_verb_model);
442static DEVICE_ATTR(tempo_msb, S_IWUSR | S_IRUGO, pod_get_tempo_msb,
443 pod_set_tempo_msb);
444static DEVICE_ATTR(tempo_lsb, S_IWUSR | S_IRUGO, pod_get_tempo_lsb,
445 pod_set_tempo_lsb);
446static DEVICE_ATTR(wah_model, S_IWUSR | S_IRUGO, pod_get_wah_model,
447 pod_set_wah_model);
448static DEVICE_ATTR(bypass_volume, S_IWUSR | S_IRUGO, pod_get_bypass_volume,
449 pod_set_bypass_volume);
450static DEVICE_ATTR(fx_loop_on_off, S_IWUSR | S_IRUGO, pod_get_fx_loop_on_off,
451 pod_set_fx_loop_on_off);
452static DEVICE_ATTR(tweak_param_select, S_IWUSR | S_IRUGO,
453 pod_get_tweak_param_select, pod_set_tweak_param_select);
454static DEVICE_ATTR(amp1_engage, S_IWUSR | S_IRUGO, pod_get_amp1_engage,
455 pod_set_amp1_engage);
456static DEVICE_ATTR(band_1_gain, S_IWUSR | S_IRUGO, pod_get_band_1_gain,
457 pod_set_band_1_gain);
458static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUSR | S_IRUGO,
459 pod_get_band_2_gain__bass, pod_set_band_2_gain__bass);
460static DEVICE_ATTR(band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain,
461 pod_set_band_2_gain);
462static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUSR | S_IRUGO,
463 pod_get_band_3_gain__bass, pod_set_band_3_gain__bass);
464static DEVICE_ATTR(band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain,
465 pod_set_band_3_gain);
466static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUSR | S_IRUGO,
467 pod_get_band_4_gain__bass, pod_set_band_4_gain__bass);
468static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUSR | S_IRUGO,
469 pod_get_band_5_gain__bass, pod_set_band_5_gain__bass);
470static DEVICE_ATTR(band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain,
471 pod_set_band_4_gain);
472static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUSR | S_IRUGO,
473 pod_get_band_6_gain__bass, pod_set_band_6_gain__bass);
474static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write);
475static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable,
476 line6_nop_write);
477static DEVICE_ATTR(pickup1_type, S_IRUGO, variax_get_pickup1_type,
478 line6_nop_write);
479static DEVICE_ATTR(pickup1_position, S_IRUGO, variax_get_pickup1_position,
480 line6_nop_write);
481static DEVICE_ATTR(pickup1_angle, S_IRUGO, variax_get_pickup1_angle,
482 line6_nop_write);
483static DEVICE_ATTR(pickup1_level, S_IRUGO, variax_get_pickup1_level,
484 line6_nop_write);
485static DEVICE_ATTR(pickup2_enable, S_IRUGO, variax_get_pickup2_enable,
486 line6_nop_write);
487static DEVICE_ATTR(pickup2_type, S_IRUGO, variax_get_pickup2_type,
488 line6_nop_write);
489static DEVICE_ATTR(pickup2_position, S_IRUGO, variax_get_pickup2_position,
490 line6_nop_write);
491static DEVICE_ATTR(pickup2_angle, S_IRUGO, variax_get_pickup2_angle,
492 line6_nop_write);
493static DEVICE_ATTR(pickup2_level, S_IRUGO, variax_get_pickup2_level,
494 line6_nop_write);
495static DEVICE_ATTR(pickup_phase, S_IRUGO, variax_get_pickup_phase,
496 line6_nop_write);
497static DEVICE_ATTR(capacitance, S_IRUGO, variax_get_capacitance,
498 line6_nop_write);
499static DEVICE_ATTR(tone_resistance, S_IRUGO, variax_get_tone_resistance,
500 line6_nop_write);
501static DEVICE_ATTR(volume_resistance, S_IRUGO, variax_get_volume_resistance,
502 line6_nop_write);
503static DEVICE_ATTR(taper, S_IRUGO, variax_get_taper, line6_nop_write);
504static DEVICE_ATTR(tone_dump, S_IRUGO, variax_get_tone_dump, line6_nop_write);
505static DEVICE_ATTR(save_tone, S_IRUGO, variax_get_save_tone, line6_nop_write);
506static DEVICE_ATTR(volume_dump, S_IRUGO, variax_get_volume_dump,
507 line6_nop_write);
508static DEVICE_ATTR(tuning_enable, S_IRUGO, variax_get_tuning_enable,
509 line6_nop_write);
510static DEVICE_ATTR(tuning6, S_IRUGO, variax_get_tuning6, line6_nop_write);
511static DEVICE_ATTR(tuning5, S_IRUGO, variax_get_tuning5, line6_nop_write);
512static DEVICE_ATTR(tuning4, S_IRUGO, variax_get_tuning4, line6_nop_write);
513static DEVICE_ATTR(tuning3, S_IRUGO, variax_get_tuning3, line6_nop_write);
514static DEVICE_ATTR(tuning2, S_IRUGO, variax_get_tuning2, line6_nop_write);
515static DEVICE_ATTR(tuning1, S_IRUGO, variax_get_tuning1, line6_nop_write);
516static DEVICE_ATTR(detune6, S_IRUGO, variax_get_detune6, line6_nop_write);
517static DEVICE_ATTR(detune5, S_IRUGO, variax_get_detune5, line6_nop_write);
518static DEVICE_ATTR(detune4, S_IRUGO, variax_get_detune4, line6_nop_write);
519static DEVICE_ATTR(detune3, S_IRUGO, variax_get_detune3, line6_nop_write);
520static DEVICE_ATTR(detune2, S_IRUGO, variax_get_detune2, line6_nop_write);
521static DEVICE_ATTR(detune1, S_IRUGO, variax_get_detune1, line6_nop_write);
522static DEVICE_ATTR(mix6, S_IRUGO, variax_get_mix6, line6_nop_write);
523static DEVICE_ATTR(mix5, S_IRUGO, variax_get_mix5, line6_nop_write);
524static DEVICE_ATTR(mix4, S_IRUGO, variax_get_mix4, line6_nop_write);
525static DEVICE_ATTR(mix3, S_IRUGO, variax_get_mix3, line6_nop_write);
526static DEVICE_ATTR(mix2, S_IRUGO, variax_get_mix2, line6_nop_write);
527static DEVICE_ATTR(mix1, S_IRUGO, variax_get_mix1, line6_nop_write);
528static DEVICE_ATTR(pickup_wiring, S_IRUGO, variax_get_pickup_wiring,
529 line6_nop_write);
530
531int line6_pod_create_files(int firmware, int type, struct device *dev)
532{
533 int err;
534 CHECK_RETURN(device_create_file(dev, &dev_attr_tweak));
535 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_position));
536 if ((type & (LINE6_BITS_PODXTALL)) != 0)
537 CHECK_RETURN(device_create_file
538 (dev, &dev_attr_compression_gain));
539 CHECK_RETURN(device_create_file(dev, &dev_attr_vol_pedal_position));
540 CHECK_RETURN(device_create_file(dev, &dev_attr_compression_threshold));
541 CHECK_RETURN(device_create_file(dev, &dev_attr_pan));
542 CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model_setup));
543 if (firmware >= 200)
544 CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model));
545 CHECK_RETURN(device_create_file(dev, &dev_attr_drive));
546 CHECK_RETURN(device_create_file(dev, &dev_attr_bass));
547 if ((type & (LINE6_BITS_PODXTALL)) != 0)
548 CHECK_RETURN(device_create_file(dev, &dev_attr_mid));
549 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
550 CHECK_RETURN(device_create_file(dev, &dev_attr_lowmid));
551 if ((type & (LINE6_BITS_PODXTALL)) != 0)
552 CHECK_RETURN(device_create_file(dev, &dev_attr_treble));
553 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
554 CHECK_RETURN(device_create_file(dev, &dev_attr_highmid));
555 CHECK_RETURN(device_create_file(dev, &dev_attr_chan_vol));
556 if ((type & (LINE6_BITS_PODXTALL)) != 0)
557 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_mix));
558 CHECK_RETURN(device_create_file(dev, &dev_attr_effect_setup));
559 if (firmware >= 200)
560 CHECK_RETURN(device_create_file
561 (dev, &dev_attr_band_1_frequency));
562 if ((type & (LINE6_BITS_PODXTALL)) != 0)
563 CHECK_RETURN(device_create_file(dev, &dev_attr_presence));
564 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
565 CHECK_RETURN(device_create_file(dev, &dev_attr_treble__bass));
566 CHECK_RETURN(device_create_file(dev, &dev_attr_noise_gate_enable));
567 CHECK_RETURN(device_create_file(dev, &dev_attr_gate_threshold));
568 CHECK_RETURN(device_create_file(dev, &dev_attr_gate_decay_time));
569 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_enable));
570 CHECK_RETURN(device_create_file(dev, &dev_attr_comp_enable));
571 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_time));
572 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_enable));
573 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1));
574 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_1));
575 CHECK_RETURN(device_create_file
576 (dev, &dev_attr_delay_param_1_note_value));
577 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
578 if (firmware >= 200)
579 CHECK_RETURN(device_create_file
580 (dev, &dev_attr_band_2_frequency__bass));
581 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_2));
582 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_volume_mix));
583 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_3));
584 if ((type & (LINE6_BITS_PODXTALL)) != 0)
585 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_enable));
586 if ((type & (LINE6_BITS_PODXTALL)) != 0)
587 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_type));
588 if ((type & (LINE6_BITS_PODXTALL)) != 0)
589 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_decay));
590 if ((type & (LINE6_BITS_PODXTALL)) != 0)
591 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_tone));
592 if ((type & (LINE6_BITS_PODXTALL)) != 0)
593 CHECK_RETURN(device_create_file
594 (dev, &dev_attr_reverb_pre_delay));
595 if ((type & (LINE6_BITS_PODXTALL)) != 0)
596 CHECK_RETURN(device_create_file
597 (dev, &dev_attr_reverb_pre_post));
598 if ((type & (LINE6_BITS_PODXTALL)) != 0)
599 if (firmware >= 200)
600 CHECK_RETURN(device_create_file
601 (dev, &dev_attr_band_2_frequency));
602 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
603 if (firmware >= 200)
604 CHECK_RETURN(device_create_file
605 (dev, &dev_attr_band_3_frequency__bass));
606 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_enable));
607 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
608 CHECK_RETURN(device_create_file
609 (dev, &dev_attr_modulation_lo_cut));
610 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
611 CHECK_RETURN(device_create_file
612 (dev, &dev_attr_delay_reverb_lo_cut));
613 if ((type & (LINE6_BITS_PODXTALL)) != 0)
614 if (firmware >= 200)
615 CHECK_RETURN(device_create_file
616 (dev, &dev_attr_volume_pedal_minimum));
617 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
618 if (firmware >= 200)
619 CHECK_RETURN(device_create_file
620 (dev, &dev_attr_eq_pre_post));
621 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_pre_post));
622 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
623 CHECK_RETURN(device_create_file(dev, &dev_attr_di_model));
624 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
625 CHECK_RETURN(device_create_file(dev, &dev_attr_di_delay));
626 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_enable));
627 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1_note_value));
628 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_2));
629 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_3));
630 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_4));
631 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
632 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_5));
633 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_volume_mix));
634 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_pre_post));
635 CHECK_RETURN(device_create_file(dev, &dev_attr_modulation_model));
636 if ((type & (LINE6_BITS_PODXTALL)) != 0)
637 if (firmware >= 200)
638 CHECK_RETURN(device_create_file
639 (dev, &dev_attr_band_3_frequency));
640 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
641 if (firmware >= 200)
642 CHECK_RETURN(device_create_file
643 (dev, &dev_attr_band_4_frequency__bass));
644 CHECK_RETURN(device_create_file
645 (dev, &dev_attr_mod_param_1_double_precision));
646 CHECK_RETURN(device_create_file
647 (dev, &dev_attr_delay_param_1_double_precision));
648 if (firmware >= 200)
649 CHECK_RETURN(device_create_file(dev, &dev_attr_eq_enable));
650 CHECK_RETURN(device_create_file(dev, &dev_attr_tap));
651 CHECK_RETURN(device_create_file
652 (dev, &dev_attr_volume_tweak_pedal_assign));
653 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
654 if (firmware >= 200)
655 CHECK_RETURN(device_create_file
656 (dev, &dev_attr_band_5_frequency));
657 CHECK_RETURN(device_create_file(dev, &dev_attr_tuner));
658 CHECK_RETURN(device_create_file(dev, &dev_attr_mic_selection));
659 CHECK_RETURN(device_create_file(dev, &dev_attr_cabinet_model));
660 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_model));
661 CHECK_RETURN(device_create_file(dev, &dev_attr_roomlevel));
662 if ((type & (LINE6_BITS_PODXTALL)) != 0)
663 if (firmware >= 200)
664 CHECK_RETURN(device_create_file
665 (dev, &dev_attr_band_4_frequency));
666 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
667 if (firmware >= 200)
668 CHECK_RETURN(device_create_file
669 (dev, &dev_attr_band_6_frequency));
670 CHECK_RETURN(device_create_file
671 (dev, &dev_attr_stomp_param_1_note_value));
672 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_2));
673 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_3));
674 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_4));
675 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_5));
676 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_6));
677 if ((type & (LINE6_BITS_LIVE)) != 0)
678 CHECK_RETURN(device_create_file
679 (dev, &dev_attr_amp_switch_select));
680 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_4));
681 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_5));
682 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_pre_post));
683 if ((type & (LINE6_BITS_PODXTALL)) != 0)
684 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_model));
685 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
686 CHECK_RETURN(device_create_file
687 (dev, &dev_attr_delay_verb_model));
688 CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_msb));
689 CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_lsb));
690 if (firmware >= 300)
691 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_model));
692 if (firmware >= 214)
693 CHECK_RETURN(device_create_file(dev, &dev_attr_bypass_volume));
694 if ((type & (LINE6_BITS_PRO)) != 0)
695 CHECK_RETURN(device_create_file(dev, &dev_attr_fx_loop_on_off));
696 CHECK_RETURN(device_create_file(dev, &dev_attr_tweak_param_select));
697 CHECK_RETURN(device_create_file(dev, &dev_attr_amp1_engage));
698 if (firmware >= 200)
699 CHECK_RETURN(device_create_file(dev, &dev_attr_band_1_gain));
700 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
701 if (firmware >= 200)
702 CHECK_RETURN(device_create_file
703 (dev, &dev_attr_band_2_gain__bass));
704 if ((type & (LINE6_BITS_PODXTALL)) != 0)
705 if (firmware >= 200)
706 CHECK_RETURN(device_create_file
707 (dev, &dev_attr_band_2_gain));
708 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
709 if (firmware >= 200)
710 CHECK_RETURN(device_create_file
711 (dev, &dev_attr_band_3_gain__bass));
712 if ((type & (LINE6_BITS_PODXTALL)) != 0)
713 if (firmware >= 200)
714 CHECK_RETURN(device_create_file
715 (dev, &dev_attr_band_3_gain));
716 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
717 if (firmware >= 200)
718 CHECK_RETURN(device_create_file
719 (dev, &dev_attr_band_4_gain__bass));
720 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
721 if (firmware >= 200)
722 CHECK_RETURN(device_create_file
723 (dev, &dev_attr_band_5_gain__bass));
724 if ((type & (LINE6_BITS_PODXTALL)) != 0)
725 if (firmware >= 200)
726 CHECK_RETURN(device_create_file
727 (dev, &dev_attr_band_4_gain));
728 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
729 if (firmware >= 200)
730 CHECK_RETURN(device_create_file
731 (dev, &dev_attr_band_6_gain__bass));
732 return 0;
733}
734
735void line6_pod_remove_files(int firmware, int type, struct device *dev)
736{
737 device_remove_file(dev, &dev_attr_tweak);
738 device_remove_file(dev, &dev_attr_wah_position);
739 if ((type & (LINE6_BITS_PODXTALL)) != 0)
740 device_remove_file(dev, &dev_attr_compression_gain);
741 device_remove_file(dev, &dev_attr_vol_pedal_position);
742 device_remove_file(dev, &dev_attr_compression_threshold);
743 device_remove_file(dev, &dev_attr_pan);
744 device_remove_file(dev, &dev_attr_amp_model_setup);
745 if (firmware >= 200)
746 device_remove_file(dev, &dev_attr_amp_model);
747 device_remove_file(dev, &dev_attr_drive);
748 device_remove_file(dev, &dev_attr_bass);
749 if ((type & (LINE6_BITS_PODXTALL)) != 0)
750 device_remove_file(dev, &dev_attr_mid);
751 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
752 device_remove_file(dev, &dev_attr_lowmid);
753 if ((type & (LINE6_BITS_PODXTALL)) != 0)
754 device_remove_file(dev, &dev_attr_treble);
755 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
756 device_remove_file(dev, &dev_attr_highmid);
757 device_remove_file(dev, &dev_attr_chan_vol);
758 if ((type & (LINE6_BITS_PODXTALL)) != 0)
759 device_remove_file(dev, &dev_attr_reverb_mix);
760 device_remove_file(dev, &dev_attr_effect_setup);
761 if (firmware >= 200)
762 device_remove_file(dev, &dev_attr_band_1_frequency);
763 if ((type & (LINE6_BITS_PODXTALL)) != 0)
764 device_remove_file(dev, &dev_attr_presence);
765 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
766 device_remove_file(dev, &dev_attr_treble__bass);
767 device_remove_file(dev, &dev_attr_noise_gate_enable);
768 device_remove_file(dev, &dev_attr_gate_threshold);
769 device_remove_file(dev, &dev_attr_gate_decay_time);
770 device_remove_file(dev, &dev_attr_stomp_enable);
771 device_remove_file(dev, &dev_attr_comp_enable);
772 device_remove_file(dev, &dev_attr_stomp_time);
773 device_remove_file(dev, &dev_attr_delay_enable);
774 device_remove_file(dev, &dev_attr_mod_param_1);
775 device_remove_file(dev, &dev_attr_delay_param_1);
776 device_remove_file(dev, &dev_attr_delay_param_1_note_value);
777 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
778 if (firmware >= 200)
779 device_remove_file(dev,
780 &dev_attr_band_2_frequency__bass);
781 device_remove_file(dev, &dev_attr_delay_param_2);
782 device_remove_file(dev, &dev_attr_delay_volume_mix);
783 device_remove_file(dev, &dev_attr_delay_param_3);
784 if ((type & (LINE6_BITS_PODXTALL)) != 0)
785 device_remove_file(dev, &dev_attr_reverb_enable);
786 if ((type & (LINE6_BITS_PODXTALL)) != 0)
787 device_remove_file(dev, &dev_attr_reverb_type);
788 if ((type & (LINE6_BITS_PODXTALL)) != 0)
789 device_remove_file(dev, &dev_attr_reverb_decay);
790 if ((type & (LINE6_BITS_PODXTALL)) != 0)
791 device_remove_file(dev, &dev_attr_reverb_tone);
792 if ((type & (LINE6_BITS_PODXTALL)) != 0)
793 device_remove_file(dev, &dev_attr_reverb_pre_delay);
794 if ((type & (LINE6_BITS_PODXTALL)) != 0)
795 device_remove_file(dev, &dev_attr_reverb_pre_post);
796 if ((type & (LINE6_BITS_PODXTALL)) != 0)
797 if (firmware >= 200)
798 device_remove_file(dev, &dev_attr_band_2_frequency);
799 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
800 if (firmware >= 200)
801 device_remove_file(dev,
802 &dev_attr_band_3_frequency__bass);
803 device_remove_file(dev, &dev_attr_wah_enable);
804 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
805 device_remove_file(dev, &dev_attr_modulation_lo_cut);
806 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
807 device_remove_file(dev, &dev_attr_delay_reverb_lo_cut);
808 if ((type & (LINE6_BITS_PODXTALL)) != 0)
809 if (firmware >= 200)
810 device_remove_file(dev, &dev_attr_volume_pedal_minimum);
811 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
812 if (firmware >= 200)
813 device_remove_file(dev, &dev_attr_eq_pre_post);
814 device_remove_file(dev, &dev_attr_volume_pre_post);
815 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
816 device_remove_file(dev, &dev_attr_di_model);
817 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
818 device_remove_file(dev, &dev_attr_di_delay);
819 device_remove_file(dev, &dev_attr_mod_enable);
820 device_remove_file(dev, &dev_attr_mod_param_1_note_value);
821 device_remove_file(dev, &dev_attr_mod_param_2);
822 device_remove_file(dev, &dev_attr_mod_param_3);
823 device_remove_file(dev, &dev_attr_mod_param_4);
824 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
825 device_remove_file(dev, &dev_attr_mod_param_5);
826 device_remove_file(dev, &dev_attr_mod_volume_mix);
827 device_remove_file(dev, &dev_attr_mod_pre_post);
828 device_remove_file(dev, &dev_attr_modulation_model);
829 if ((type & (LINE6_BITS_PODXTALL)) != 0)
830 if (firmware >= 200)
831 device_remove_file(dev, &dev_attr_band_3_frequency);
832 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
833 if (firmware >= 200)
834 device_remove_file(dev,
835 &dev_attr_band_4_frequency__bass);
836 device_remove_file(dev, &dev_attr_mod_param_1_double_precision);
837 device_remove_file(dev, &dev_attr_delay_param_1_double_precision);
838 if (firmware >= 200)
839 device_remove_file(dev, &dev_attr_eq_enable);
840 device_remove_file(dev, &dev_attr_tap);
841 device_remove_file(dev, &dev_attr_volume_tweak_pedal_assign);
842 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
843 if (firmware >= 200)
844 device_remove_file(dev, &dev_attr_band_5_frequency);
845 device_remove_file(dev, &dev_attr_tuner);
846 device_remove_file(dev, &dev_attr_mic_selection);
847 device_remove_file(dev, &dev_attr_cabinet_model);
848 device_remove_file(dev, &dev_attr_stomp_model);
849 device_remove_file(dev, &dev_attr_roomlevel);
850 if ((type & (LINE6_BITS_PODXTALL)) != 0)
851 if (firmware >= 200)
852 device_remove_file(dev, &dev_attr_band_4_frequency);
853 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
854 if (firmware >= 200)
855 device_remove_file(dev, &dev_attr_band_6_frequency);
856 device_remove_file(dev, &dev_attr_stomp_param_1_note_value);
857 device_remove_file(dev, &dev_attr_stomp_param_2);
858 device_remove_file(dev, &dev_attr_stomp_param_3);
859 device_remove_file(dev, &dev_attr_stomp_param_4);
860 device_remove_file(dev, &dev_attr_stomp_param_5);
861 device_remove_file(dev, &dev_attr_stomp_param_6);
862 if ((type & (LINE6_BITS_LIVE)) != 0)
863 device_remove_file(dev, &dev_attr_amp_switch_select);
864 device_remove_file(dev, &dev_attr_delay_param_4);
865 device_remove_file(dev, &dev_attr_delay_param_5);
866 device_remove_file(dev, &dev_attr_delay_pre_post);
867 if ((type & (LINE6_BITS_PODXTALL)) != 0)
868 device_remove_file(dev, &dev_attr_delay_model);
869 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
870 device_remove_file(dev, &dev_attr_delay_verb_model);
871 device_remove_file(dev, &dev_attr_tempo_msb);
872 device_remove_file(dev, &dev_attr_tempo_lsb);
873 if (firmware >= 300)
874 device_remove_file(dev, &dev_attr_wah_model);
875 if (firmware >= 214)
876 device_remove_file(dev, &dev_attr_bypass_volume);
877 if ((type & (LINE6_BITS_PRO)) != 0)
878 device_remove_file(dev, &dev_attr_fx_loop_on_off);
879 device_remove_file(dev, &dev_attr_tweak_param_select);
880 device_remove_file(dev, &dev_attr_amp1_engage);
881 if (firmware >= 200)
882 device_remove_file(dev, &dev_attr_band_1_gain);
883 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
884 if (firmware >= 200)
885 device_remove_file(dev, &dev_attr_band_2_gain__bass);
886 if ((type & (LINE6_BITS_PODXTALL)) != 0)
887 if (firmware >= 200)
888 device_remove_file(dev, &dev_attr_band_2_gain);
889 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
890 if (firmware >= 200)
891 device_remove_file(dev, &dev_attr_band_3_gain__bass);
892 if ((type & (LINE6_BITS_PODXTALL)) != 0)
893 if (firmware >= 200)
894 device_remove_file(dev, &dev_attr_band_3_gain);
895 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
896 if (firmware >= 200)
897 device_remove_file(dev, &dev_attr_band_4_gain__bass);
898 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
899 if (firmware >= 200)
900 device_remove_file(dev, &dev_attr_band_5_gain__bass);
901 if ((type & (LINE6_BITS_PODXTALL)) != 0)
902 if (firmware >= 200)
903 device_remove_file(dev, &dev_attr_band_4_gain);
904 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
905 if (firmware >= 200)
906 device_remove_file(dev, &dev_attr_band_6_gain__bass);
907}
908
909int line6_variax_create_files(int firmware, int type, struct device *dev)
910{
911 int err;
912 CHECK_RETURN(device_create_file(dev, &dev_attr_body));
913 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_enable));
914 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_type));
915 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_position));
916 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_angle));
917 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_level));
918 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_enable));
919 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_type));
920 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_position));
921 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_angle));
922 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_level));
923 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_phase));
924 CHECK_RETURN(device_create_file(dev, &dev_attr_capacitance));
925 CHECK_RETURN(device_create_file(dev, &dev_attr_tone_resistance));
926 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_resistance));
927 CHECK_RETURN(device_create_file(dev, &dev_attr_taper));
928 CHECK_RETURN(device_create_file(dev, &dev_attr_tone_dump));
929 CHECK_RETURN(device_create_file(dev, &dev_attr_save_tone));
930 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_dump));
931 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning_enable));
932 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning6));
933 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning5));
934 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning4));
935 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning3));
936 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning2));
937 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning1));
938 CHECK_RETURN(device_create_file(dev, &dev_attr_detune6));
939 CHECK_RETURN(device_create_file(dev, &dev_attr_detune5));
940 CHECK_RETURN(device_create_file(dev, &dev_attr_detune4));
941 CHECK_RETURN(device_create_file(dev, &dev_attr_detune3));
942 CHECK_RETURN(device_create_file(dev, &dev_attr_detune2));
943 CHECK_RETURN(device_create_file(dev, &dev_attr_detune1));
944 CHECK_RETURN(device_create_file(dev, &dev_attr_mix6));
945 CHECK_RETURN(device_create_file(dev, &dev_attr_mix5));
946 CHECK_RETURN(device_create_file(dev, &dev_attr_mix4));
947 CHECK_RETURN(device_create_file(dev, &dev_attr_mix3));
948 CHECK_RETURN(device_create_file(dev, &dev_attr_mix2));
949 CHECK_RETURN(device_create_file(dev, &dev_attr_mix1));
950 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_wiring));
951 return 0;
952}
953
954void line6_variax_remove_files(int firmware, int type, struct device *dev)
955{
956 device_remove_file(dev, &dev_attr_body);
957 device_remove_file(dev, &dev_attr_pickup1_enable);
958 device_remove_file(dev, &dev_attr_pickup1_type);
959 device_remove_file(dev, &dev_attr_pickup1_position);
960 device_remove_file(dev, &dev_attr_pickup1_angle);
961 device_remove_file(dev, &dev_attr_pickup1_level);
962 device_remove_file(dev, &dev_attr_pickup2_enable);
963 device_remove_file(dev, &dev_attr_pickup2_type);
964 device_remove_file(dev, &dev_attr_pickup2_position);
965 device_remove_file(dev, &dev_attr_pickup2_angle);
966 device_remove_file(dev, &dev_attr_pickup2_level);
967 device_remove_file(dev, &dev_attr_pickup_phase);
968 device_remove_file(dev, &dev_attr_capacitance);
969 device_remove_file(dev, &dev_attr_tone_resistance);
970 device_remove_file(dev, &dev_attr_volume_resistance);
971 device_remove_file(dev, &dev_attr_taper);
972 device_remove_file(dev, &dev_attr_tone_dump);
973 device_remove_file(dev, &dev_attr_save_tone);
974 device_remove_file(dev, &dev_attr_volume_dump);
975 device_remove_file(dev, &dev_attr_tuning_enable);
976 device_remove_file(dev, &dev_attr_tuning6);
977 device_remove_file(dev, &dev_attr_tuning5);
978 device_remove_file(dev, &dev_attr_tuning4);
979 device_remove_file(dev, &dev_attr_tuning3);
980 device_remove_file(dev, &dev_attr_tuning2);
981 device_remove_file(dev, &dev_attr_tuning1);
982 device_remove_file(dev, &dev_attr_detune6);
983 device_remove_file(dev, &dev_attr_detune5);
984 device_remove_file(dev, &dev_attr_detune4);
985 device_remove_file(dev, &dev_attr_detune3);
986 device_remove_file(dev, &dev_attr_detune2);
987 device_remove_file(dev, &dev_attr_detune1);
988 device_remove_file(dev, &dev_attr_mix6);
989 device_remove_file(dev, &dev_attr_mix5);
990 device_remove_file(dev, &dev_attr_mix4);
991 device_remove_file(dev, &dev_attr_mix3);
992 device_remove_file(dev, &dev_attr_mix2);
993 device_remove_file(dev, &dev_attr_mix1);
994 device_remove_file(dev, &dev_attr_pickup_wiring);
995}
diff --git a/drivers/staging/line6/control.h b/drivers/staging/line6/control.h
new file mode 100644
index 00000000000..e4c5d2ce2aa
--- /dev/null
+++ b/drivers/staging/line6/control.h
@@ -0,0 +1,195 @@
1/*
2 * Line6 Linux USB driver - 0.9.1beta
3 *
4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#ifndef LINE6_CONTROL_H
13#define LINE6_CONTROL_H
14
15/**
16 List of PODxt Pro controls.
17 See Appendix C of the "PODxt (Pro) Pilot's Handbook" by Line6.
18 Comments after the number refer to the PODxt Pro firmware version required
19 for this feature.
20
21 Please *don't* reformat this file since "control.c" is created automatically
22 from "control.h", and this process depends on the exact formatting of the
23 code and the comments below!
24*/
25
26/* *INDENT-OFF* */
27
28enum {
29 POD_tweak = 1,
30 POD_wah_position = 4,
31 POD_compression_gain = 5, /* device: LINE6_BITS_PODXTALL */
32 POD_vol_pedal_position = 7,
33 POD_compression_threshold = 9,
34 POD_pan = 10,
35 POD_amp_model_setup = 11,
36 POD_amp_model = 12, /* firmware: 2.0 */
37 POD_drive = 13,
38 POD_bass = 14,
39 POD_mid = 15, /* device: LINE6_BITS_PODXTALL */
40 POD_lowmid = 15, /* device: LINE6_BITS_BASSPODXTALL */
41 POD_treble = 16, /* device: LINE6_BITS_PODXTALL */
42 POD_highmid = 16, /* device: LINE6_BITS_BASSPODXTALL */
43 POD_chan_vol = 17,
44 POD_reverb_mix = 18, /* device: LINE6_BITS_PODXTALL */
45 POD_effect_setup = 19,
46 POD_band_1_frequency = 20, /* firmware: 2.0 */
47 POD_presence = 21, /* device: LINE6_BITS_PODXTALL */
48 POD_treble__bass = 21, /* device: LINE6_BITS_BASSPODXTALL */
49 POD_noise_gate_enable = 22,
50 POD_gate_threshold = 23,
51 POD_gate_decay_time = 24,
52 POD_stomp_enable = 25,
53 POD_comp_enable = 26,
54 POD_stomp_time = 27,
55 POD_delay_enable = 28,
56 POD_mod_param_1 = 29,
57 POD_delay_param_1 = 30,
58 POD_delay_param_1_note_value = 31,
59 POD_band_2_frequency__bass = 32, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
60 POD_delay_param_2 = 33,
61 POD_delay_volume_mix = 34,
62 POD_delay_param_3 = 35,
63 POD_reverb_enable = 36, /* device: LINE6_BITS_PODXTALL */
64 POD_reverb_type = 37, /* device: LINE6_BITS_PODXTALL */
65 POD_reverb_decay = 38, /* device: LINE6_BITS_PODXTALL */
66 POD_reverb_tone = 39, /* device: LINE6_BITS_PODXTALL */
67 POD_reverb_pre_delay = 40, /* device: LINE6_BITS_PODXTALL */
68 POD_reverb_pre_post = 41, /* device: LINE6_BITS_PODXTALL */
69 POD_band_2_frequency = 42, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
70 POD_band_3_frequency__bass = 42, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
71 POD_wah_enable = 43,
72 POD_modulation_lo_cut = 44, /* device: LINE6_BITS_BASSPODXTALL */
73 POD_delay_reverb_lo_cut = 45, /* device: LINE6_BITS_BASSPODXTALL */
74 POD_volume_pedal_minimum = 46, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
75 POD_eq_pre_post = 46, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
76 POD_volume_pre_post = 47,
77 POD_di_model = 48, /* device: LINE6_BITS_BASSPODXTALL */
78 POD_di_delay = 49, /* device: LINE6_BITS_BASSPODXTALL */
79 POD_mod_enable = 50,
80 POD_mod_param_1_note_value = 51,
81 POD_mod_param_2 = 52,
82 POD_mod_param_3 = 53,
83 POD_mod_param_4 = 54,
84 POD_mod_param_5 = 55, /* device: LINE6_BITS_BASSPODXTALL */
85 POD_mod_volume_mix = 56,
86 POD_mod_pre_post = 57,
87 POD_modulation_model = 58,
88 POD_band_3_frequency = 60, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
89 POD_band_4_frequency__bass = 60, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
90 POD_mod_param_1_double_precision = 61,
91 POD_delay_param_1_double_precision = 62,
92 POD_eq_enable = 63, /* firmware: 2.0 */
93 POD_tap = 64,
94 POD_volume_tweak_pedal_assign = 65,
95 POD_band_5_frequency = 68, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
96 POD_tuner = 69,
97 POD_mic_selection = 70,
98 POD_cabinet_model = 71,
99 POD_stomp_model = 75,
100 POD_roomlevel = 76,
101 POD_band_4_frequency = 77, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
102 POD_band_6_frequency = 77, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
103 POD_stomp_param_1_note_value = 78,
104 POD_stomp_param_2 = 79,
105 POD_stomp_param_3 = 80,
106 POD_stomp_param_4 = 81,
107 POD_stomp_param_5 = 82,
108 POD_stomp_param_6 = 83,
109 POD_amp_switch_select = 84, /* device: LINE6_BITS_LIVE */
110 POD_delay_param_4 = 85,
111 POD_delay_param_5 = 86,
112 POD_delay_pre_post = 87,
113 POD_delay_model = 88, /* device: LINE6_BITS_PODXTALL */
114 POD_delay_verb_model = 88, /* device: LINE6_BITS_BASSPODXTALL */
115 POD_tempo_msb = 89,
116 POD_tempo_lsb = 90,
117 POD_wah_model = 91, /* firmware: 3.0 */
118 POD_bypass_volume = 105, /* firmware: 2.14 */
119 POD_fx_loop_on_off = 107, /* device: LINE6_BITS_PRO */
120 POD_tweak_param_select = 108,
121 POD_amp1_engage = 111,
122 POD_band_1_gain = 114, /* firmware: 2.0 */
123 POD_band_2_gain__bass = 115, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
124 POD_band_2_gain = 116, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
125 POD_band_3_gain__bass = 116, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
126 POD_band_3_gain = 117, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
127 POD_band_4_gain__bass = 117, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
128 POD_band_5_gain__bass = 118, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
129 POD_band_4_gain = 119, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */
130 POD_band_6_gain__bass = 119 /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */
131};
132
133/**
134 List of Variax workbench controls (dump).
135*/
136enum {
137 VARIAX_body = 3,
138 VARIAX_pickup1_enable = 4, /* 0: enabled, 1: disabled */
139 VARIAX_pickup1_type = 8,
140 VARIAX_pickup1_position = 9, /* type: 24 bit float */
141 VARIAX_pickup1_angle = 12, /* type: 24 bit float */
142 VARIAX_pickup1_level = 15, /* type: 24 bit float */
143 VARIAX_pickup2_enable = 18, /* 0: enabled, 1: disabled */
144 VARIAX_pickup2_type = 22,
145 VARIAX_pickup2_position = 23, /* type: 24 bit float */
146 VARIAX_pickup2_angle = 26, /* type: 24 bit float */
147 VARIAX_pickup2_level = 29, /* type: 24 bit float */
148 VARIAX_pickup_phase = 32, /* 0: in phase, 1: out of phase */
149 VARIAX_capacitance = 33, /* type: 24 bit float */
150 VARIAX_tone_resistance = 36, /* type: 24 bit float */
151 VARIAX_volume_resistance = 39, /* type: 24 bit float */
152 VARIAX_taper = 42, /* 0: Linear, 1: Audio */
153 VARIAX_tone_dump = 43, /* type: 24 bit float */
154 VARIAX_save_tone = 46,
155 VARIAX_volume_dump = 47, /* type: 24 bit float */
156 VARIAX_tuning_enable = 50,
157 VARIAX_tuning6 = 51,
158 VARIAX_tuning5 = 52,
159 VARIAX_tuning4 = 53,
160 VARIAX_tuning3 = 54,
161 VARIAX_tuning2 = 55,
162 VARIAX_tuning1 = 56,
163 VARIAX_detune6 = 57, /* type: 24 bit float */
164 VARIAX_detune5 = 60, /* type: 24 bit float */
165 VARIAX_detune4 = 63, /* type: 24 bit float */
166 VARIAX_detune3 = 66, /* type: 24 bit float */
167 VARIAX_detune2 = 69, /* type: 24 bit float */
168 VARIAX_detune1 = 72, /* type: 24 bit float */
169 VARIAX_mix6 = 75, /* type: 24 bit float */
170 VARIAX_mix5 = 78, /* type: 24 bit float */
171 VARIAX_mix4 = 81, /* type: 24 bit float */
172 VARIAX_mix3 = 84, /* type: 24 bit float */
173 VARIAX_mix2 = 87, /* type: 24 bit float */
174 VARIAX_mix1 = 90, /* type: 24 bit float */
175 VARIAX_pickup_wiring = 96 /* 0: parallel, 1: series */
176};
177
178/**
179 List of Variax workbench controls (MIDI).
180*/
181enum {
182 VARIAXMIDI_volume = 7,
183 VARIAXMIDI_tone = 79,
184};
185
186/* *INDENT-ON* */
187
188extern int line6_pod_create_files(int firmware, int type, struct device *dev);
189extern void line6_pod_remove_files(int firmware, int type, struct device *dev);
190extern int line6_variax_create_files(int firmware, int type,
191 struct device *dev);
192extern void line6_variax_remove_files(int firmware, int type,
193 struct device *dev);
194
195#endif
diff --git a/drivers/staging/line6/dumprequest.c b/drivers/staging/line6/dumprequest.c
new file mode 100644
index 00000000000..60c7bae3ad3
--- /dev/null
+++ b/drivers/staging/line6/dumprequest.c
@@ -0,0 +1,135 @@
1/*
2 * Line6 Linux USB driver - 0.9.1beta
3 *
4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#include <linux/slab.h>
13
14#include "driver.h"
15#include "dumprequest.h"
16
17/*
18 Set "dump in progress" flag.
19*/
20void line6_dump_started(struct line6_dump_request *l6dr, int dest)
21{
22 l6dr->in_progress = dest;
23}
24
25/*
26 Invalidate current channel, i.e., set "dump in progress" flag.
27 Reading from the "dump" special file blocks until dump is completed.
28*/
29void line6_invalidate_current(struct line6_dump_request *l6dr)
30{
31 line6_dump_started(l6dr, LINE6_DUMP_CURRENT);
32}
33
34/*
35 Clear "dump in progress" flag and notify waiting processes.
36*/
37void line6_dump_finished(struct line6_dump_request *l6dr)
38{
39 l6dr->in_progress = LINE6_DUMP_NONE;
40 wake_up(&l6dr->wait);
41}
42
43/*
44 Send an asynchronous channel dump request.
45*/
46int line6_dump_request_async(struct line6_dump_request *l6dr,
47 struct usb_line6 *line6, int num, int dest)
48{
49 int ret;
50 line6_dump_started(l6dr, dest);
51 ret = line6_send_raw_message_async(line6, l6dr->reqbufs[num].buffer,
52 l6dr->reqbufs[num].length);
53
54 if (ret < 0)
55 line6_dump_finished(l6dr);
56
57 return ret;
58}
59
60/*
61 Wait for completion (interruptible).
62*/
63int line6_dump_wait_interruptible(struct line6_dump_request *l6dr)
64{
65 return wait_event_interruptible(l6dr->wait,
66 l6dr->in_progress == LINE6_DUMP_NONE);
67}
68
69/*
70 Wait for completion.
71*/
72void line6_dump_wait(struct line6_dump_request *l6dr)
73{
74 wait_event(l6dr->wait, l6dr->in_progress == LINE6_DUMP_NONE);
75}
76
77/*
78 Wait for completion (with timeout).
79*/
80int line6_dump_wait_timeout(struct line6_dump_request *l6dr, long timeout)
81{
82 return wait_event_timeout(l6dr->wait,
83 l6dr->in_progress == LINE6_DUMP_NONE,
84 timeout);
85}
86
87/*
88 Initialize dump request buffer.
89*/
90int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, const void *buf,
91 size_t len, int num)
92{
93 l6dr->reqbufs[num].buffer = kmemdup(buf, len, GFP_KERNEL);
94 if (l6dr->reqbufs[num].buffer == NULL)
95 return -ENOMEM;
96 l6dr->reqbufs[num].length = len;
97 return 0;
98}
99
100/*
101 Initialize dump request data structure (including one buffer).
102*/
103int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf,
104 size_t len)
105{
106 int ret;
107 ret = line6_dumpreq_initbuf(l6dr, buf, len, 0);
108 if (ret < 0)
109 return ret;
110 init_waitqueue_head(&l6dr->wait);
111 return 0;
112}
113
114/*
115 Destruct dump request data structure.
116*/
117void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num)
118{
119 if (l6dr == NULL)
120 return;
121 if (l6dr->reqbufs[num].buffer == NULL)
122 return;
123 kfree(l6dr->reqbufs[num].buffer);
124 l6dr->reqbufs[num].buffer = NULL;
125}
126
127/*
128 Destruct dump request data structure.
129*/
130void line6_dumpreq_destruct(struct line6_dump_request *l6dr)
131{
132 if (l6dr->reqbufs[0].buffer == NULL)
133 return;
134 line6_dumpreq_destructbuf(l6dr, 0);
135}
diff --git a/drivers/staging/line6/dumprequest.h b/drivers/staging/line6/dumprequest.h
new file mode 100644
index 00000000000..c17a262fad2
--- /dev/null
+++ b/drivers/staging/line6/dumprequest.h
@@ -0,0 +1,76 @@
1/*
2 * Line6 Linux USB driver - 0.9.1beta
3 *
4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#ifndef DUMPREQUEST_H
13#define DUMPREQUEST_H
14
15#include <linux/usb.h>
16#include <linux/wait.h>
17#include <sound/core.h>
18
19enum {
20 LINE6_DUMP_NONE,
21 LINE6_DUMP_CURRENT
22};
23
24struct line6_dump_reqbuf {
25 /**
26 Buffer for dump requests.
27 */
28 unsigned char *buffer;
29
30 /**
31 Size of dump request.
32 */
33 size_t length;
34};
35
36/**
37 Provides the functionality to request channel/model/... dump data from a
38 Line6 device.
39*/
40struct line6_dump_request {
41 /**
42 Wait queue for access to program dump data.
43 */
44 wait_queue_head_t wait;
45
46 /**
47 Indicates an unfinished program dump request.
48 0: no dump
49 1: dump current settings
50 Other device-specific values are also allowed.
51 */
52 int in_progress;
53
54 /**
55 Dump request buffers
56 */
57 struct line6_dump_reqbuf reqbufs[1];
58};
59
60extern void line6_dump_finished(struct line6_dump_request *l6dr);
61extern int line6_dump_request_async(struct line6_dump_request *l6dr,
62 struct usb_line6 *line6, int num, int dest);
63extern void line6_dump_started(struct line6_dump_request *l6dr, int dest);
64extern void line6_dumpreq_destruct(struct line6_dump_request *l6dr);
65extern void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num);
66extern int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf,
67 size_t len);
68extern int line6_dumpreq_initbuf(struct line6_dump_request *l6dr,
69 const void *buf, size_t len, int num);
70extern void line6_invalidate_current(struct line6_dump_request *l6dr);
71extern void line6_dump_wait(struct line6_dump_request *l6dr);
72extern int line6_dump_wait_interruptible(struct line6_dump_request *l6dr);
73extern int line6_dump_wait_timeout(struct line6_dump_request *l6dr,
74 long timeout);
75
76#endif