Full support for Ginger Console
[linux-ginger.git] / drivers / staging / line6 / pod.h
blob7051ca613819aac554cabc9ee7bfdddc2f153702
1 /*
2 * Line6 Linux USB driver - 0.8.0
4 * Copyright (C) 2004-2009 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.
12 #ifndef POD_H
13 #define POD_H
16 #include "driver.h"
18 #include <linux/spinlock.h>
19 #include <linux/usb.h>
20 #include <linux/wait.h>
21 #include <linux/workqueue.h>
23 #include <sound/core.h>
25 #include "dumprequest.h"
29 PODxt Live interfaces
31 #define PODXTLIVE_INTERFACE_POD 0
32 #define PODXTLIVE_INTERFACE_VARIAX 1
35 Locate name in binary program dump
37 #define POD_NAME_OFFSET 0
38 #define POD_NAME_LENGTH 16
41 Other constants
43 #define POD_CONTROL_SIZE 0x80
44 #define POD_BUFSIZE_DUMPREQ 7
45 #define POD_STARTUP_DELAY 3
48 /**
49 Data structure for values that need to be requested explicitly.
50 This is the case for system and tuner settings.
52 struct ValueWait {
53 unsigned short value;
54 wait_queue_head_t wait;
57 /**
58 Binary PodXT Pro program dump
60 struct pod_program {
61 /**
62 Header information (including program name).
64 unsigned char header[0x20];
66 /**
67 Program parameters.
69 unsigned char control[POD_CONTROL_SIZE];
72 struct usb_line6_pod {
73 /**
74 Generic Line6 USB data.
76 struct usb_line6 line6;
78 /**
79 Dump request structure.
81 struct line6_dump_request dumpreq;
83 /**
84 Current program number.
86 unsigned char channel_num;
88 /**
89 Current program settings.
91 struct pod_program prog_data;
93 /**
94 Buffer for data retrieved from or to be stored on PODxt Pro.
96 struct pod_program prog_data_buf;
98 /**
99 Buffer for requesting version number.
101 unsigned char *buffer_versionreq;
104 Tuner mute mode.
106 struct ValueWait tuner_mute;
109 Tuner base frequency (typically 440Hz).
111 struct ValueWait tuner_freq;
114 Note received from tuner.
116 struct ValueWait tuner_note;
119 Pitch value received from tuner.
121 struct ValueWait tuner_pitch;
124 Instrument monitor level.
126 struct ValueWait monitor_level;
129 Audio routing mode.
130 0: send processed guitar
131 1: send clean guitar
132 2: send clean guitar re-amp playback
133 3: send re-amp playback
135 struct ValueWait routing;
138 Wait for audio clipping event.
140 struct ValueWait clipping;
143 Bottom-half for creation of sysfs special files.
145 struct work_struct create_files_work;
148 Dirty flags for access to parameter data.
150 unsigned long param_dirty[POD_CONTROL_SIZE / sizeof(unsigned long)];
153 Some atomic flags.
155 unsigned long atomic_flags;
158 Counter for startup process.
160 int startup_count;
163 Serial number of device.
165 int serial_number;
168 Firmware version (x 100).
170 int firmware_version;
173 Device ID.
175 int device_id;
178 Flag to indicate modification of current program settings.
180 char dirty;
183 Flag if initial firmware version request has been successful.
185 char versionreq_ok;
188 Flag to enable MIDI postprocessing.
190 char midi_postprocess;
194 extern void pod_disconnect(struct usb_interface *interface);
195 extern int pod_init(struct usb_interface *interface, struct usb_line6_pod *pod);
196 extern void pod_midi_postprocess(struct usb_line6_pod *pod,
197 unsigned char *data, int length);
198 extern void pod_process_message(struct usb_line6_pod *pod);
199 extern void pod_receive_parameter(struct usb_line6_pod *pod, int param);
200 extern void pod_transmit_parameter(struct usb_line6_pod *pod, int param,
201 int value);
204 #endif