The discovered bit in PGCCSR register indicates if the device has been
[linux-2.6/next.git] / drivers / staging / line6 / pod.h
blob18b9d08c3288f7942dc3f4e1ea1e866283979c7a
1 /*
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.
12 #ifndef POD_H
13 #define POD_H
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>
22 #include "driver.h"
23 #include "dumprequest.h"
26 PODxt Live interfaces
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
38 Other constants
40 #define POD_CONTROL_SIZE 0x80
41 #define POD_BUFSIZE_DUMPREQ 7
42 #define POD_STARTUP_DELAY 1000
45 Stages of POD startup procedure
47 enum {
48 POD_STARTUP_INIT = 1,
49 POD_STARTUP_DUMPREQ,
50 POD_STARTUP_VERSIONREQ,
51 POD_STARTUP_WORKQUEUE,
52 POD_STARTUP_SETUP,
53 POD_STARTUP_LAST = POD_STARTUP_SETUP - 1
56 /**
57 Data structure for values that need to be requested explicitly.
58 This is the case for system and tuner settings.
60 struct ValueWait {
61 int value;
62 wait_queue_head_t wait;
65 /**
66 Binary PODxt Pro program dump
68 struct pod_program {
69 /**
70 Header information (including program name).
72 unsigned char header[0x20];
74 /**
75 Program parameters.
77 unsigned char control[POD_CONTROL_SIZE];
80 struct usb_line6_pod {
81 /**
82 Generic Line6 USB data.
84 struct usb_line6 line6;
86 /**
87 Dump request structure.
89 struct line6_dump_request dumpreq;
91 /**
92 Current program number.
94 unsigned char channel_num;
96 /**
97 Current program settings.
99 struct pod_program prog_data;
102 Buffer for data retrieved from or to be stored on PODxt Pro.
104 struct pod_program prog_data_buf;
107 Tuner mute mode.
109 struct ValueWait tuner_mute;
112 Tuner base frequency (typically 440Hz).
114 struct ValueWait tuner_freq;
117 Note received from tuner.
119 struct ValueWait tuner_note;
122 Pitch value received from tuner.
124 struct ValueWait tuner_pitch;
127 Instrument monitor level.
129 struct ValueWait monitor_level;
132 Audio routing mode.
133 0: send processed guitar
134 1: send clean guitar
135 2: send clean guitar re-amp playback
136 3: send re-amp playback
138 struct ValueWait routing;
141 Wait for audio clipping event.
143 struct ValueWait clipping;
146 Timer for device initializaton.
148 struct timer_list startup_timer;
151 Work handler for device initializaton.
153 struct work_struct startup_work;
156 Current progress in startup procedure.
158 int startup_progress;
161 Dirty flags for access to parameter data.
163 unsigned long param_dirty[POD_CONTROL_SIZE / sizeof(unsigned long)];
166 Some atomic flags.
168 unsigned long atomic_flags;
171 Serial number of device.
173 int serial_number;
176 Firmware version (x 100).
178 int firmware_version;
181 Device ID.
183 int device_id;
186 Flag to indicate modification of current program settings.
188 char dirty;
191 Flag to enable MIDI postprocessing.
193 char midi_postprocess;
196 extern void line6_pod_disconnect(struct usb_interface *interface);
197 extern int line6_pod_init(struct usb_interface *interface,
198 struct usb_line6_pod *pod);
199 extern void line6_pod_midi_postprocess(struct usb_line6_pod *pod,
200 unsigned char *data, int length);
201 extern void line6_pod_process_message(struct usb_line6_pod *pod);
202 extern void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
203 int value);
205 #endif