staging: line6: Fix some checkpatch warnings in control.c
[deliverable/linux.git] / drivers / staging / line6 / control.c
CommitLineData
705ececd
MG
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#include "driver.h"
13
14#include <linux/usb.h>
15
16#include "control.h"
17#include "pod.h"
18#include "usbdefs.h"
19#include "variax.h"
20
9a92fadc
GKH
21#define DEVICE_ATTR2(_name1, _name2, _mode, _show, _store) \
22struct device_attribute dev_attr_##_name1 = __ATTR(_name2, _mode, _show, _store)
705ececd
MG
23
24#define LINE6_PARAM_R(PREFIX, prefix, type, param) \
2a20bf6f 25static ssize_t prefix##_get_##param(struct device *dev, \
77491e52 26 struct device_attribute *attr, char *buf) \
705ececd 27{ \
2a20bf6f 28 return prefix##_get_param_##type(dev, buf, PREFIX##_##param); \
705ececd
MG
29}
30
31#define LINE6_PARAM_RW(PREFIX, prefix, type, param) \
32LINE6_PARAM_R(PREFIX, prefix, type, param); \
2a20bf6f 33static ssize_t prefix##_set_##param(struct device *dev, \
77491e52 34 struct device_attribute *attr, const char *buf, size_t count) \
705ececd 35{ \
2a20bf6f 36 return prefix##_set_param_##type(dev, buf, count, PREFIX##_##param); \
705ececd
MG
37}
38
39#define POD_PARAM_R(type, param) LINE6_PARAM_R(POD, pod, type, param)
40#define POD_PARAM_RW(type, param) LINE6_PARAM_RW(POD, pod, type, param)
41#define VARIAX_PARAM_R(type, param) LINE6_PARAM_R(VARIAX, variax, type, param)
42#define VARIAX_PARAM_RW(type, param) LINE6_PARAM_RW(VARIAX, variax, type, param)
43
705ececd
MG
44static ssize_t pod_get_param_int(struct device *dev, char *buf, int param)
45{
46 struct usb_interface *interface = to_usb_interface(dev);
47 struct usb_line6_pod *pod = usb_get_intfdata(interface);
48 int retval = line6_wait_dump(&pod->dumpreq, 0);
9a92fadc
GKH
49 if (retval < 0)
50 return retval;
705ececd
MG
51 return sprintf(buf, "%d\n", pod->prog_data.control[param]);
52}
53
acdc1021
SB
54static ssize_t pod_set_param_int(struct device *dev, const char *buf,
55 size_t count, int param)
705ececd
MG
56{
57 struct usb_interface *interface = to_usb_interface(dev);
58 struct usb_line6_pod *pod = usb_get_intfdata(interface);
59 int value = simple_strtoul(buf, NULL, 10);
60 pod_transmit_parameter(pod, param, value);
61 return count;
62}
63
64static ssize_t variax_get_param_int(struct device *dev, char *buf, int param)
65{
66 struct usb_interface *interface = to_usb_interface(dev);
67 struct usb_line6_variax *variax = usb_get_intfdata(interface);
68 int retval = line6_wait_dump(&variax->dumpreq, 0);
9a92fadc
GKH
69 if (retval < 0)
70 return retval;
705ececd
MG
71 return sprintf(buf, "%d\n", variax->model_data.control[param]);
72}
73
74static ssize_t variax_get_param_float(struct device *dev, char *buf, int param)
75{
76 /*
acdc1021
SB
77 We do our own floating point handling here since floats in the
78 kernel are problematic for at least two reasons: - many distros
79 are still shipped with binary kernels optimized for the ancient
80 80386 without FPU
81 - there isn't a printf("%f")
82 (see http://www.kernelthread.com/publications/faq/335.html)
83 */
705ececd
MG
84
85 static const int BIAS = 0x7f;
86 static const int OFFSET = 0xf;
87 static const int PRECISION = 1000;
88
89 int len = 0;
90 unsigned part_int, part_frac;
91 struct usb_interface *interface = to_usb_interface(dev);
92 struct usb_line6_variax *variax = usb_get_intfdata(interface);
93 const unsigned char *p = variax->model_data.control + param;
94 int retval = line6_wait_dump(&variax->dumpreq, 0);
9a92fadc
GKH
95 if (retval < 0)
96 return retval;
705ececd 97
9a92fadc 98 if ((p[0] == 0) && (p[1] == 0) && (p[2] == 0))
705ececd
MG
99 part_int = part_frac = 0;
100 else {
101 int exponent = (((p[0] & 0x7f) << 1) | (p[1] >> 7)) - BIAS;
102 unsigned mantissa = (p[1] << 8) | p[2] | 0x8000;
103 exponent -= OFFSET;
104
9a92fadc 105 if (exponent >= 0) {
705ececd
MG
106 part_int = mantissa << exponent;
107 part_frac = 0;
9a92fadc 108 } else {
705ececd
MG
109 part_int = mantissa >> -exponent;
110 part_frac = (mantissa << (32 + exponent)) & 0xffffffff;
111 }
112
acdc1021
SB
113 part_frac =
114 (part_frac / ((1UL << 31) / (PRECISION / 2 * 10)) + 5) / 10;
705ececd
MG
115 }
116
acdc1021
SB
117 len +=
118 sprintf(buf + len, "%s%d.%03d\n", ((p[0] & 0x80) ? "-" : ""),
119 part_int, part_frac);
705ececd
MG
120 return len;
121}
122
123POD_PARAM_RW(int, tweak);
124POD_PARAM_RW(int, wah_position);
125POD_PARAM_RW(int, compression_gain);
126POD_PARAM_RW(int, vol_pedal_position);
127POD_PARAM_RW(int, compression_threshold);
128POD_PARAM_RW(int, pan);
129POD_PARAM_RW(int, amp_model_setup);
130POD_PARAM_RW(int, amp_model);
131POD_PARAM_RW(int, drive);
132POD_PARAM_RW(int, bass);
133POD_PARAM_RW(int, mid);
134POD_PARAM_RW(int, lowmid);
135POD_PARAM_RW(int, treble);
136POD_PARAM_RW(int, highmid);
137POD_PARAM_RW(int, chan_vol);
138POD_PARAM_RW(int, reverb_mix);
139POD_PARAM_RW(int, effect_setup);
140POD_PARAM_RW(int, band_1_frequency);
141POD_PARAM_RW(int, presence);
142POD_PARAM_RW(int, treble__bass);
143POD_PARAM_RW(int, noise_gate_enable);
144POD_PARAM_RW(int, gate_threshold);
145POD_PARAM_RW(int, gate_decay_time);
146POD_PARAM_RW(int, stomp_enable);
147POD_PARAM_RW(int, comp_enable);
148POD_PARAM_RW(int, stomp_time);
149POD_PARAM_RW(int, delay_enable);
150POD_PARAM_RW(int, mod_param_1);
151POD_PARAM_RW(int, delay_param_1);
152POD_PARAM_RW(int, delay_param_1_note_value);
153POD_PARAM_RW(int, band_2_frequency__bass);
154POD_PARAM_RW(int, delay_param_2);
155POD_PARAM_RW(int, delay_volume_mix);
156POD_PARAM_RW(int, delay_param_3);
157POD_PARAM_RW(int, reverb_enable);
158POD_PARAM_RW(int, reverb_type);
159POD_PARAM_RW(int, reverb_decay);
160POD_PARAM_RW(int, reverb_tone);
161POD_PARAM_RW(int, reverb_pre_delay);
162POD_PARAM_RW(int, reverb_pre_post);
163POD_PARAM_RW(int, band_2_frequency);
164POD_PARAM_RW(int, band_3_frequency__bass);
165POD_PARAM_RW(int, wah_enable);
166POD_PARAM_RW(int, modulation_lo_cut);
167POD_PARAM_RW(int, delay_reverb_lo_cut);
168POD_PARAM_RW(int, volume_pedal_minimum);
169POD_PARAM_RW(int, eq_pre_post);
170POD_PARAM_RW(int, volume_pre_post);
171POD_PARAM_RW(int, di_model);
172POD_PARAM_RW(int, di_delay);
173POD_PARAM_RW(int, mod_enable);
174POD_PARAM_RW(int, mod_param_1_note_value);
175POD_PARAM_RW(int, mod_param_2);
176POD_PARAM_RW(int, mod_param_3);
177POD_PARAM_RW(int, mod_param_4);
178POD_PARAM_RW(int, mod_param_5);
179POD_PARAM_RW(int, mod_volume_mix);
180POD_PARAM_RW(int, mod_pre_post);
181POD_PARAM_RW(int, modulation_model);
182POD_PARAM_RW(int, band_3_frequency);
183POD_PARAM_RW(int, band_4_frequency__bass);
184POD_PARAM_RW(int, mod_param_1_double_precision);
185POD_PARAM_RW(int, delay_param_1_double_precision);
186POD_PARAM_RW(int, eq_enable);
187POD_PARAM_RW(int, tap);
188POD_PARAM_RW(int, volume_tweak_pedal_assign);
189POD_PARAM_RW(int, band_5_frequency);
190POD_PARAM_RW(int, tuner);
191POD_PARAM_RW(int, mic_selection);
192POD_PARAM_RW(int, cabinet_model);
193POD_PARAM_RW(int, stomp_model);
194POD_PARAM_RW(int, roomlevel);
195POD_PARAM_RW(int, band_4_frequency);
196POD_PARAM_RW(int, band_6_frequency);
197POD_PARAM_RW(int, stomp_param_1_note_value);
198POD_PARAM_RW(int, stomp_param_2);
199POD_PARAM_RW(int, stomp_param_3);
200POD_PARAM_RW(int, stomp_param_4);
201POD_PARAM_RW(int, stomp_param_5);
202POD_PARAM_RW(int, stomp_param_6);
203POD_PARAM_RW(int, amp_switch_select);
204POD_PARAM_RW(int, delay_param_4);
205POD_PARAM_RW(int, delay_param_5);
206POD_PARAM_RW(int, delay_pre_post);
207POD_PARAM_RW(int, delay_model);
208POD_PARAM_RW(int, delay_verb_model);
209POD_PARAM_RW(int, tempo_msb);
210POD_PARAM_RW(int, tempo_lsb);
211POD_PARAM_RW(int, wah_model);
212POD_PARAM_RW(int, bypass_volume);
213POD_PARAM_RW(int, fx_loop_on_off);
214POD_PARAM_RW(int, tweak_param_select);
215POD_PARAM_RW(int, amp1_engage);
216POD_PARAM_RW(int, band_1_gain);
217POD_PARAM_RW(int, band_2_gain__bass);
218POD_PARAM_RW(int, band_2_gain);
219POD_PARAM_RW(int, band_3_gain__bass);
220POD_PARAM_RW(int, band_3_gain);
221POD_PARAM_RW(int, band_4_gain__bass);
222POD_PARAM_RW(int, band_5_gain__bass);
223POD_PARAM_RW(int, band_4_gain);
224POD_PARAM_RW(int, band_6_gain__bass);
225VARIAX_PARAM_R(int, body);
226VARIAX_PARAM_R(int, pickup1_enable);
227VARIAX_PARAM_R(int, pickup1_type);
228VARIAX_PARAM_R(float, pickup1_position);
229VARIAX_PARAM_R(float, pickup1_angle);
230VARIAX_PARAM_R(float, pickup1_level);
231VARIAX_PARAM_R(int, pickup2_enable);
232VARIAX_PARAM_R(int, pickup2_type);
233VARIAX_PARAM_R(float, pickup2_position);
234VARIAX_PARAM_R(float, pickup2_angle);
235VARIAX_PARAM_R(float, pickup2_level);
236VARIAX_PARAM_R(int, pickup_phase);
237VARIAX_PARAM_R(float, capacitance);
238VARIAX_PARAM_R(float, tone_resistance);
239VARIAX_PARAM_R(float, volume_resistance);
240VARIAX_PARAM_R(int, taper);
241VARIAX_PARAM_R(float, tone_dump);
242VARIAX_PARAM_R(int, save_tone);
243VARIAX_PARAM_R(float, volume_dump);
244VARIAX_PARAM_R(int, tuning_enable);
245VARIAX_PARAM_R(int, tuning6);
246VARIAX_PARAM_R(int, tuning5);
247VARIAX_PARAM_R(int, tuning4);
248VARIAX_PARAM_R(int, tuning3);
249VARIAX_PARAM_R(int, tuning2);
250VARIAX_PARAM_R(int, tuning1);
251VARIAX_PARAM_R(float, detune6);
252VARIAX_PARAM_R(float, detune5);
253VARIAX_PARAM_R(float, detune4);
254VARIAX_PARAM_R(float, detune3);
255VARIAX_PARAM_R(float, detune2);
256VARIAX_PARAM_R(float, detune1);
257VARIAX_PARAM_R(float, mix6);
258VARIAX_PARAM_R(float, mix5);
259VARIAX_PARAM_R(float, mix4);
260VARIAX_PARAM_R(float, mix3);
261VARIAX_PARAM_R(float, mix2);
262VARIAX_PARAM_R(float, mix1);
263VARIAX_PARAM_R(int, pickup_wiring);
264
265static DEVICE_ATTR(tweak, S_IWUGO | S_IRUGO, pod_get_tweak, pod_set_tweak);
acdc1021
SB
266static DEVICE_ATTR(wah_position, S_IWUGO | S_IRUGO, pod_get_wah_position,
267 pod_set_wah_position);
268static DEVICE_ATTR(compression_gain, S_IWUGO | S_IRUGO,
269 pod_get_compression_gain, pod_set_compression_gain);
270static DEVICE_ATTR(vol_pedal_position, S_IWUGO | S_IRUGO,
271 pod_get_vol_pedal_position, pod_set_vol_pedal_position);
272static DEVICE_ATTR(compression_threshold, S_IWUGO | S_IRUGO,
273 pod_get_compression_threshold,
274 pod_set_compression_threshold);
705ececd 275static DEVICE_ATTR(pan, S_IWUGO | S_IRUGO, pod_get_pan, pod_set_pan);
acdc1021
SB
276static DEVICE_ATTR(amp_model_setup, S_IWUGO | S_IRUGO, pod_get_amp_model_setup,
277 pod_set_amp_model_setup);
278static DEVICE_ATTR(amp_model, S_IWUGO | S_IRUGO, pod_get_amp_model,
279 pod_set_amp_model);
705ececd
MG
280static DEVICE_ATTR(drive, S_IWUGO | S_IRUGO, pod_get_drive, pod_set_drive);
281static DEVICE_ATTR(bass, S_IWUGO | S_IRUGO, pod_get_bass, pod_set_bass);
282static DEVICE_ATTR(mid, S_IWUGO | S_IRUGO, pod_get_mid, pod_set_mid);
283static DEVICE_ATTR(lowmid, S_IWUGO | S_IRUGO, pod_get_lowmid, pod_set_lowmid);
284static DEVICE_ATTR(treble, S_IWUGO | S_IRUGO, pod_get_treble, pod_set_treble);
acdc1021
SB
285static DEVICE_ATTR(highmid, S_IWUGO | S_IRUGO, pod_get_highmid,
286 pod_set_highmid);
287static DEVICE_ATTR(chan_vol, S_IWUGO | S_IRUGO, pod_get_chan_vol,
288 pod_set_chan_vol);
289static DEVICE_ATTR(reverb_mix, S_IWUGO | S_IRUGO, pod_get_reverb_mix,
290 pod_set_reverb_mix);
291static DEVICE_ATTR(effect_setup, S_IWUGO | S_IRUGO, pod_get_effect_setup,
292 pod_set_effect_setup);
293static DEVICE_ATTR(band_1_frequency, S_IWUGO | S_IRUGO,
294 pod_get_band_1_frequency, pod_set_band_1_frequency);
295static DEVICE_ATTR(presence, S_IWUGO | S_IRUGO, pod_get_presence,
296 pod_set_presence);
297static DEVICE_ATTR2(treble__bass, treble, S_IWUGO | S_IRUGO,
298 pod_get_treble__bass, pod_set_treble__bass);
299static DEVICE_ATTR(noise_gate_enable, S_IWUGO | S_IRUGO,
300 pod_get_noise_gate_enable, pod_set_noise_gate_enable);
301static DEVICE_ATTR(gate_threshold, S_IWUGO | S_IRUGO, pod_get_gate_threshold,
302 pod_set_gate_threshold);
303static DEVICE_ATTR(gate_decay_time, S_IWUGO | S_IRUGO, pod_get_gate_decay_time,
304 pod_set_gate_decay_time);
305static DEVICE_ATTR(stomp_enable, S_IWUGO | S_IRUGO, pod_get_stomp_enable,
306 pod_set_stomp_enable);
307static DEVICE_ATTR(comp_enable, S_IWUGO | S_IRUGO, pod_get_comp_enable,
308 pod_set_comp_enable);
309static DEVICE_ATTR(stomp_time, S_IWUGO | S_IRUGO, pod_get_stomp_time,
310 pod_set_stomp_time);
311static DEVICE_ATTR(delay_enable, S_IWUGO | S_IRUGO, pod_get_delay_enable,
312 pod_set_delay_enable);
313static DEVICE_ATTR(mod_param_1, S_IWUGO | S_IRUGO, pod_get_mod_param_1,
314 pod_set_mod_param_1);
315static DEVICE_ATTR(delay_param_1, S_IWUGO | S_IRUGO, pod_get_delay_param_1,
316 pod_set_delay_param_1);
317static DEVICE_ATTR(delay_param_1_note_value, S_IWUGO | S_IRUGO,
318 pod_get_delay_param_1_note_value,
319 pod_set_delay_param_1_note_value);
320static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUGO | S_IRUGO,
321 pod_get_band_2_frequency__bass,
322 pod_set_band_2_frequency__bass);
323static DEVICE_ATTR(delay_param_2, S_IWUGO | S_IRUGO, pod_get_delay_param_2,
324 pod_set_delay_param_2);
325static DEVICE_ATTR(delay_volume_mix, S_IWUGO | S_IRUGO,
326 pod_get_delay_volume_mix, pod_set_delay_volume_mix);
327static DEVICE_ATTR(delay_param_3, S_IWUGO | S_IRUGO, pod_get_delay_param_3,
328 pod_set_delay_param_3);
329static DEVICE_ATTR(reverb_enable, S_IWUGO | S_IRUGO, pod_get_reverb_enable,
330 pod_set_reverb_enable);
331static DEVICE_ATTR(reverb_type, S_IWUGO | S_IRUGO, pod_get_reverb_type,
332 pod_set_reverb_type);
333static DEVICE_ATTR(reverb_decay, S_IWUGO | S_IRUGO, pod_get_reverb_decay,
334 pod_set_reverb_decay);
335static DEVICE_ATTR(reverb_tone, S_IWUGO | S_IRUGO, pod_get_reverb_tone,
336 pod_set_reverb_tone);
337static DEVICE_ATTR(reverb_pre_delay, S_IWUGO | S_IRUGO,
338 pod_get_reverb_pre_delay, pod_set_reverb_pre_delay);
339static DEVICE_ATTR(reverb_pre_post, S_IWUGO | S_IRUGO, pod_get_reverb_pre_post,
340 pod_set_reverb_pre_post);
341static DEVICE_ATTR(band_2_frequency, S_IWUGO | S_IRUGO,
342 pod_get_band_2_frequency, pod_set_band_2_frequency);
343static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUGO | S_IRUGO,
344 pod_get_band_3_frequency__bass,
345 pod_set_band_3_frequency__bass);
346static DEVICE_ATTR(wah_enable, S_IWUGO | S_IRUGO, pod_get_wah_enable,
347 pod_set_wah_enable);
348static DEVICE_ATTR(modulation_lo_cut, S_IWUGO | S_IRUGO,
349 pod_get_modulation_lo_cut, pod_set_modulation_lo_cut);
350static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUGO | S_IRUGO,
351 pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut);
352static DEVICE_ATTR(volume_pedal_minimum, S_IWUGO | S_IRUGO,
353 pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum);
354static DEVICE_ATTR(eq_pre_post, S_IWUGO | S_IRUGO, pod_get_eq_pre_post,
355 pod_set_eq_pre_post);
356static DEVICE_ATTR(volume_pre_post, S_IWUGO | S_IRUGO, pod_get_volume_pre_post,
357 pod_set_volume_pre_post);
358static DEVICE_ATTR(di_model, S_IWUGO | S_IRUGO, pod_get_di_model,
359 pod_set_di_model);
360static DEVICE_ATTR(di_delay, S_IWUGO | S_IRUGO, pod_get_di_delay,
361 pod_set_di_delay);
362static DEVICE_ATTR(mod_enable, S_IWUGO | S_IRUGO, pod_get_mod_enable,
363 pod_set_mod_enable);
364static DEVICE_ATTR(mod_param_1_note_value, S_IWUGO | S_IRUGO,
365 pod_get_mod_param_1_note_value,
366 pod_set_mod_param_1_note_value);
367static DEVICE_ATTR(mod_param_2, S_IWUGO | S_IRUGO, pod_get_mod_param_2,
368 pod_set_mod_param_2);
369static DEVICE_ATTR(mod_param_3, S_IWUGO | S_IRUGO, pod_get_mod_param_3,
370 pod_set_mod_param_3);
371static DEVICE_ATTR(mod_param_4, S_IWUGO | S_IRUGO, pod_get_mod_param_4,
372 pod_set_mod_param_4);
373static DEVICE_ATTR(mod_param_5, S_IWUGO | S_IRUGO, pod_get_mod_param_5,
374 pod_set_mod_param_5);
375static DEVICE_ATTR(mod_volume_mix, S_IWUGO | S_IRUGO, pod_get_mod_volume_mix,
376 pod_set_mod_volume_mix);
377static DEVICE_ATTR(mod_pre_post, S_IWUGO | S_IRUGO, pod_get_mod_pre_post,
378 pod_set_mod_pre_post);
379static DEVICE_ATTR(modulation_model, S_IWUGO | S_IRUGO,
380 pod_get_modulation_model, pod_set_modulation_model);
381static DEVICE_ATTR(band_3_frequency, S_IWUGO | S_IRUGO,
382 pod_get_band_3_frequency, pod_set_band_3_frequency);
383static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUGO | S_IRUGO,
384 pod_get_band_4_frequency__bass,
385 pod_set_band_4_frequency__bass);
386static DEVICE_ATTR(mod_param_1_double_precision, S_IWUGO | S_IRUGO,
387 pod_get_mod_param_1_double_precision,
388 pod_set_mod_param_1_double_precision);
389static DEVICE_ATTR(delay_param_1_double_precision, S_IWUGO | S_IRUGO,
390 pod_get_delay_param_1_double_precision,
391 pod_set_delay_param_1_double_precision);
392static DEVICE_ATTR(eq_enable, S_IWUGO | S_IRUGO, pod_get_eq_enable,
393 pod_set_eq_enable);
705ececd 394static DEVICE_ATTR(tap, S_IWUGO | S_IRUGO, pod_get_tap, pod_set_tap);
acdc1021
SB
395static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUGO | S_IRUGO,
396 pod_get_volume_tweak_pedal_assign,
397 pod_set_volume_tweak_pedal_assign);
398static DEVICE_ATTR(band_5_frequency, S_IWUGO | S_IRUGO,
399 pod_get_band_5_frequency, pod_set_band_5_frequency);
705ececd 400static DEVICE_ATTR(tuner, S_IWUGO | S_IRUGO, pod_get_tuner, pod_set_tuner);
acdc1021
SB
401static DEVICE_ATTR(mic_selection, S_IWUGO | S_IRUGO, pod_get_mic_selection,
402 pod_set_mic_selection);
403static DEVICE_ATTR(cabinet_model, S_IWUGO | S_IRUGO, pod_get_cabinet_model,
404 pod_set_cabinet_model);
405static DEVICE_ATTR(stomp_model, S_IWUGO | S_IRUGO, pod_get_stomp_model,
406 pod_set_stomp_model);
407static DEVICE_ATTR(roomlevel, S_IWUGO | S_IRUGO, pod_get_roomlevel,
408 pod_set_roomlevel);
409static DEVICE_ATTR(band_4_frequency, S_IWUGO | S_IRUGO,
410 pod_get_band_4_frequency, pod_set_band_4_frequency);
411static DEVICE_ATTR(band_6_frequency, S_IWUGO | S_IRUGO,
412 pod_get_band_6_frequency, pod_set_band_6_frequency);
413static DEVICE_ATTR(stomp_param_1_note_value, S_IWUGO | S_IRUGO,
414 pod_get_stomp_param_1_note_value,
415 pod_set_stomp_param_1_note_value);
416static DEVICE_ATTR(stomp_param_2, S_IWUGO | S_IRUGO, pod_get_stomp_param_2,
417 pod_set_stomp_param_2);
418static DEVICE_ATTR(stomp_param_3, S_IWUGO | S_IRUGO, pod_get_stomp_param_3,
419 pod_set_stomp_param_3);
420static DEVICE_ATTR(stomp_param_4, S_IWUGO | S_IRUGO, pod_get_stomp_param_4,
421 pod_set_stomp_param_4);
422static DEVICE_ATTR(stomp_param_5, S_IWUGO | S_IRUGO, pod_get_stomp_param_5,
423 pod_set_stomp_param_5);
424static DEVICE_ATTR(stomp_param_6, S_IWUGO | S_IRUGO, pod_get_stomp_param_6,
425 pod_set_stomp_param_6);
426static DEVICE_ATTR(amp_switch_select, S_IWUGO | S_IRUGO,
427 pod_get_amp_switch_select, pod_set_amp_switch_select);
428static DEVICE_ATTR(delay_param_4, S_IWUGO | S_IRUGO, pod_get_delay_param_4,
429 pod_set_delay_param_4);
430static DEVICE_ATTR(delay_param_5, S_IWUGO | S_IRUGO, pod_get_delay_param_5,
431 pod_set_delay_param_5);
432static DEVICE_ATTR(delay_pre_post, S_IWUGO | S_IRUGO, pod_get_delay_pre_post,
433 pod_set_delay_pre_post);
434static DEVICE_ATTR(delay_model, S_IWUGO | S_IRUGO, pod_get_delay_model,
435 pod_set_delay_model);
436static DEVICE_ATTR(delay_verb_model, S_IWUGO | S_IRUGO,
437 pod_get_delay_verb_model, pod_set_delay_verb_model);
438static DEVICE_ATTR(tempo_msb, S_IWUGO | S_IRUGO, pod_get_tempo_msb,
439 pod_set_tempo_msb);
440static DEVICE_ATTR(tempo_lsb, S_IWUGO | S_IRUGO, pod_get_tempo_lsb,
441 pod_set_tempo_lsb);
442static DEVICE_ATTR(wah_model, S_IWUGO | S_IRUGO, pod_get_wah_model,
443 pod_set_wah_model);
444static DEVICE_ATTR(bypass_volume, S_IWUGO | S_IRUGO, pod_get_bypass_volume,
445 pod_set_bypass_volume);
446static DEVICE_ATTR(fx_loop_on_off, S_IWUGO | S_IRUGO, pod_get_fx_loop_on_off,
447 pod_set_fx_loop_on_off);
448static DEVICE_ATTR(tweak_param_select, S_IWUGO | S_IRUGO,
449 pod_get_tweak_param_select, pod_set_tweak_param_select);
450static DEVICE_ATTR(amp1_engage, S_IWUGO | S_IRUGO, pod_get_amp1_engage,
451 pod_set_amp1_engage);
452static DEVICE_ATTR(band_1_gain, S_IWUGO | S_IRUGO, pod_get_band_1_gain,
453 pod_set_band_1_gain);
454static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUGO | S_IRUGO,
455 pod_get_band_2_gain__bass, pod_set_band_2_gain__bass);
456static DEVICE_ATTR(band_2_gain, S_IWUGO | S_IRUGO, pod_get_band_2_gain,
457 pod_set_band_2_gain);
458static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUGO | S_IRUGO,
459 pod_get_band_3_gain__bass, pod_set_band_3_gain__bass);
460static DEVICE_ATTR(band_3_gain, S_IWUGO | S_IRUGO, pod_get_band_3_gain,
461 pod_set_band_3_gain);
462static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUGO | S_IRUGO,
463 pod_get_band_4_gain__bass, pod_set_band_4_gain__bass);
464static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUGO | S_IRUGO,
465 pod_get_band_5_gain__bass, pod_set_band_5_gain__bass);
466static DEVICE_ATTR(band_4_gain, S_IWUGO | S_IRUGO, pod_get_band_4_gain,
467 pod_set_band_4_gain);
468static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUGO | S_IRUGO,
469 pod_get_band_6_gain__bass, pod_set_band_6_gain__bass);
705ececd 470static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write);
acdc1021
SB
471static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable,
472 line6_nop_write);
473static DEVICE_ATTR(pickup1_type, S_IRUGO, variax_get_pickup1_type,
474 line6_nop_write);
475static DEVICE_ATTR(pickup1_position, S_IRUGO, variax_get_pickup1_position,
476 line6_nop_write);
477static DEVICE_ATTR(pickup1_angle, S_IRUGO, variax_get_pickup1_angle,
478 line6_nop_write);
479static DEVICE_ATTR(pickup1_level, S_IRUGO, variax_get_pickup1_level,
480 line6_nop_write);
481static DEVICE_ATTR(pickup2_enable, S_IRUGO, variax_get_pickup2_enable,
482 line6_nop_write);
483static DEVICE_ATTR(pickup2_type, S_IRUGO, variax_get_pickup2_type,
484 line6_nop_write);
485static DEVICE_ATTR(pickup2_position, S_IRUGO, variax_get_pickup2_position,
486 line6_nop_write);
487static DEVICE_ATTR(pickup2_angle, S_IRUGO, variax_get_pickup2_angle,
488 line6_nop_write);
489static DEVICE_ATTR(pickup2_level, S_IRUGO, variax_get_pickup2_level,
490 line6_nop_write);
491static DEVICE_ATTR(pickup_phase, S_IRUGO, variax_get_pickup_phase,
492 line6_nop_write);
493static DEVICE_ATTR(capacitance, S_IRUGO, variax_get_capacitance,
494 line6_nop_write);
495static DEVICE_ATTR(tone_resistance, S_IRUGO, variax_get_tone_resistance,
496 line6_nop_write);
497static DEVICE_ATTR(volume_resistance, S_IRUGO, variax_get_volume_resistance,
498 line6_nop_write);
705ececd
MG
499static DEVICE_ATTR(taper, S_IRUGO, variax_get_taper, line6_nop_write);
500static DEVICE_ATTR(tone_dump, S_IRUGO, variax_get_tone_dump, line6_nop_write);
501static DEVICE_ATTR(save_tone, S_IRUGO, variax_get_save_tone, line6_nop_write);
acdc1021
SB
502static DEVICE_ATTR(volume_dump, S_IRUGO, variax_get_volume_dump,
503 line6_nop_write);
504static DEVICE_ATTR(tuning_enable, S_IRUGO, variax_get_tuning_enable,
505 line6_nop_write);
705ececd
MG
506static DEVICE_ATTR(tuning6, S_IRUGO, variax_get_tuning6, line6_nop_write);
507static DEVICE_ATTR(tuning5, S_IRUGO, variax_get_tuning5, line6_nop_write);
508static DEVICE_ATTR(tuning4, S_IRUGO, variax_get_tuning4, line6_nop_write);
509static DEVICE_ATTR(tuning3, S_IRUGO, variax_get_tuning3, line6_nop_write);
510static DEVICE_ATTR(tuning2, S_IRUGO, variax_get_tuning2, line6_nop_write);
511static DEVICE_ATTR(tuning1, S_IRUGO, variax_get_tuning1, line6_nop_write);
512static DEVICE_ATTR(detune6, S_IRUGO, variax_get_detune6, line6_nop_write);
513static DEVICE_ATTR(detune5, S_IRUGO, variax_get_detune5, line6_nop_write);
514static DEVICE_ATTR(detune4, S_IRUGO, variax_get_detune4, line6_nop_write);
515static DEVICE_ATTR(detune3, S_IRUGO, variax_get_detune3, line6_nop_write);
516static DEVICE_ATTR(detune2, S_IRUGO, variax_get_detune2, line6_nop_write);
517static DEVICE_ATTR(detune1, S_IRUGO, variax_get_detune1, line6_nop_write);
518static DEVICE_ATTR(mix6, S_IRUGO, variax_get_mix6, line6_nop_write);
519static DEVICE_ATTR(mix5, S_IRUGO, variax_get_mix5, line6_nop_write);
520static DEVICE_ATTR(mix4, S_IRUGO, variax_get_mix4, line6_nop_write);
521static DEVICE_ATTR(mix3, S_IRUGO, variax_get_mix3, line6_nop_write);
522static DEVICE_ATTR(mix2, S_IRUGO, variax_get_mix2, line6_nop_write);
523static DEVICE_ATTR(mix1, S_IRUGO, variax_get_mix1, line6_nop_write);
acdc1021
SB
524static DEVICE_ATTR(pickup_wiring, S_IRUGO, variax_get_pickup_wiring,
525 line6_nop_write);
705ececd 526
9a92fadc
GKH
527int pod_create_files(int firmware, int type, struct device *dev)
528{
705ececd
MG
529 int err;
530 CHECK_RETURN(device_create_file(dev, &dev_attr_tweak));
531 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_position));
9a92fadc 532 if ((type & (LINE6_BITS_PODXTALL)) != 0)
acdc1021
SB
533 CHECK_RETURN(device_create_file
534 (dev, &dev_attr_compression_gain));
705ececd
MG
535 CHECK_RETURN(device_create_file(dev, &dev_attr_vol_pedal_position));
536 CHECK_RETURN(device_create_file(dev, &dev_attr_compression_threshold));
537 CHECK_RETURN(device_create_file(dev, &dev_attr_pan));
538 CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model_setup));
9a92fadc
GKH
539 if (firmware >= 200)
540 CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model));
705ececd
MG
541 CHECK_RETURN(device_create_file(dev, &dev_attr_drive));
542 CHECK_RETURN(device_create_file(dev, &dev_attr_bass));
9a92fadc
GKH
543 if ((type & (LINE6_BITS_PODXTALL)) != 0)
544 CHECK_RETURN(device_create_file(dev, &dev_attr_mid));
545 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
546 CHECK_RETURN(device_create_file(dev, &dev_attr_lowmid));
547 if ((type & (LINE6_BITS_PODXTALL)) != 0)
548 CHECK_RETURN(device_create_file(dev, &dev_attr_treble));
549 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
550 CHECK_RETURN(device_create_file(dev, &dev_attr_highmid));
705ececd 551 CHECK_RETURN(device_create_file(dev, &dev_attr_chan_vol));
9a92fadc
GKH
552 if ((type & (LINE6_BITS_PODXTALL)) != 0)
553 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_mix));
705ececd 554 CHECK_RETURN(device_create_file(dev, &dev_attr_effect_setup));
9a92fadc 555 if (firmware >= 200)
acdc1021
SB
556 CHECK_RETURN(device_create_file
557 (dev, &dev_attr_band_1_frequency));
9a92fadc
GKH
558 if ((type & (LINE6_BITS_PODXTALL)) != 0)
559 CHECK_RETURN(device_create_file(dev, &dev_attr_presence));
560 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
561 CHECK_RETURN(device_create_file(dev, &dev_attr_treble__bass));
705ececd
MG
562 CHECK_RETURN(device_create_file(dev, &dev_attr_noise_gate_enable));
563 CHECK_RETURN(device_create_file(dev, &dev_attr_gate_threshold));
564 CHECK_RETURN(device_create_file(dev, &dev_attr_gate_decay_time));
565 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_enable));
566 CHECK_RETURN(device_create_file(dev, &dev_attr_comp_enable));
567 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_time));
568 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_enable));
569 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1));
570 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_1));
acdc1021
SB
571 CHECK_RETURN(device_create_file
572 (dev, &dev_attr_delay_param_1_note_value));
9a92fadc
GKH
573 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
574 if (firmware >= 200)
acdc1021
SB
575 CHECK_RETURN(device_create_file
576 (dev, &dev_attr_band_2_frequency__bass));
705ececd
MG
577 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_2));
578 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_volume_mix));
579 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_3));
9a92fadc
GKH
580 if ((type & (LINE6_BITS_PODXTALL)) != 0)
581 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_enable));
582 if ((type & (LINE6_BITS_PODXTALL)) != 0)
583 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_type));
584 if ((type & (LINE6_BITS_PODXTALL)) != 0)
585 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_decay));
586 if ((type & (LINE6_BITS_PODXTALL)) != 0)
587 CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_tone));
588 if ((type & (LINE6_BITS_PODXTALL)) != 0)
acdc1021
SB
589 CHECK_RETURN(device_create_file
590 (dev, &dev_attr_reverb_pre_delay));
9a92fadc 591 if ((type & (LINE6_BITS_PODXTALL)) != 0)
acdc1021
SB
592 CHECK_RETURN(device_create_file
593 (dev, &dev_attr_reverb_pre_post));
9a92fadc
GKH
594 if ((type & (LINE6_BITS_PODXTALL)) != 0)
595 if (firmware >= 200)
acdc1021
SB
596 CHECK_RETURN(device_create_file
597 (dev, &dev_attr_band_2_frequency));
9a92fadc
GKH
598 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
599 if (firmware >= 200)
acdc1021
SB
600 CHECK_RETURN(device_create_file
601 (dev, &dev_attr_band_3_frequency__bass));
705ececd 602 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_enable));
9a92fadc 603 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
acdc1021
SB
604 CHECK_RETURN(device_create_file
605 (dev, &dev_attr_modulation_lo_cut));
9a92fadc 606 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
acdc1021
SB
607 CHECK_RETURN(device_create_file
608 (dev, &dev_attr_delay_reverb_lo_cut));
9a92fadc
GKH
609 if ((type & (LINE6_BITS_PODXTALL)) != 0)
610 if (firmware >= 200)
acdc1021
SB
611 CHECK_RETURN(device_create_file
612 (dev, &dev_attr_volume_pedal_minimum));
9a92fadc
GKH
613 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
614 if (firmware >= 200)
acdc1021
SB
615 CHECK_RETURN(device_create_file
616 (dev, &dev_attr_eq_pre_post));
705ececd 617 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_pre_post));
9a92fadc
GKH
618 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
619 CHECK_RETURN(device_create_file(dev, &dev_attr_di_model));
620 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
621 CHECK_RETURN(device_create_file(dev, &dev_attr_di_delay));
705ececd
MG
622 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_enable));
623 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1_note_value));
624 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_2));
625 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_3));
626 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_4));
9a92fadc
GKH
627 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
628 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_5));
705ececd
MG
629 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_volume_mix));
630 CHECK_RETURN(device_create_file(dev, &dev_attr_mod_pre_post));
631 CHECK_RETURN(device_create_file(dev, &dev_attr_modulation_model));
9a92fadc
GKH
632 if ((type & (LINE6_BITS_PODXTALL)) != 0)
633 if (firmware >= 200)
acdc1021
SB
634 CHECK_RETURN(device_create_file
635 (dev, &dev_attr_band_3_frequency));
9a92fadc
GKH
636 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
637 if (firmware >= 200)
acdc1021
SB
638 CHECK_RETURN(device_create_file
639 (dev, &dev_attr_band_4_frequency__bass));
640 CHECK_RETURN(device_create_file
641 (dev, &dev_attr_mod_param_1_double_precision));
642 CHECK_RETURN(device_create_file
643 (dev, &dev_attr_delay_param_1_double_precision));
9a92fadc
GKH
644 if (firmware >= 200)
645 CHECK_RETURN(device_create_file(dev, &dev_attr_eq_enable));
705ececd 646 CHECK_RETURN(device_create_file(dev, &dev_attr_tap));
acdc1021
SB
647 CHECK_RETURN(device_create_file
648 (dev, &dev_attr_volume_tweak_pedal_assign));
9a92fadc
GKH
649 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
650 if (firmware >= 200)
acdc1021
SB
651 CHECK_RETURN(device_create_file
652 (dev, &dev_attr_band_5_frequency));
705ececd
MG
653 CHECK_RETURN(device_create_file(dev, &dev_attr_tuner));
654 CHECK_RETURN(device_create_file(dev, &dev_attr_mic_selection));
655 CHECK_RETURN(device_create_file(dev, &dev_attr_cabinet_model));
656 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_model));
657 CHECK_RETURN(device_create_file(dev, &dev_attr_roomlevel));
9a92fadc
GKH
658 if ((type & (LINE6_BITS_PODXTALL)) != 0)
659 if (firmware >= 200)
acdc1021
SB
660 CHECK_RETURN(device_create_file
661 (dev, &dev_attr_band_4_frequency));
9a92fadc
GKH
662 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
663 if (firmware >= 200)
acdc1021
SB
664 CHECK_RETURN(device_create_file
665 (dev, &dev_attr_band_6_frequency));
666 CHECK_RETURN(device_create_file
667 (dev, &dev_attr_stomp_param_1_note_value));
705ececd
MG
668 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_2));
669 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_3));
670 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_4));
671 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_5));
672 CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_6));
9a92fadc 673 if ((type & (LINE6_BITS_LIVE)) != 0)
acdc1021
SB
674 CHECK_RETURN(device_create_file
675 (dev, &dev_attr_amp_switch_select));
705ececd
MG
676 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_4));
677 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_5));
678 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_pre_post));
9a92fadc
GKH
679 if ((type & (LINE6_BITS_PODXTALL)) != 0)
680 CHECK_RETURN(device_create_file(dev, &dev_attr_delay_model));
681 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
acdc1021
SB
682 CHECK_RETURN(device_create_file
683 (dev, &dev_attr_delay_verb_model));
705ececd
MG
684 CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_msb));
685 CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_lsb));
9a92fadc
GKH
686 if (firmware >= 300)
687 CHECK_RETURN(device_create_file(dev, &dev_attr_wah_model));
688 if (firmware >= 214)
689 CHECK_RETURN(device_create_file(dev, &dev_attr_bypass_volume));
690 if ((type & (LINE6_BITS_PRO)) != 0)
691 CHECK_RETURN(device_create_file(dev, &dev_attr_fx_loop_on_off));
705ececd
MG
692 CHECK_RETURN(device_create_file(dev, &dev_attr_tweak_param_select));
693 CHECK_RETURN(device_create_file(dev, &dev_attr_amp1_engage));
9a92fadc
GKH
694 if (firmware >= 200)
695 CHECK_RETURN(device_create_file(dev, &dev_attr_band_1_gain));
696 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
697 if (firmware >= 200)
acdc1021
SB
698 CHECK_RETURN(device_create_file
699 (dev, &dev_attr_band_2_gain__bass));
9a92fadc
GKH
700 if ((type & (LINE6_BITS_PODXTALL)) != 0)
701 if (firmware >= 200)
acdc1021
SB
702 CHECK_RETURN(device_create_file
703 (dev, &dev_attr_band_2_gain));
9a92fadc
GKH
704 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
705 if (firmware >= 200)
acdc1021
SB
706 CHECK_RETURN(device_create_file
707 (dev, &dev_attr_band_3_gain__bass));
9a92fadc
GKH
708 if ((type & (LINE6_BITS_PODXTALL)) != 0)
709 if (firmware >= 200)
acdc1021
SB
710 CHECK_RETURN(device_create_file
711 (dev, &dev_attr_band_3_gain));
9a92fadc
GKH
712 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
713 if (firmware >= 200)
acdc1021
SB
714 CHECK_RETURN(device_create_file
715 (dev, &dev_attr_band_4_gain__bass));
9a92fadc
GKH
716 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
717 if (firmware >= 200)
acdc1021
SB
718 CHECK_RETURN(device_create_file
719 (dev, &dev_attr_band_5_gain__bass));
9a92fadc
GKH
720 if ((type & (LINE6_BITS_PODXTALL)) != 0)
721 if (firmware >= 200)
acdc1021
SB
722 CHECK_RETURN(device_create_file
723 (dev, &dev_attr_band_4_gain));
9a92fadc
GKH
724 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
725 if (firmware >= 200)
acdc1021
SB
726 CHECK_RETURN(device_create_file
727 (dev, &dev_attr_band_6_gain__bass));
728 return 0;
705ececd 729}
2a20bf6f 730EXPORT_SYMBOL(pod_create_files);
705ececd 731
9a92fadc
GKH
732void pod_remove_files(int firmware, int type, struct device *dev)
733{
705ececd
MG
734 device_remove_file(dev, &dev_attr_tweak);
735 device_remove_file(dev, &dev_attr_wah_position);
9a92fadc
GKH
736 if ((type & (LINE6_BITS_PODXTALL)) != 0)
737 device_remove_file(dev, &dev_attr_compression_gain);
705ececd
MG
738 device_remove_file(dev, &dev_attr_vol_pedal_position);
739 device_remove_file(dev, &dev_attr_compression_threshold);
740 device_remove_file(dev, &dev_attr_pan);
741 device_remove_file(dev, &dev_attr_amp_model_setup);
9a92fadc
GKH
742 if (firmware >= 200)
743 device_remove_file(dev, &dev_attr_amp_model);
705ececd
MG
744 device_remove_file(dev, &dev_attr_drive);
745 device_remove_file(dev, &dev_attr_bass);
9a92fadc
GKH
746 if ((type & (LINE6_BITS_PODXTALL)) != 0)
747 device_remove_file(dev, &dev_attr_mid);
748 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
749 device_remove_file(dev, &dev_attr_lowmid);
750 if ((type & (LINE6_BITS_PODXTALL)) != 0)
751 device_remove_file(dev, &dev_attr_treble);
752 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
753 device_remove_file(dev, &dev_attr_highmid);
705ececd 754 device_remove_file(dev, &dev_attr_chan_vol);
9a92fadc
GKH
755 if ((type & (LINE6_BITS_PODXTALL)) != 0)
756 device_remove_file(dev, &dev_attr_reverb_mix);
705ececd 757 device_remove_file(dev, &dev_attr_effect_setup);
9a92fadc
GKH
758 if (firmware >= 200)
759 device_remove_file(dev, &dev_attr_band_1_frequency);
760 if ((type & (LINE6_BITS_PODXTALL)) != 0)
761 device_remove_file(dev, &dev_attr_presence);
762 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
763 device_remove_file(dev, &dev_attr_treble__bass);
705ececd
MG
764 device_remove_file(dev, &dev_attr_noise_gate_enable);
765 device_remove_file(dev, &dev_attr_gate_threshold);
766 device_remove_file(dev, &dev_attr_gate_decay_time);
767 device_remove_file(dev, &dev_attr_stomp_enable);
768 device_remove_file(dev, &dev_attr_comp_enable);
769 device_remove_file(dev, &dev_attr_stomp_time);
770 device_remove_file(dev, &dev_attr_delay_enable);
771 device_remove_file(dev, &dev_attr_mod_param_1);
772 device_remove_file(dev, &dev_attr_delay_param_1);
773 device_remove_file(dev, &dev_attr_delay_param_1_note_value);
9a92fadc
GKH
774 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
775 if (firmware >= 200)
acdc1021
SB
776 device_remove_file(dev,
777 &dev_attr_band_2_frequency__bass);
705ececd
MG
778 device_remove_file(dev, &dev_attr_delay_param_2);
779 device_remove_file(dev, &dev_attr_delay_volume_mix);
780 device_remove_file(dev, &dev_attr_delay_param_3);
9a92fadc
GKH
781 if ((type & (LINE6_BITS_PODXTALL)) != 0)
782 device_remove_file(dev, &dev_attr_reverb_enable);
783 if ((type & (LINE6_BITS_PODXTALL)) != 0)
784 device_remove_file(dev, &dev_attr_reverb_type);
785 if ((type & (LINE6_BITS_PODXTALL)) != 0)
786 device_remove_file(dev, &dev_attr_reverb_decay);
787 if ((type & (LINE6_BITS_PODXTALL)) != 0)
788 device_remove_file(dev, &dev_attr_reverb_tone);
789 if ((type & (LINE6_BITS_PODXTALL)) != 0)
790 device_remove_file(dev, &dev_attr_reverb_pre_delay);
791 if ((type & (LINE6_BITS_PODXTALL)) != 0)
792 device_remove_file(dev, &dev_attr_reverb_pre_post);
793 if ((type & (LINE6_BITS_PODXTALL)) != 0)
794 if (firmware >= 200)
795 device_remove_file(dev, &dev_attr_band_2_frequency);
796 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
797 if (firmware >= 200)
acdc1021
SB
798 device_remove_file(dev,
799 &dev_attr_band_3_frequency__bass);
705ececd 800 device_remove_file(dev, &dev_attr_wah_enable);
9a92fadc
GKH
801 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
802 device_remove_file(dev, &dev_attr_modulation_lo_cut);
803 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
804 device_remove_file(dev, &dev_attr_delay_reverb_lo_cut);
805 if ((type & (LINE6_BITS_PODXTALL)) != 0)
806 if (firmware >= 200)
807 device_remove_file(dev, &dev_attr_volume_pedal_minimum);
808 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
809 if (firmware >= 200)
810 device_remove_file(dev, &dev_attr_eq_pre_post);
705ececd 811 device_remove_file(dev, &dev_attr_volume_pre_post);
9a92fadc
GKH
812 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
813 device_remove_file(dev, &dev_attr_di_model);
814 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
815 device_remove_file(dev, &dev_attr_di_delay);
705ececd
MG
816 device_remove_file(dev, &dev_attr_mod_enable);
817 device_remove_file(dev, &dev_attr_mod_param_1_note_value);
818 device_remove_file(dev, &dev_attr_mod_param_2);
819 device_remove_file(dev, &dev_attr_mod_param_3);
820 device_remove_file(dev, &dev_attr_mod_param_4);
9a92fadc
GKH
821 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
822 device_remove_file(dev, &dev_attr_mod_param_5);
705ececd
MG
823 device_remove_file(dev, &dev_attr_mod_volume_mix);
824 device_remove_file(dev, &dev_attr_mod_pre_post);
825 device_remove_file(dev, &dev_attr_modulation_model);
9a92fadc
GKH
826 if ((type & (LINE6_BITS_PODXTALL)) != 0)
827 if (firmware >= 200)
828 device_remove_file(dev, &dev_attr_band_3_frequency);
829 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
830 if (firmware >= 200)
acdc1021
SB
831 device_remove_file(dev,
832 &dev_attr_band_4_frequency__bass);
705ececd
MG
833 device_remove_file(dev, &dev_attr_mod_param_1_double_precision);
834 device_remove_file(dev, &dev_attr_delay_param_1_double_precision);
9a92fadc
GKH
835 if (firmware >= 200)
836 device_remove_file(dev, &dev_attr_eq_enable);
705ececd
MG
837 device_remove_file(dev, &dev_attr_tap);
838 device_remove_file(dev, &dev_attr_volume_tweak_pedal_assign);
9a92fadc
GKH
839 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
840 if (firmware >= 200)
841 device_remove_file(dev, &dev_attr_band_5_frequency);
705ececd
MG
842 device_remove_file(dev, &dev_attr_tuner);
843 device_remove_file(dev, &dev_attr_mic_selection);
844 device_remove_file(dev, &dev_attr_cabinet_model);
845 device_remove_file(dev, &dev_attr_stomp_model);
846 device_remove_file(dev, &dev_attr_roomlevel);
9a92fadc
GKH
847 if ((type & (LINE6_BITS_PODXTALL)) != 0)
848 if (firmware >= 200)
849 device_remove_file(dev, &dev_attr_band_4_frequency);
850 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
851 if (firmware >= 200)
852 device_remove_file(dev, &dev_attr_band_6_frequency);
705ececd
MG
853 device_remove_file(dev, &dev_attr_stomp_param_1_note_value);
854 device_remove_file(dev, &dev_attr_stomp_param_2);
855 device_remove_file(dev, &dev_attr_stomp_param_3);
856 device_remove_file(dev, &dev_attr_stomp_param_4);
857 device_remove_file(dev, &dev_attr_stomp_param_5);
858 device_remove_file(dev, &dev_attr_stomp_param_6);
9a92fadc
GKH
859 if ((type & (LINE6_BITS_LIVE)) != 0)
860 device_remove_file(dev, &dev_attr_amp_switch_select);
705ececd
MG
861 device_remove_file(dev, &dev_attr_delay_param_4);
862 device_remove_file(dev, &dev_attr_delay_param_5);
863 device_remove_file(dev, &dev_attr_delay_pre_post);
9a92fadc
GKH
864 if ((type & (LINE6_BITS_PODXTALL)) != 0)
865 device_remove_file(dev, &dev_attr_delay_model);
866 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
867 device_remove_file(dev, &dev_attr_delay_verb_model);
705ececd
MG
868 device_remove_file(dev, &dev_attr_tempo_msb);
869 device_remove_file(dev, &dev_attr_tempo_lsb);
9a92fadc
GKH
870 if (firmware >= 300)
871 device_remove_file(dev, &dev_attr_wah_model);
872 if (firmware >= 214)
873 device_remove_file(dev, &dev_attr_bypass_volume);
874 if ((type & (LINE6_BITS_PRO)) != 0)
875 device_remove_file(dev, &dev_attr_fx_loop_on_off);
705ececd
MG
876 device_remove_file(dev, &dev_attr_tweak_param_select);
877 device_remove_file(dev, &dev_attr_amp1_engage);
9a92fadc
GKH
878 if (firmware >= 200)
879 device_remove_file(dev, &dev_attr_band_1_gain);
880 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
881 if (firmware >= 200)
882 device_remove_file(dev, &dev_attr_band_2_gain__bass);
883 if ((type & (LINE6_BITS_PODXTALL)) != 0)
884 if (firmware >= 200)
885 device_remove_file(dev, &dev_attr_band_2_gain);
886 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
887 if (firmware >= 200)
888 device_remove_file(dev, &dev_attr_band_3_gain__bass);
889 if ((type & (LINE6_BITS_PODXTALL)) != 0)
890 if (firmware >= 200)
891 device_remove_file(dev, &dev_attr_band_3_gain);
892 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
893 if (firmware >= 200)
894 device_remove_file(dev, &dev_attr_band_4_gain__bass);
895 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
896 if (firmware >= 200)
897 device_remove_file(dev, &dev_attr_band_5_gain__bass);
898 if ((type & (LINE6_BITS_PODXTALL)) != 0)
899 if (firmware >= 200)
900 device_remove_file(dev, &dev_attr_band_4_gain);
901 if ((type & (LINE6_BITS_BASSPODXTALL)) != 0)
902 if (firmware >= 200)
903 device_remove_file(dev, &dev_attr_band_6_gain__bass);
705ececd 904}
705ececd
MG
905EXPORT_SYMBOL(pod_remove_files);
906
9a92fadc
GKH
907int variax_create_files(int firmware, int type, struct device *dev)
908{
705ececd
MG
909 int err;
910 CHECK_RETURN(device_create_file(dev, &dev_attr_body));
911 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_enable));
912 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_type));
913 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_position));
914 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_angle));
915 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_level));
916 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_enable));
917 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_type));
918 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_position));
919 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_angle));
920 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_level));
921 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_phase));
922 CHECK_RETURN(device_create_file(dev, &dev_attr_capacitance));
923 CHECK_RETURN(device_create_file(dev, &dev_attr_tone_resistance));
924 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_resistance));
925 CHECK_RETURN(device_create_file(dev, &dev_attr_taper));
926 CHECK_RETURN(device_create_file(dev, &dev_attr_tone_dump));
927 CHECK_RETURN(device_create_file(dev, &dev_attr_save_tone));
928 CHECK_RETURN(device_create_file(dev, &dev_attr_volume_dump));
929 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning_enable));
930 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning6));
931 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning5));
932 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning4));
933 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning3));
934 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning2));
935 CHECK_RETURN(device_create_file(dev, &dev_attr_tuning1));
936 CHECK_RETURN(device_create_file(dev, &dev_attr_detune6));
937 CHECK_RETURN(device_create_file(dev, &dev_attr_detune5));
938 CHECK_RETURN(device_create_file(dev, &dev_attr_detune4));
939 CHECK_RETURN(device_create_file(dev, &dev_attr_detune3));
940 CHECK_RETURN(device_create_file(dev, &dev_attr_detune2));
941 CHECK_RETURN(device_create_file(dev, &dev_attr_detune1));
942 CHECK_RETURN(device_create_file(dev, &dev_attr_mix6));
943 CHECK_RETURN(device_create_file(dev, &dev_attr_mix5));
944 CHECK_RETURN(device_create_file(dev, &dev_attr_mix4));
945 CHECK_RETURN(device_create_file(dev, &dev_attr_mix3));
946 CHECK_RETURN(device_create_file(dev, &dev_attr_mix2));
947 CHECK_RETURN(device_create_file(dev, &dev_attr_mix1));
948 CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_wiring));
acdc1021 949 return 0;
705ececd 950}
2a20bf6f 951EXPORT_SYMBOL(variax_create_files);
705ececd 952
9a92fadc
GKH
953void variax_remove_files(int firmware, int type, struct device *dev)
954{
705ececd
MG
955 device_remove_file(dev, &dev_attr_body);
956 device_remove_file(dev, &dev_attr_pickup1_enable);
957 device_remove_file(dev, &dev_attr_pickup1_type);
958 device_remove_file(dev, &dev_attr_pickup1_position);
959 device_remove_file(dev, &dev_attr_pickup1_angle);
960 device_remove_file(dev, &dev_attr_pickup1_level);
961 device_remove_file(dev, &dev_attr_pickup2_enable);
962 device_remove_file(dev, &dev_attr_pickup2_type);
963 device_remove_file(dev, &dev_attr_pickup2_position);
964 device_remove_file(dev, &dev_attr_pickup2_angle);
965 device_remove_file(dev, &dev_attr_pickup2_level);
966 device_remove_file(dev, &dev_attr_pickup_phase);
967 device_remove_file(dev, &dev_attr_capacitance);
968 device_remove_file(dev, &dev_attr_tone_resistance);
969 device_remove_file(dev, &dev_attr_volume_resistance);
970 device_remove_file(dev, &dev_attr_taper);
971 device_remove_file(dev, &dev_attr_tone_dump);
972 device_remove_file(dev, &dev_attr_save_tone);
973 device_remove_file(dev, &dev_attr_volume_dump);
974 device_remove_file(dev, &dev_attr_tuning_enable);
975 device_remove_file(dev, &dev_attr_tuning6);
976 device_remove_file(dev, &dev_attr_tuning5);
977 device_remove_file(dev, &dev_attr_tuning4);
978 device_remove_file(dev, &dev_attr_tuning3);
979 device_remove_file(dev, &dev_attr_tuning2);
980 device_remove_file(dev, &dev_attr_tuning1);
981 device_remove_file(dev, &dev_attr_detune6);
982 device_remove_file(dev, &dev_attr_detune5);
983 device_remove_file(dev, &dev_attr_detune4);
984 device_remove_file(dev, &dev_attr_detune3);
985 device_remove_file(dev, &dev_attr_detune2);
986 device_remove_file(dev, &dev_attr_detune1);
987 device_remove_file(dev, &dev_attr_mix6);
988 device_remove_file(dev, &dev_attr_mix5);
989 device_remove_file(dev, &dev_attr_mix4);
990 device_remove_file(dev, &dev_attr_mix3);
991 device_remove_file(dev, &dev_attr_mix2);
992 device_remove_file(dev, &dev_attr_mix1);
993 device_remove_file(dev, &dev_attr_pickup_wiring);
994}
705ececd 995EXPORT_SYMBOL(variax_remove_files);
This page took 0.117267 seconds and 5 git commands to generate.