2 * Line6 Linux USB driver - 0.9.1beta
4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
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.
15 #include <linux/interrupt.h>
16 #include <linux/spinlock.h>
17 #include <linux/usb.h>
18 #include <linux/wait.h>
20 #include <sound/core.h>
23 #include "dumprequest.h"
28 #define PODXTLIVE_INTERFACE_POD 0
29 #define PODXTLIVE_INTERFACE_VARIAX 1
32 Locate name in binary program dump
34 #define POD_NAME_OFFSET 0
35 #define POD_NAME_LENGTH 16
40 #define POD_CONTROL_SIZE 0x80
41 #define POD_BUFSIZE_DUMPREQ 7
42 #define POD_STARTUP_DELAY 1000
45 Stages of POD startup procedure
50 POD_STARTUP_VERSIONREQ
,
51 POD_STARTUP_WORKQUEUE
,
53 POD_STARTUP_LAST
= POD_STARTUP_SETUP
- 1
57 Data structure for values that need to be requested explicitly.
58 This is the case for system and tuner settings.
62 wait_queue_head_t wait
;
66 Binary PODxt Pro program dump
70 Header information (including program name).
72 unsigned char header
[0x20];
77 unsigned char control
[POD_CONTROL_SIZE
];
80 struct usb_line6_pod
{
82 Generic Line6 USB data.
84 struct usb_line6 line6
;
87 Dump request structure.
89 struct line6_dump_request dumpreq
;
92 Current program settings.
94 struct pod_program prog_data
;
97 Buffer for data retrieved from or to be stored on PODxt Pro.
99 struct pod_program prog_data_buf
;
104 struct ValueWait tuner_mute
;
107 Tuner base frequency (typically 440Hz).
109 struct ValueWait tuner_freq
;
112 Note received from tuner.
114 struct ValueWait tuner_note
;
117 Pitch value received from tuner.
119 struct ValueWait tuner_pitch
;
122 Instrument monitor level.
124 struct ValueWait monitor_level
;
128 0: send processed guitar
130 2: send clean guitar re-amp playback
131 3: send re-amp playback
133 struct ValueWait routing
;
136 Wait for audio clipping event.
138 struct ValueWait clipping
;
141 Timer for device initializaton.
143 struct timer_list startup_timer
;
146 Work handler for device initializaton.
148 struct work_struct startup_work
;
151 Current progress in startup procedure.
153 int startup_progress
;
156 Dirty flags for access to parameter data.
158 unsigned long param_dirty
[POD_CONTROL_SIZE
/ sizeof(unsigned long)];
163 unsigned long atomic_flags
;
166 Serial number of device.
171 Firmware version (x 100).
173 int firmware_version
;
181 Flag to indicate modification of current program settings.
186 Flag to enable MIDI postprocessing.
188 char midi_postprocess
;
191 extern void line6_pod_disconnect(struct usb_interface
*interface
);
192 extern int line6_pod_init(struct usb_interface
*interface
,
193 struct usb_line6_pod
*pod
);
194 extern void line6_pod_midi_postprocess(struct usb_line6_pod
*pod
,
195 unsigned char *data
, int length
);
196 extern void line6_pod_process_message(struct usb_line6_pod
*pod
);
197 extern void line6_pod_transmit_parameter(struct usb_line6_pod
*pod
, int param
,