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