diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/line6/capture.c | 5 | ||||
-rw-r--r-- | sound/usb/line6/driver.c | 4 | ||||
-rw-r--r-- | sound/usb/line6/driver.h | 89 | ||||
-rw-r--r-- | sound/usb/line6/midi.c | 1 | ||||
-rw-r--r-- | sound/usb/line6/midi.h | 32 | ||||
-rw-r--r-- | sound/usb/line6/pcm.h | 57 | ||||
-rw-r--r-- | sound/usb/line6/playback.c | 34 | ||||
-rw-r--r-- | sound/usb/line6/pod.c | 39 | ||||
-rw-r--r-- | sound/usb/line6/podhd.c | 16 | ||||
-rw-r--r-- | sound/usb/line6/revision.h | 4 | ||||
-rw-r--r-- | sound/usb/line6/toneport.c | 31 | ||||
-rw-r--r-- | sound/usb/line6/usbdefs.h | 27 | ||||
-rw-r--r-- | sound/usb/line6/variax.c | 25 |
13 files changed, 114 insertions, 250 deletions
diff --git a/sound/usb/line6/capture.c b/sound/usb/line6/capture.c index 4183c5f5edc2..f518fbbe88de 100644 --- a/sound/usb/line6/capture.c +++ b/sound/usb/line6/capture.c | |||
@@ -216,12 +216,11 @@ static int snd_line6_capture_open(struct snd_pcm_substream *substream) | |||
216 | 216 | ||
217 | err = snd_pcm_hw_constraint_ratdens(runtime, 0, | 217 | err = snd_pcm_hw_constraint_ratdens(runtime, 0, |
218 | SNDRV_PCM_HW_PARAM_RATE, | 218 | SNDRV_PCM_HW_PARAM_RATE, |
219 | (&line6pcm-> | 219 | &line6pcm->properties->rates); |
220 | properties->snd_line6_rates)); | ||
221 | if (err < 0) | 220 | if (err < 0) |
222 | return err; | 221 | return err; |
223 | 222 | ||
224 | runtime->hw = line6pcm->properties->snd_line6_capture_hw; | 223 | runtime->hw = line6pcm->properties->capture_hw; |
225 | return 0; | 224 | return 0; |
226 | } | 225 | } |
227 | 226 | ||
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index a0436993a167..2328ec9a1ca8 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include "driver.h" | 22 | #include "driver.h" |
23 | #include "midi.h" | 23 | #include "midi.h" |
24 | #include "playback.h" | 24 | #include "playback.h" |
25 | #include "revision.h" | ||
26 | #include "usbdefs.h" | ||
27 | 25 | ||
28 | #define DRIVER_AUTHOR "Markus Grabner <grabner@icg.tugraz.at>" | 26 | #define DRIVER_AUTHOR "Markus Grabner <grabner@icg.tugraz.at>" |
29 | #define DRIVER_DESC "Line 6 USB Driver" | 27 | #define DRIVER_DESC "Line 6 USB Driver" |
@@ -44,7 +42,7 @@ static const char line6_request_version[] = { | |||
44 | 0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7 | 42 | 0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7 |
45 | }; | 43 | }; |
46 | 44 | ||
47 | /** | 45 | /* |
48 | Class for asynchronous messages. | 46 | Class for asynchronous messages. |
49 | */ | 47 | */ |
50 | struct message { | 48 | struct message { |
diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index fce10f12f0d3..fa877a345860 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h | |||
@@ -20,6 +20,12 @@ | |||
20 | 20 | ||
21 | #define DRIVER_NAME "line6usb" | 21 | #define DRIVER_NAME "line6usb" |
22 | 22 | ||
23 | #define USB_INTERVALS_PER_SECOND 1000 | ||
24 | |||
25 | /* Fallback USB interval and max packet size values */ | ||
26 | #define LINE6_FALLBACK_INTERVAL 10 | ||
27 | #define LINE6_FALLBACK_MAXPACKETSIZE 16 | ||
28 | |||
23 | #define LINE6_TIMEOUT 1 | 29 | #define LINE6_TIMEOUT 1 |
24 | #define LINE6_BUFSIZE_LISTEN 32 | 30 | #define LINE6_BUFSIZE_LISTEN 32 |
25 | #define LINE6_MESSAGE_MAXLEN 256 | 31 | #define LINE6_MESSAGE_MAXLEN 256 |
@@ -60,26 +66,20 @@ extern const unsigned char line6_midi_id[3]; | |||
60 | static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; | 66 | static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; |
61 | static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4; | 67 | static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4; |
62 | 68 | ||
63 | /** | 69 | /* |
64 | Common properties of Line 6 devices. | 70 | Common properties of Line 6 devices. |
65 | */ | 71 | */ |
66 | struct line6_properties { | 72 | struct line6_properties { |
67 | /** | 73 | /* Card id string (maximum 16 characters). |
68 | Card id string (maximum 16 characters). | 74 | * This can be used to address the device in ALSA programs as |
69 | This can be used to address the device in ALSA programs as | 75 | * "default:CARD=<id>" |
70 | "default:CARD=<id>" | 76 | */ |
71 | */ | ||
72 | const char *id; | 77 | const char *id; |
73 | 78 | ||
74 | /** | 79 | /* Card short name (maximum 32 characters) */ |
75 | Card short name (maximum 32 characters). | ||
76 | */ | ||
77 | const char *name; | 80 | const char *name; |
78 | 81 | ||
79 | /** | 82 | /* Bit vector defining this device's capabilities in line6usb driver */ |
80 | Bit vector defining this device's capabilities in the | ||
81 | line6usb driver. | ||
82 | */ | ||
83 | int capabilities; | 83 | int capabilities; |
84 | 84 | ||
85 | int altsetting; | 85 | int altsetting; |
@@ -90,70 +90,57 @@ struct line6_properties { | |||
90 | unsigned ep_audio_w; | 90 | unsigned ep_audio_w; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | /** | 93 | /* Capability bits */ |
94 | enum { | ||
95 | /* device supports settings parameter via USB */ | ||
96 | LINE6_CAP_CONTROL = 1 << 0, | ||
97 | /* device supports PCM input/output via USB */ | ||
98 | LINE6_CAP_PCM = 1 << 1, | ||
99 | /* device support hardware monitoring */ | ||
100 | LINE6_CAP_HWMON = 1 << 2, | ||
101 | }; | ||
102 | |||
103 | /* | ||
94 | Common data shared by all Line 6 devices. | 104 | Common data shared by all Line 6 devices. |
95 | Corresponds to a pair of USB endpoints. | 105 | Corresponds to a pair of USB endpoints. |
96 | */ | 106 | */ |
97 | struct usb_line6 { | 107 | struct usb_line6 { |
98 | /** | 108 | /* USB device */ |
99 | USB device. | ||
100 | */ | ||
101 | struct usb_device *usbdev; | 109 | struct usb_device *usbdev; |
102 | 110 | ||
103 | /** | 111 | /* Properties */ |
104 | Properties. | ||
105 | */ | ||
106 | const struct line6_properties *properties; | 112 | const struct line6_properties *properties; |
107 | 113 | ||
108 | /** | 114 | /* Interval (ms) */ |
109 | Interval (ms). | ||
110 | */ | ||
111 | int interval; | 115 | int interval; |
112 | 116 | ||
113 | /** | 117 | /* Maximum size of USB packet */ |
114 | Maximum size of USB packet. | ||
115 | */ | ||
116 | int max_packet_size; | 118 | int max_packet_size; |
117 | 119 | ||
118 | /** | 120 | /* Device representing the USB interface */ |
119 | Device representing the USB interface. | ||
120 | */ | ||
121 | struct device *ifcdev; | 121 | struct device *ifcdev; |
122 | 122 | ||
123 | /** | 123 | /* Line 6 sound card data structure. |
124 | Line 6 sound card data structure. | 124 | * Each device has at least MIDI or PCM. |
125 | Each device has at least MIDI or PCM. | 125 | */ |
126 | */ | ||
127 | struct snd_card *card; | 126 | struct snd_card *card; |
128 | 127 | ||
129 | /** | 128 | /* Line 6 PCM device data structure */ |
130 | Line 6 PCM device data structure. | ||
131 | */ | ||
132 | struct snd_line6_pcm *line6pcm; | 129 | struct snd_line6_pcm *line6pcm; |
133 | 130 | ||
134 | /** | 131 | /* Line 6 MIDI device data structure */ |
135 | Line 6 MIDI device data structure. | ||
136 | */ | ||
137 | struct snd_line6_midi *line6midi; | 132 | struct snd_line6_midi *line6midi; |
138 | 133 | ||
139 | /** | 134 | /* URB for listening to PODxt Pro control endpoint */ |
140 | URB for listening to PODxt Pro control endpoint. | ||
141 | */ | ||
142 | struct urb *urb_listen; | 135 | struct urb *urb_listen; |
143 | 136 | ||
144 | /** | 137 | /* Buffer for listening to PODxt Pro control endpoint */ |
145 | Buffer for listening to PODxt Pro control endpoint. | ||
146 | */ | ||
147 | unsigned char *buffer_listen; | 138 | unsigned char *buffer_listen; |
148 | 139 | ||
149 | /** | 140 | /* Buffer for message to be processed */ |
150 | Buffer for message to be processed. | ||
151 | */ | ||
152 | unsigned char *buffer_message; | 141 | unsigned char *buffer_message; |
153 | 142 | ||
154 | /** | 143 | /* Length of message to be processed */ |
155 | Length of message to be processed. | ||
156 | */ | ||
157 | int message_length; | 144 | int message_length; |
158 | 145 | ||
159 | void (*process_message)(struct usb_line6 *); | 146 | void (*process_message)(struct usb_line6 *); |
diff --git a/sound/usb/line6/midi.c b/sound/usb/line6/midi.c index beeedf9a2cbe..cebea9b7f769 100644 --- a/sound/usb/line6/midi.c +++ b/sound/usb/line6/midi.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include "driver.h" | 18 | #include "driver.h" |
19 | #include "midi.h" | 19 | #include "midi.h" |
20 | #include "usbdefs.h" | ||
21 | 20 | ||
22 | #define line6_rawmidi_substream_midi(substream) \ | 21 | #define line6_rawmidi_substream_midi(substream) \ |
23 | ((struct snd_line6_midi *)((substream)->rmidi->private_data)) | 22 | ((struct snd_line6_midi *)((substream)->rmidi->private_data)) |
diff --git a/sound/usb/line6/midi.h b/sound/usb/line6/midi.h index 9d9467b2613c..cf82d69e2747 100644 --- a/sound/usb/line6/midi.h +++ b/sound/usb/line6/midi.h | |||
@@ -19,44 +19,28 @@ | |||
19 | #define MIDI_BUFFER_SIZE 1024 | 19 | #define MIDI_BUFFER_SIZE 1024 |
20 | 20 | ||
21 | struct snd_line6_midi { | 21 | struct snd_line6_midi { |
22 | /** | 22 | /* Pointer back to the Line 6 driver data structure */ |
23 | Pointer back to the Line 6 driver data structure. | ||
24 | */ | ||
25 | struct usb_line6 *line6; | 23 | struct usb_line6 *line6; |
26 | 24 | ||
27 | /** | 25 | /* MIDI substream for receiving (or NULL if not active) */ |
28 | MIDI substream for receiving (or NULL if not active). | ||
29 | */ | ||
30 | struct snd_rawmidi_substream *substream_receive; | 26 | struct snd_rawmidi_substream *substream_receive; |
31 | 27 | ||
32 | /** | 28 | /* MIDI substream for transmitting (or NULL if not active) */ |
33 | MIDI substream for transmitting (or NULL if not active). | ||
34 | */ | ||
35 | struct snd_rawmidi_substream *substream_transmit; | 29 | struct snd_rawmidi_substream *substream_transmit; |
36 | 30 | ||
37 | /** | 31 | /* Number of currently active MIDI send URBs */ |
38 | Number of currently active MIDI send URBs. | ||
39 | */ | ||
40 | int num_active_send_urbs; | 32 | int num_active_send_urbs; |
41 | 33 | ||
42 | /** | 34 | /* Spin lock to protect MIDI buffer handling */ |
43 | Spin lock to protect MIDI buffer handling. | ||
44 | */ | ||
45 | spinlock_t lock; | 35 | spinlock_t lock; |
46 | 36 | ||
47 | /** | 37 | /* Wait queue for MIDI transmission */ |
48 | Wait queue for MIDI transmission. | ||
49 | */ | ||
50 | wait_queue_head_t send_wait; | 38 | wait_queue_head_t send_wait; |
51 | 39 | ||
52 | /** | 40 | /* Buffer for incoming MIDI stream */ |
53 | Buffer for incoming MIDI stream. | ||
54 | */ | ||
55 | struct midi_buffer midibuf_in; | 41 | struct midi_buffer midibuf_in; |
56 | 42 | ||
57 | /** | 43 | /* Buffer for outgoing MIDI stream */ |
58 | Buffer for outgoing MIDI stream. | ||
59 | */ | ||
60 | struct midi_buffer midibuf_out; | 44 | struct midi_buffer midibuf_out; |
61 | }; | 45 | }; |
62 | 46 | ||
diff --git a/sound/usb/line6/pcm.h b/sound/usb/line6/pcm.h index 42d3e6fc2c61..508410adbd51 100644 --- a/sound/usb/line6/pcm.h +++ b/sound/usb/line6/pcm.h | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <sound/pcm.h> | 19 | #include <sound/pcm.h> |
20 | 20 | ||
21 | #include "driver.h" | 21 | #include "driver.h" |
22 | #include "usbdefs.h" | ||
23 | 22 | ||
24 | /* number of URBs */ | 23 | /* number of URBs */ |
25 | #define LINE6_ISO_BUFFERS 2 | 24 | #define LINE6_ISO_BUFFERS 2 |
@@ -66,8 +65,8 @@ | |||
66 | the running flag indicates whether the stream is running. | 65 | the running flag indicates whether the stream is running. |
67 | 66 | ||
68 | For monitor or impulse operations, the driver needs to call | 67 | For monitor or impulse operations, the driver needs to call |
69 | snd_line6_duplex_acquire() or snd_line6_duplex_release() with the | 68 | line6_pcm_acquire() or line6_pcm_release() with the appropriate |
70 | appropriate LINE6_STREAM_* flag. | 69 | LINE6_STREAM_* flag. |
71 | */ | 70 | */ |
72 | 71 | ||
73 | /* stream types */ | 72 | /* stream types */ |
@@ -84,8 +83,8 @@ enum { | |||
84 | }; | 83 | }; |
85 | 84 | ||
86 | struct line6_pcm_properties { | 85 | struct line6_pcm_properties { |
87 | struct snd_pcm_hardware snd_line6_playback_hw, snd_line6_capture_hw; | 86 | struct snd_pcm_hardware playback_hw, capture_hw; |
88 | struct snd_pcm_hw_constraint_ratdens snd_line6_rates; | 87 | struct snd_pcm_hw_constraint_ratdens rates; |
89 | int bytes_per_frame; | 88 | int bytes_per_frame; |
90 | }; | 89 | }; |
91 | 90 | ||
@@ -139,19 +138,13 @@ struct line6_pcm_stream { | |||
139 | }; | 138 | }; |
140 | 139 | ||
141 | struct snd_line6_pcm { | 140 | struct snd_line6_pcm { |
142 | /** | 141 | /* Pointer back to the Line 6 driver data structure */ |
143 | Pointer back to the Line 6 driver data structure. | ||
144 | */ | ||
145 | struct usb_line6 *line6; | 142 | struct usb_line6 *line6; |
146 | 143 | ||
147 | /** | 144 | /* Properties. */ |
148 | Properties. | ||
149 | */ | ||
150 | struct line6_pcm_properties *properties; | 145 | struct line6_pcm_properties *properties; |
151 | 146 | ||
152 | /** | 147 | /* ALSA pcm stream */ |
153 | ALSA pcm stream | ||
154 | */ | ||
155 | struct snd_pcm *pcm; | 148 | struct snd_pcm *pcm; |
156 | 149 | ||
157 | /* protection to state changes of in/out streams */ | 150 | /* protection to state changes of in/out streams */ |
@@ -161,49 +154,31 @@ struct snd_line6_pcm { | |||
161 | struct line6_pcm_stream in; | 154 | struct line6_pcm_stream in; |
162 | struct line6_pcm_stream out; | 155 | struct line6_pcm_stream out; |
163 | 156 | ||
164 | /** | 157 | /* Previously captured frame (for software monitoring) */ |
165 | Previously captured frame (for software monitoring). | ||
166 | */ | ||
167 | unsigned char *prev_fbuf; | 158 | unsigned char *prev_fbuf; |
168 | 159 | ||
169 | /** | 160 | /* Size of previously captured frame (for software monitoring) */ |
170 | Size of previously captured frame (for software monitoring). | ||
171 | */ | ||
172 | int prev_fsize; | 161 | int prev_fsize; |
173 | 162 | ||
174 | /** | 163 | /* Maximum size of USB packet */ |
175 | Maximum size of USB packet. | ||
176 | */ | ||
177 | int max_packet_size; | 164 | int max_packet_size; |
178 | 165 | ||
179 | /** | 166 | /* PCM playback volume (left and right) */ |
180 | PCM playback volume (left and right). | ||
181 | */ | ||
182 | int volume_playback[2]; | 167 | int volume_playback[2]; |
183 | 168 | ||
184 | /** | 169 | /* PCM monitor volume */ |
185 | PCM monitor volume. | ||
186 | */ | ||
187 | int volume_monitor; | 170 | int volume_monitor; |
188 | 171 | ||
189 | /** | 172 | /* Volume of impulse response test signal (if zero, test is disabled) */ |
190 | Volume of impulse response test signal (if zero, test is disabled). | ||
191 | */ | ||
192 | int impulse_volume; | 173 | int impulse_volume; |
193 | 174 | ||
194 | /** | 175 | /* Period of impulse response test signal */ |
195 | Period of impulse response test signal. | ||
196 | */ | ||
197 | int impulse_period; | 176 | int impulse_period; |
198 | 177 | ||
199 | /** | 178 | /* Counter for impulse response test signal */ |
200 | Counter for impulse response test signal. | ||
201 | */ | ||
202 | int impulse_count; | 179 | int impulse_count; |
203 | 180 | ||
204 | /** | 181 | /* Several status bits (see LINE6_FLAG_*) */ |
205 | Several status bits (see LINE6_FLAG_*). | ||
206 | */ | ||
207 | unsigned long flags; | 182 | unsigned long flags; |
208 | }; | 183 | }; |
209 | 184 | ||
diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c index 1708c05f14db..05dee690f487 100644 --- a/sound/usb/line6/playback.c +++ b/sound/usb/line6/playback.c | |||
@@ -31,14 +31,16 @@ static void change_volume(struct urb *urb_out, int volume[], | |||
31 | return; /* maximum volume - no change */ | 31 | return; /* maximum volume - no change */ |
32 | 32 | ||
33 | if (bytes_per_frame == 4) { | 33 | if (bytes_per_frame == 4) { |
34 | short *p, *buf_end; | 34 | __le16 *p, *buf_end; |
35 | 35 | ||
36 | p = (short *)urb_out->transfer_buffer; | 36 | p = (__le16 *)urb_out->transfer_buffer; |
37 | buf_end = p + urb_out->transfer_buffer_length / sizeof(*p); | 37 | buf_end = p + urb_out->transfer_buffer_length / sizeof(*p); |
38 | 38 | ||
39 | for (; p < buf_end; ++p) { | 39 | for (; p < buf_end; ++p) { |
40 | int val = (*p * volume[chn & 1]) >> 8; | 40 | short pv = le16_to_cpu(*p); |
41 | *p = clamp(val, 0x7fff, -0x8000); | 41 | int val = (pv * volume[chn & 1]) >> 8; |
42 | pv = clamp(val, 0x7fff, -0x8000); | ||
43 | *p = cpu_to_le16(pv); | ||
42 | ++chn; | 44 | ++chn; |
43 | } | 45 | } |
44 | } else if (bytes_per_frame == 6) { | 46 | } else if (bytes_per_frame == 6) { |
@@ -114,15 +116,18 @@ static void add_monitor_signal(struct urb *urb_out, unsigned char *signal, | |||
114 | return; /* zero volume - no change */ | 116 | return; /* zero volume - no change */ |
115 | 117 | ||
116 | if (bytes_per_frame == 4) { | 118 | if (bytes_per_frame == 4) { |
117 | short *pi, *po, *buf_end; | 119 | __le16 *pi, *po, *buf_end; |
118 | 120 | ||
119 | pi = (short *)signal; | 121 | pi = (__le16 *)signal; |
120 | po = (short *)urb_out->transfer_buffer; | 122 | po = (__le16 *)urb_out->transfer_buffer; |
121 | buf_end = po + urb_out->transfer_buffer_length / sizeof(*po); | 123 | buf_end = po + urb_out->transfer_buffer_length / sizeof(*po); |
122 | 124 | ||
123 | for (; po < buf_end; ++pi, ++po) { | 125 | for (; po < buf_end; ++pi, ++po) { |
124 | int val = *po + ((*pi * volume) >> 8); | 126 | short pov = le16_to_cpu(*po); |
125 | *po = clamp(val, 0x7fff, -0x8000); | 127 | short piv = le16_to_cpu(*pi); |
128 | int val = pov + ((piv * volume) >> 8); | ||
129 | pov = clamp(val, 0x7fff, -0x8000); | ||
130 | *po = cpu_to_le16(pov); | ||
126 | } | 131 | } |
127 | } | 132 | } |
128 | 133 | ||
@@ -143,10 +148,10 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) | |||
143 | int ret; | 148 | int ret; |
144 | const int bytes_per_frame = line6pcm->properties->bytes_per_frame; | 149 | const int bytes_per_frame = line6pcm->properties->bytes_per_frame; |
145 | const int frame_increment = | 150 | const int frame_increment = |
146 | line6pcm->properties->snd_line6_rates.rats[0].num_min; | 151 | line6pcm->properties->rates.rats[0].num_min; |
147 | const int frame_factor = | 152 | const int frame_factor = |
148 | line6pcm->properties->snd_line6_rates.rats[0].den * | 153 | line6pcm->properties->rates.rats[0].den * |
149 | (USB_INTERVALS_PER_SECOND / LINE6_ISO_INTERVAL); | 154 | (USB_INTERVALS_PER_SECOND / LINE6_ISO_INTERVAL); |
150 | struct urb *urb_out; | 155 | struct urb *urb_out; |
151 | 156 | ||
152 | index = | 157 | index = |
@@ -365,12 +370,11 @@ static int snd_line6_playback_open(struct snd_pcm_substream *substream) | |||
365 | struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); | 370 | struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); |
366 | 371 | ||
367 | err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, | 372 | err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, |
368 | (&line6pcm-> | 373 | &line6pcm->properties->rates); |
369 | properties->snd_line6_rates)); | ||
370 | if (err < 0) | 374 | if (err < 0) |
371 | return err; | 375 | return err; |
372 | 376 | ||
373 | runtime->hw = line6pcm->properties->snd_line6_playback_hw; | 377 | runtime->hw = line6pcm->properties->playback_hw; |
374 | return 0; | 378 | return 0; |
375 | } | 379 | } |
376 | 380 | ||
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index 6f7cd585f2d8..61aadd7d4b7f 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include "capture.h" | 21 | #include "capture.h" |
22 | #include "driver.h" | 22 | #include "driver.h" |
23 | #include "playback.h" | 23 | #include "playback.h" |
24 | #include "usbdefs.h" | ||
25 | 24 | ||
26 | /* | 25 | /* |
27 | Locate name in binary program dump | 26 | Locate name in binary program dump |
@@ -58,44 +57,28 @@ enum { | |||
58 | }; | 57 | }; |
59 | 58 | ||
60 | struct usb_line6_pod { | 59 | struct usb_line6_pod { |
61 | /** | 60 | /* Generic Line 6 USB data */ |
62 | Generic Line 6 USB data. | ||
63 | */ | ||
64 | struct usb_line6 line6; | 61 | struct usb_line6 line6; |
65 | 62 | ||
66 | /** | 63 | /* Instrument monitor level */ |
67 | Instrument monitor level. | ||
68 | */ | ||
69 | int monitor_level; | 64 | int monitor_level; |
70 | 65 | ||
71 | /** | 66 | /* Timer for device initialization */ |
72 | Timer for device initializaton. | ||
73 | */ | ||
74 | struct timer_list startup_timer; | 67 | struct timer_list startup_timer; |
75 | 68 | ||
76 | /** | 69 | /* Work handler for device initialization */ |
77 | Work handler for device initializaton. | ||
78 | */ | ||
79 | struct work_struct startup_work; | 70 | struct work_struct startup_work; |
80 | 71 | ||
81 | /** | 72 | /* Current progress in startup procedure */ |
82 | Current progress in startup procedure. | ||
83 | */ | ||
84 | int startup_progress; | 73 | int startup_progress; |
85 | 74 | ||
86 | /** | 75 | /* Serial number of device */ |
87 | Serial number of device. | ||
88 | */ | ||
89 | int serial_number; | 76 | int serial_number; |
90 | 77 | ||
91 | /** | 78 | /* Firmware version (x 100) */ |
92 | Firmware version (x 100). | ||
93 | */ | ||
94 | int firmware_version; | 79 | int firmware_version; |
95 | 80 | ||
96 | /** | 81 | /* Device ID */ |
97 | Device ID. | ||
98 | */ | ||
99 | int device_id; | 82 | int device_id; |
100 | }; | 83 | }; |
101 | 84 | ||
@@ -146,7 +129,7 @@ static struct snd_ratden pod_ratden = { | |||
146 | }; | 129 | }; |
147 | 130 | ||
148 | static struct line6_pcm_properties pod_pcm_properties = { | 131 | static struct line6_pcm_properties pod_pcm_properties = { |
149 | .snd_line6_playback_hw = { | 132 | .playback_hw = { |
150 | .info = (SNDRV_PCM_INFO_MMAP | | 133 | .info = (SNDRV_PCM_INFO_MMAP | |
151 | SNDRV_PCM_INFO_INTERLEAVED | | 134 | SNDRV_PCM_INFO_INTERLEAVED | |
152 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 135 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -164,7 +147,7 @@ static struct line6_pcm_properties pod_pcm_properties = { | |||
164 | .period_bytes_max = 8192, | 147 | .period_bytes_max = 8192, |
165 | .periods_min = 1, | 148 | .periods_min = 1, |
166 | .periods_max = 1024}, | 149 | .periods_max = 1024}, |
167 | .snd_line6_capture_hw = { | 150 | .capture_hw = { |
168 | .info = (SNDRV_PCM_INFO_MMAP | | 151 | .info = (SNDRV_PCM_INFO_MMAP | |
169 | SNDRV_PCM_INFO_INTERLEAVED | | 152 | SNDRV_PCM_INFO_INTERLEAVED | |
170 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 153 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -181,7 +164,7 @@ static struct line6_pcm_properties pod_pcm_properties = { | |||
181 | .period_bytes_max = 8192, | 164 | .period_bytes_max = 8192, |
182 | .periods_min = 1, | 165 | .periods_min = 1, |
183 | .periods_max = 1024}, | 166 | .periods_max = 1024}, |
184 | .snd_line6_rates = { | 167 | .rates = { |
185 | .nrats = 1, | 168 | .nrats = 1, |
186 | .rats = &pod_ratden}, | 169 | .rats = &pod_ratden}, |
187 | .bytes_per_frame = POD_BYTES_PER_FRAME | 170 | .bytes_per_frame = POD_BYTES_PER_FRAME |
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index 43c39886597e..9c3c7441fd11 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include "driver.h" | 18 | #include "driver.h" |
19 | #include "pcm.h" | 19 | #include "pcm.h" |
20 | #include "usbdefs.h" | ||
21 | 20 | ||
22 | enum { | 21 | enum { |
23 | LINE6_PODHD300, | 22 | LINE6_PODHD300, |
@@ -26,13 +25,6 @@ enum { | |||
26 | LINE6_PODHD500_1, | 25 | LINE6_PODHD500_1, |
27 | }; | 26 | }; |
28 | 27 | ||
29 | struct usb_line6_podhd { | ||
30 | /** | ||
31 | Generic Line 6 USB data. | ||
32 | */ | ||
33 | struct usb_line6 line6; | ||
34 | }; | ||
35 | |||
36 | #define PODHD_BYTES_PER_FRAME 6 /* 24bit audio (stereo) */ | 28 | #define PODHD_BYTES_PER_FRAME 6 /* 24bit audio (stereo) */ |
37 | 29 | ||
38 | static struct snd_ratden podhd_ratden = { | 30 | static struct snd_ratden podhd_ratden = { |
@@ -43,7 +35,7 @@ static struct snd_ratden podhd_ratden = { | |||
43 | }; | 35 | }; |
44 | 36 | ||
45 | static struct line6_pcm_properties podhd_pcm_properties = { | 37 | static struct line6_pcm_properties podhd_pcm_properties = { |
46 | .snd_line6_playback_hw = { | 38 | .playback_hw = { |
47 | .info = (SNDRV_PCM_INFO_MMAP | | 39 | .info = (SNDRV_PCM_INFO_MMAP | |
48 | SNDRV_PCM_INFO_INTERLEAVED | | 40 | SNDRV_PCM_INFO_INTERLEAVED | |
49 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 41 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -61,7 +53,7 @@ static struct line6_pcm_properties podhd_pcm_properties = { | |||
61 | .period_bytes_max = 8192, | 53 | .period_bytes_max = 8192, |
62 | .periods_min = 1, | 54 | .periods_min = 1, |
63 | .periods_max = 1024}, | 55 | .periods_max = 1024}, |
64 | .snd_line6_capture_hw = { | 56 | .capture_hw = { |
65 | .info = (SNDRV_PCM_INFO_MMAP | | 57 | .info = (SNDRV_PCM_INFO_MMAP | |
66 | SNDRV_PCM_INFO_INTERLEAVED | | 58 | SNDRV_PCM_INFO_INTERLEAVED | |
67 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 59 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -78,7 +70,7 @@ static struct line6_pcm_properties podhd_pcm_properties = { | |||
78 | .period_bytes_max = 8192, | 70 | .period_bytes_max = 8192, |
79 | .periods_min = 1, | 71 | .periods_min = 1, |
80 | .periods_max = 1024}, | 72 | .periods_max = 1024}, |
81 | .snd_line6_rates = { | 73 | .rates = { |
82 | .nrats = 1, | 74 | .nrats = 1, |
83 | .rats = &podhd_ratden}, | 75 | .rats = &podhd_ratden}, |
84 | .bytes_per_frame = PODHD_BYTES_PER_FRAME | 76 | .bytes_per_frame = PODHD_BYTES_PER_FRAME |
@@ -179,7 +171,7 @@ static int podhd_probe(struct usb_interface *interface, | |||
179 | { | 171 | { |
180 | return line6_probe(interface, id, | 172 | return line6_probe(interface, id, |
181 | &podhd_properties_table[id->driver_info], | 173 | &podhd_properties_table[id->driver_info], |
182 | podhd_init, sizeof(struct usb_line6_podhd)); | 174 | podhd_init, sizeof(struct usb_line6)); |
183 | } | 175 | } |
184 | 176 | ||
185 | static struct usb_driver podhd_driver = { | 177 | static struct usb_driver podhd_driver = { |
diff --git a/sound/usb/line6/revision.h b/sound/usb/line6/revision.h deleted file mode 100644 index b4eee2b73831..000000000000 --- a/sound/usb/line6/revision.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef DRIVER_REVISION | ||
2 | /* current subversion revision */ | ||
3 | #define DRIVER_REVISION " (904)" | ||
4 | #endif | ||
diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c index 819e06b3f3db..b107cf481819 100644 --- a/sound/usb/line6/toneport.c +++ b/sound/usb/line6/toneport.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include "capture.h" | 21 | #include "capture.h" |
22 | #include "driver.h" | 22 | #include "driver.h" |
23 | #include "playback.h" | 23 | #include "playback.h" |
24 | #include "usbdefs.h" | ||
25 | 24 | ||
26 | enum line6_device_type { | 25 | enum line6_device_type { |
27 | LINE6_GUITARPORT, | 26 | LINE6_GUITARPORT, |
@@ -43,34 +42,22 @@ struct toneport_led { | |||
43 | }; | 42 | }; |
44 | 43 | ||
45 | struct usb_line6_toneport { | 44 | struct usb_line6_toneport { |
46 | /** | 45 | /* Generic Line 6 USB data */ |
47 | Generic Line 6 USB data. | ||
48 | */ | ||
49 | struct usb_line6 line6; | 46 | struct usb_line6 line6; |
50 | 47 | ||
51 | /** | 48 | /* Source selector */ |
52 | Source selector. | ||
53 | */ | ||
54 | int source; | 49 | int source; |
55 | 50 | ||
56 | /** | 51 | /* Serial number of device */ |
57 | Serial number of device. | ||
58 | */ | ||
59 | int serial_number; | 52 | int serial_number; |
60 | 53 | ||
61 | /** | 54 | /* Firmware version (x 100) */ |
62 | Firmware version (x 100). | ||
63 | */ | ||
64 | int firmware_version; | 55 | int firmware_version; |
65 | 56 | ||
66 | /** | 57 | /* Timer for delayed PCM startup */ |
67 | Timer for delayed PCM startup. | ||
68 | */ | ||
69 | struct timer_list timer; | 58 | struct timer_list timer; |
70 | 59 | ||
71 | /** | 60 | /* Device type */ |
72 | Device type. | ||
73 | */ | ||
74 | enum line6_device_type type; | 61 | enum line6_device_type type; |
75 | 62 | ||
76 | /* LED instances */ | 63 | /* LED instances */ |
@@ -89,7 +76,7 @@ static struct snd_ratden toneport_ratden = { | |||
89 | }; | 76 | }; |
90 | 77 | ||
91 | static struct line6_pcm_properties toneport_pcm_properties = { | 78 | static struct line6_pcm_properties toneport_pcm_properties = { |
92 | .snd_line6_playback_hw = { | 79 | .playback_hw = { |
93 | .info = (SNDRV_PCM_INFO_MMAP | | 80 | .info = (SNDRV_PCM_INFO_MMAP | |
94 | SNDRV_PCM_INFO_INTERLEAVED | | 81 | SNDRV_PCM_INFO_INTERLEAVED | |
95 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 82 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -107,7 +94,7 @@ static struct line6_pcm_properties toneport_pcm_properties = { | |||
107 | .period_bytes_max = 8192, | 94 | .period_bytes_max = 8192, |
108 | .periods_min = 1, | 95 | .periods_min = 1, |
109 | .periods_max = 1024}, | 96 | .periods_max = 1024}, |
110 | .snd_line6_capture_hw = { | 97 | .capture_hw = { |
111 | .info = (SNDRV_PCM_INFO_MMAP | | 98 | .info = (SNDRV_PCM_INFO_MMAP | |
112 | SNDRV_PCM_INFO_INTERLEAVED | | 99 | SNDRV_PCM_INFO_INTERLEAVED | |
113 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 100 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -124,7 +111,7 @@ static struct line6_pcm_properties toneport_pcm_properties = { | |||
124 | .period_bytes_max = 8192, | 111 | .period_bytes_max = 8192, |
125 | .periods_min = 1, | 112 | .periods_min = 1, |
126 | .periods_max = 1024}, | 113 | .periods_max = 1024}, |
127 | .snd_line6_rates = { | 114 | .rates = { |
128 | .nrats = 1, | 115 | .nrats = 1, |
129 | .rats = &toneport_ratden}, | 116 | .rats = &toneport_ratden}, |
130 | .bytes_per_frame = 4 | 117 | .bytes_per_frame = 4 |
diff --git a/sound/usb/line6/usbdefs.h b/sound/usb/line6/usbdefs.h deleted file mode 100644 index 5ef7bcd24e18..000000000000 --- a/sound/usb/line6/usbdefs.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Line 6 Linux USB driver | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 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 | #ifndef USBDEFS_H | ||
13 | #define USBDEFS_H | ||
14 | |||
15 | #define USB_INTERVALS_PER_SECOND 1000 | ||
16 | |||
17 | /* device supports settings parameter via USB */ | ||
18 | #define LINE6_CAP_CONTROL (1 << 0) | ||
19 | /* device supports PCM input/output via USB */ | ||
20 | #define LINE6_CAP_PCM (1 << 1) | ||
21 | /* device support hardware monitoring */ | ||
22 | #define LINE6_CAP_HWMON (1 << 2) | ||
23 | |||
24 | #define LINE6_FALLBACK_INTERVAL 10 | ||
25 | #define LINE6_FALLBACK_MAXPACKETSIZE 16 | ||
26 | |||
27 | #endif | ||
diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c index 9701ffa61365..b1c1de65d584 100644 --- a/sound/usb/line6/variax.c +++ b/sound/usb/line6/variax.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <sound/core.h> | 17 | #include <sound/core.h> |
18 | 18 | ||
19 | #include "driver.h" | 19 | #include "driver.h" |
20 | #include "usbdefs.h" | ||
21 | 20 | ||
22 | #define VARIAX_STARTUP_DELAY1 1000 | 21 | #define VARIAX_STARTUP_DELAY1 1000 |
23 | #define VARIAX_STARTUP_DELAY3 100 | 22 | #define VARIAX_STARTUP_DELAY3 100 |
@@ -42,30 +41,20 @@ enum { | |||
42 | }; | 41 | }; |
43 | 42 | ||
44 | struct usb_line6_variax { | 43 | struct usb_line6_variax { |
45 | /** | 44 | /* Generic Line 6 USB data */ |
46 | Generic Line 6 USB data. | ||
47 | */ | ||
48 | struct usb_line6 line6; | 45 | struct usb_line6 line6; |
49 | 46 | ||
50 | /** | 47 | /* Buffer for activation code */ |
51 | Buffer for activation code. | ||
52 | */ | ||
53 | unsigned char *buffer_activate; | 48 | unsigned char *buffer_activate; |
54 | 49 | ||
55 | /** | 50 | /* Handler for device initialization */ |
56 | Handler for device initializaton. | ||
57 | */ | ||
58 | struct work_struct startup_work; | 51 | struct work_struct startup_work; |
59 | 52 | ||
60 | /** | 53 | /* Timers for device initialization */ |
61 | Timers for device initializaton. | ||
62 | */ | ||
63 | struct timer_list startup_timer1; | 54 | struct timer_list startup_timer1; |
64 | struct timer_list startup_timer2; | 55 | struct timer_list startup_timer2; |
65 | 56 | ||
66 | /** | 57 | /* Current progress in startup procedure */ |
67 | Current progress in startup procedure. | ||
68 | */ | ||
69 | int startup_progress; | 58 | int startup_progress; |
70 | }; | 59 | }; |
71 | 60 | ||
@@ -270,9 +259,7 @@ static const struct line6_properties variax_properties_table[] = { | |||
270 | [LINE6_PODXTLIVE_VARIAX] = { | 259 | [LINE6_PODXTLIVE_VARIAX] = { |
271 | .id = "PODxtLive", | 260 | .id = "PODxtLive", |
272 | .name = "PODxt Live", | 261 | .name = "PODxt Live", |
273 | .capabilities = LINE6_CAP_CONTROL | 262 | .capabilities = LINE6_CAP_CONTROL, |
274 | | LINE6_CAP_PCM | ||
275 | | LINE6_CAP_HWMON, | ||
276 | .altsetting = 1, | 263 | .altsetting = 1, |
277 | .ep_ctrl_r = 0x86, | 264 | .ep_ctrl_r = 0x86, |
278 | .ep_ctrl_w = 0x05, | 265 | .ep_ctrl_w = 0x05, |