blob: 730ea91d9be886d9a16ff903ecc91f322c711e50 [file] [log] [blame]
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +09001/*
2 * bebob.c - a part of driver for BeBoB based devices
3 *
4 * Copyright (c) 2013-2014 Takashi Sakamoto
5 *
6 * Licensed under the terms of the GNU General Public License, version 2.
7 */
8
9/*
10 * BeBoB is 'BridgeCo enhanced Breakout Box'. This is installed to firewire
11 * devices with DM1000/DM1100/DM1500 chipset. It gives common way for host
12 * system to handle BeBoB based devices.
13 */
14
15#include "bebob.h"
16
17MODULE_DESCRIPTION("BridgeCo BeBoB driver");
18MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>");
19MODULE_LICENSE("GPL v2");
20
21static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
22static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
23static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
24
25module_param_array(index, int, NULL, 0444);
26MODULE_PARM_DESC(index, "card index");
27module_param_array(id, charp, NULL, 0444);
28MODULE_PARM_DESC(id, "ID string");
29module_param_array(enable, bool, NULL, 0444);
30MODULE_PARM_DESC(enable, "enable BeBoB sound card");
31
32static DEFINE_MUTEX(devices_mutex);
33static DECLARE_BITMAP(devices_used, SNDRV_CARDS);
34
35/* Offsets from information register. */
Takashi Sakamoto7b4d7dc2015-06-14 12:49:33 +090036#define INFO_OFFSET_BEBOB_VERSION 0x08
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090037#define INFO_OFFSET_GUID 0x10
38#define INFO_OFFSET_HW_MODEL_ID 0x18
39#define INFO_OFFSET_HW_MODEL_REVISION 0x1c
40
41#define VEN_EDIROL 0x000040ab
42#define VEN_PRESONUS 0x00000a92
43#define VEN_BRIDGECO 0x000007f5
Takashi Sakamoto425a5702015-10-04 09:17:03 +090044#define VEN_MACKIE1 0x0000000f
45#define VEN_MACKIE2 0x00000ff2
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090046#define VEN_STANTON 0x00001260
47#define VEN_TASCAM 0x0000022e
48#define VEN_BEHRINGER 0x00001564
49#define VEN_APOGEE 0x000003db
50#define VEN_ESI 0x00000f1b
51#define VEN_ACOUSTIC 0x00000002
52#define VEN_CME 0x0000000a
53#define VEN_PHONIC 0x00001496
54#define VEN_LYNX 0x000019e5
55#define VEN_ICON 0x00001a9e
56#define VEN_PRISMSOUND 0x00001198
Takashi Sakamoto326b9ca2014-04-25 22:45:22 +090057#define VEN_TERRATEC 0x00000aac
Takashi Sakamoto8ac98a32014-04-25 22:45:23 +090058#define VEN_YAMAHA 0x0000a0de
Takashi Sakamoto25784ec2014-04-25 22:45:24 +090059#define VEN_FOCUSRITE 0x0000130e
Takashi Sakamoto9076c222014-04-25 22:45:25 +090060#define VEN_MAUDIO1 0x00000d6c
61#define VEN_MAUDIO2 0x000007f5
Takashi Sakamoto146a5e32015-05-24 20:51:45 +090062#define VEN_DIGIDESIGN 0x00a07e
Takashi Sakamoto25784ec2014-04-25 22:45:24 +090063
64#define MODEL_FOCUSRITE_SAFFIRE_BOTH 0x00000000
Takashi Sakamoto9076c222014-04-25 22:45:25 +090065#define MODEL_MAUDIO_AUDIOPHILE_BOTH 0x00010060
Takashi Sakamoto3149ac42014-04-25 22:45:26 +090066#define MODEL_MAUDIO_FW1814 0x00010071
67#define MODEL_MAUDIO_PROJECTMIX 0x00010091
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090068
69static int
Takashi Sakamoto093dd442016-03-27 16:09:06 +090070name_device(struct snd_bebob *bebob)
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090071{
72 struct fw_device *fw_dev = fw_parent_device(bebob->unit);
73 char vendor[24] = {0};
74 char model[32] = {0};
Takashi Sakamoto791c67b2014-05-28 00:14:44 +090075 u32 hw_id;
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090076 u32 data[2] = {0};
77 u32 revision;
Takashi Sakamoto7b4d7dc2015-06-14 12:49:33 +090078 u32 version;
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090079 int err;
80
81 /* get vendor name from root directory */
82 err = fw_csr_string(fw_dev->config_rom + 5, CSR_VENDOR,
83 vendor, sizeof(vendor));
84 if (err < 0)
85 goto end;
86
87 /* get model name from unit directory */
88 err = fw_csr_string(bebob->unit->directory, CSR_MODEL,
89 model, sizeof(model));
90 if (err < 0)
91 goto end;
92
93 /* get hardware id */
94 err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_ID,
Takashi Sakamoto791c67b2014-05-28 00:14:44 +090095 &hw_id);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +090096 if (err < 0)
97 goto end;
98
99 /* get hardware revision */
100 err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_REVISION,
101 &revision);
102 if (err < 0)
103 goto end;
104
105 /* get GUID */
106 err = snd_bebob_read_block(bebob->unit, INFO_OFFSET_GUID,
107 data, sizeof(data));
108 if (err < 0)
109 goto end;
110
Takashi Sakamoto7b4d7dc2015-06-14 12:49:33 +0900111 err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_BEBOB_VERSION,
112 &version);
113 if (err < 0)
114 goto end;
115 bebob->version = version;
116
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900117 strcpy(bebob->card->driver, "BeBoB");
118 strcpy(bebob->card->shortname, model);
119 strcpy(bebob->card->mixername, model);
120 snprintf(bebob->card->longname, sizeof(bebob->card->longname),
121 "%s %s (id:%d, rev:%d), GUID %08x%08x at %s, S%d",
Takashi Sakamoto791c67b2014-05-28 00:14:44 +0900122 vendor, model, hw_id, revision,
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900123 data[0], data[1], dev_name(&bebob->unit->device),
124 100 << fw_dev->max_speed);
125end:
126 return err;
127}
128
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900129static void bebob_free(struct snd_bebob *bebob)
130{
131 snd_bebob_stream_destroy_duplex(bebob);
132 fw_unit_put(bebob->unit);
133
134 kfree(bebob->maudio_special_quirk);
135
136 mutex_destroy(&bebob->mutex);
137 kfree(bebob);
138}
139
Takashi Sakamoto12ed7192015-02-21 23:54:57 +0900140/*
141 * This module releases the FireWire unit data after all ALSA character devices
142 * are released by applications. This is for releasing stream data or finishing
143 * transactions safely. Thus at returning from .remove(), this module still keep
144 * references for the unit.
145 */
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900146static void
147bebob_card_free(struct snd_card *card)
148{
149 struct snd_bebob *bebob = card->private_data;
150
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900151 mutex_lock(&devices_mutex);
152 clear_bit(bebob->card_index, devices_used);
153 mutex_unlock(&devices_mutex);
Takashi Sakamoto12ed7192015-02-21 23:54:57 +0900154
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900155 bebob_free(card->private_data);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900156}
157
Takashi Sakamoto25784ec2014-04-25 22:45:24 +0900158static const struct snd_bebob_spec *
159get_saffire_spec(struct fw_unit *unit)
160{
161 char name[24] = {0};
162
163 if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
164 return NULL;
165
166 if (strcmp(name, "SaffireLE") == 0)
167 return &saffire_le_spec;
168 else
169 return &saffire_spec;
170}
171
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900172static bool
173check_audiophile_booted(struct fw_unit *unit)
174{
Takashi Sakamoto2e570692016-11-18 06:11:24 +0900175 char name[28] = {0};
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900176
177 if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
178 return false;
179
Takashi Sakamoto2e570692016-11-18 06:11:24 +0900180 return strncmp(name, "FW Audiophile Bootloader", 24) != 0;
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900181}
182
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900183static void
184do_registration(struct work_struct *work)
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900185{
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900186 struct snd_bebob *bebob =
187 container_of(work, struct snd_bebob, dwork.work);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900188 unsigned int card_index;
189 int err;
190
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900191 if (bebob->registered)
192 return;
193
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900194 mutex_lock(&devices_mutex);
195
196 for (card_index = 0; card_index < SNDRV_CARDS; card_index++) {
197 if (!test_bit(card_index, devices_used) && enable[card_index])
198 break;
199 }
200 if (card_index >= SNDRV_CARDS) {
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900201 mutex_unlock(&devices_mutex);
202 return;
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900203 }
204
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900205 err = snd_card_new(&bebob->unit->device, index[card_index],
206 id[card_index], THIS_MODULE, 0, &bebob->card);
207 if (err < 0) {
208 mutex_unlock(&devices_mutex);
209 return;
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900210 }
211
Takashi Sakamoto093dd442016-03-27 16:09:06 +0900212 err = name_device(bebob);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900213 if (err < 0)
214 goto error;
215
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900216 if (bebob->spec == &maudio_special_spec) {
217 if (bebob->entry->model_id == MODEL_MAUDIO_FW1814)
218 err = snd_bebob_maudio_special_discover(bebob, true);
219 else
220 err = snd_bebob_maudio_special_discover(bebob, false);
221 } else {
Takashi Sakamoto3149ac42014-04-25 22:45:26 +0900222 err = snd_bebob_stream_discover(bebob);
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900223 }
224 if (err < 0)
225 goto error;
226
227 err = snd_bebob_stream_init_duplex(bebob);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900228 if (err < 0)
229 goto error;
Takashi Sakamotoeb7b3a02014-04-25 22:45:15 +0900230
Takashi Sakamotoad9697b2014-04-25 22:45:17 +0900231 snd_bebob_proc_init(bebob);
232
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900233 if (bebob->midi_input_ports > 0 || bebob->midi_output_ports > 0) {
Takashi Sakamoto248b7802014-04-25 22:45:18 +0900234 err = snd_bebob_create_midi_devices(bebob);
235 if (err < 0)
236 goto error;
237 }
238
Takashi Sakamotofbbebd22014-04-25 22:45:19 +0900239 err = snd_bebob_create_pcm_devices(bebob);
240 if (err < 0)
241 goto error;
242
Takashi Sakamoto618eabe2014-04-25 22:45:20 +0900243 err = snd_bebob_create_hwdep_device(bebob);
244 if (err < 0)
245 goto error;
246
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900247 err = snd_card_register(bebob->card);
Takashi Sakamotoeb7b3a02014-04-25 22:45:15 +0900248 if (err < 0)
249 goto error;
250
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900251 set_bit(card_index, devices_used);
252 mutex_unlock(&devices_mutex);
253
254 /*
255 * After registered, bebob instance can be released corresponding to
256 * releasing the sound card instance.
257 */
258 bebob->card->private_free = bebob_card_free;
259 bebob->card->private_data = bebob;
260 bebob->registered = true;
261
262 return;
263error:
264 mutex_unlock(&devices_mutex);
265 snd_bebob_stream_destroy_duplex(bebob);
266 snd_card_free(bebob->card);
267 dev_info(&bebob->unit->device,
268 "Sound card registration failed: %d\n", err);
269}
270
271static int
272bebob_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry)
273{
274 struct snd_bebob *bebob;
275 const struct snd_bebob_spec *spec;
276
277 if (entry->vendor_id == VEN_FOCUSRITE &&
278 entry->model_id == MODEL_FOCUSRITE_SAFFIRE_BOTH)
279 spec = get_saffire_spec(unit);
280 else if (entry->vendor_id == VEN_MAUDIO1 &&
281 entry->model_id == MODEL_MAUDIO_AUDIOPHILE_BOTH &&
282 !check_audiophile_booted(unit))
283 spec = NULL;
284 else
285 spec = (const struct snd_bebob_spec *)entry->driver_data;
286
287 if (spec == NULL) {
288 if (entry->vendor_id == VEN_MAUDIO1 ||
289 entry->vendor_id == VEN_MAUDIO2)
290 return snd_bebob_maudio_load_firmware(unit);
291 else
292 return -ENODEV;
293 }
294
295 /* Allocate this independent of sound card instance. */
296 bebob = kzalloc(sizeof(struct snd_bebob), GFP_KERNEL);
297 if (bebob == NULL)
298 return -ENOMEM;
299
300 bebob->unit = fw_unit_get(unit);
301 bebob->entry = entry;
302 bebob->spec = spec;
303 dev_set_drvdata(&unit->device, bebob);
304
305 mutex_init(&bebob->mutex);
306 spin_lock_init(&bebob->lock);
307 init_waitqueue_head(&bebob->hwdep_wait);
308
309 /* Allocate and register this sound card later. */
310 INIT_DEFERRABLE_WORK(&bebob->dwork, do_registration);
311
312 if (entry->vendor_id != VEN_MAUDIO1 ||
313 (entry->model_id != MODEL_MAUDIO_FW1814 &&
314 entry->model_id != MODEL_MAUDIO_PROJECTMIX)) {
315 snd_fw_schedule_registration(unit, &bebob->dwork);
Takashi Sakamoto9b1ee0b2014-04-25 22:45:30 +0900316 } else {
317 /*
318 * This is a workaround. This bus reset seems to have an effect
319 * to make devices correctly handling transactions. Without
320 * this, the devices have gap_count mismatch. This causes much
321 * failure of transaction.
322 *
323 * Just after registration, user-land application receive
324 * signals from dbus and starts I/Os. To avoid I/Os till the
325 * future bus reset, registration is done in next update().
326 */
Takashi Sakamoto9b1ee0b2014-04-25 22:45:30 +0900327 fw_schedule_bus_reset(fw_parent_device(bebob->unit)->card,
328 false, true);
Takashi Sakamotoeb7b3a02014-04-25 22:45:15 +0900329 }
330
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900331 return 0;
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900332}
333
Takashi Sakamoto3800e6f2016-02-20 16:18:59 +0900334/*
335 * This driver doesn't update streams in bus reset handler.
336 *
337 * DM1000/ DM1100/DM1500 chipsets with BeBoB firmware transfer packets with
338 * discontinued counter at bus reset. This discontinuity is immediately
339 * detected in packet streaming layer, then it sets XRUN to PCM substream.
340 *
341 * ALSA PCM applications can know the XRUN by getting -EPIPE from PCM operation.
342 * Then, they can recover the PCM substream by executing ioctl(2) with
343 * SNDRV_PCM_IOCTL_PREPARE. 'struct snd_pcm_ops.prepare' is called and drivers
344 * restart packet streaming.
345 *
346 * The above processing may be executed before this bus-reset handler is
347 * executed. When this handler updates streams with current isochronous
348 * channels, the streams already have the current ones.
349 */
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900350static void
351bebob_update(struct fw_unit *unit)
352{
353 struct snd_bebob *bebob = dev_get_drvdata(&unit->device);
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900354
355 if (bebob == NULL)
356 return;
357
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900358 /* Postpone a workqueue for deferred registration. */
359 if (!bebob->registered)
360 snd_fw_schedule_registration(unit, &bebob->dwork);
361 else
362 fcp_bus_reset(bebob->unit);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900363}
364
365static void bebob_remove(struct fw_unit *unit)
366{
367 struct snd_bebob *bebob = dev_get_drvdata(&unit->device);
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900368
369 if (bebob == NULL)
370 return;
371
Takashi Sakamoto04a2c732016-03-31 08:47:05 +0900372 /*
373 * Confirm to stop the work for registration before the sound card is
374 * going to be released. The work is not scheduled again because bus
375 * reset handler is not called anymore.
376 */
377 cancel_delayed_work_sync(&bebob->dwork);
378
379 if (bebob->registered) {
380 /* No need to wait for releasing card object in this context. */
381 snd_card_free_when_closed(bebob->card);
382 } else {
383 /* Don't forget this case. */
384 bebob_free(bebob);
385 }
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900386}
387
Julia Lawall6b9866c2015-10-11 08:10:55 +0200388static const struct snd_bebob_rate_spec normal_rate_spec = {
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900389 .get = &snd_bebob_stream_get_rate,
390 .set = &snd_bebob_stream_set_rate
391};
392static const struct snd_bebob_spec spec_normal = {
393 .clock = NULL,
394 .rate = &normal_rate_spec,
395 .meter = NULL
396};
397
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900398static const struct ieee1394_device_id bebob_id_table[] = {
399 /* Edirol, FA-66 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900400 SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010049, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900401 /* Edirol, FA-101 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900402 SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010048, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900403 /* Presonus, FIREBOX */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900404 SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900405 /* PreSonus, FIREPOD/FP10 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900406 SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010066, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900407 /* PreSonus, Inspire1394 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900408 SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010001, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900409 /* BridgeCo, RDAudio1 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900410 SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010048, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900411 /* BridgeCo, Audio5 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900412 SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010049, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900413 /* Mackie, Onyx 1220/1620/1640 (Firewire I/O Card) */
Takashi Sakamoto425a5702015-10-04 09:17:03 +0900414 SND_BEBOB_DEV_ENTRY(VEN_MACKIE2, 0x00010065, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900415 /* Mackie, d.2 (Firewire Option) */
Takashi Sakamoto425a5702015-10-04 09:17:03 +0900416 SND_BEBOB_DEV_ENTRY(VEN_MACKIE1, 0x00010067, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900417 /* Stanton, ScratchAmp */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900418 SND_BEBOB_DEV_ENTRY(VEN_STANTON, 0x00000001, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900419 /* Tascam, IF-FW DM */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900420 SND_BEBOB_DEV_ENTRY(VEN_TASCAM, 0x00010067, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900421 /* Behringer, XENIX UFX 1204 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900422 SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001204, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900423 /* Behringer, XENIX UFX 1604 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900424 SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001604, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900425 /* Behringer, Digital Mixer X32 series (X-UF Card) */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900426 SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00000006, &spec_normal),
Takashi Sakamotocf8a4712015-06-14 12:49:37 +0900427 /* Behringer, F-Control Audio 1616 */
428 SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x001616, &spec_normal),
429 /* Behringer, F-Control Audio 610 */
430 SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x000610, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900431 /* Apogee Electronics, Rosetta 200/400 (X-FireWire card) */
432 /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900433 SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900434 /* Apogee Electronics, Ensemble */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900435 SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00001eee, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900436 /* ESI, Quatafire610 */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900437 SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900438 /* AcousticReality, eARMasterOne */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900439 SND_BEBOB_DEV_ENTRY(VEN_ACOUSTIC, 0x00000002, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900440 /* CME, MatrixKFW */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900441 SND_BEBOB_DEV_ENTRY(VEN_CME, 0x00030000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900442 /* Phonic, Helix Board 12 MkII */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900443 SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00050000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900444 /* Phonic, Helix Board 18 MkII */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900445 SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00060000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900446 /* Phonic, Helix Board 24 MkII */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900447 SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00070000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900448 /* Phonic, Helix Board 12 Universal/18 Universal/24 Universal */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900449 SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00000000, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900450 /* Lynx, Aurora 8/16 (LT-FW) */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900451 SND_BEBOB_DEV_ENTRY(VEN_LYNX, 0x00000001, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900452 /* ICON, FireXon */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900453 SND_BEBOB_DEV_ENTRY(VEN_ICON, 0x00000001, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900454 /* PrismSound, Orpheus */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900455 SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x00010048, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900456 /* PrismSound, ADA-8XR */
Takashi Sakamoto1fc95222014-04-25 22:45:21 +0900457 SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x0000ada8, &spec_normal),
Takashi Sakamoto326b9ca2014-04-25 22:45:22 +0900458 /* TerraTec Electronic GmbH, PHASE 88 Rack FW */
459 SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000003, &phase88_rack_spec),
460 /* TerraTec Electronic GmbH, PHASE 24 FW */
Takashi Sakamotoe15c2822016-08-24 21:42:43 +0900461 SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &yamaha_terratec_spec),
Takashi Sakamoto326b9ca2014-04-25 22:45:22 +0900462 /* TerraTec Electronic GmbH, Phase X24 FW */
Takashi Sakamotoe15c2822016-08-24 21:42:43 +0900463 SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &yamaha_terratec_spec),
Takashi Sakamoto326b9ca2014-04-25 22:45:22 +0900464 /* TerraTec Electronic GmbH, EWS MIC2/MIC8 */
465 SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000005, &spec_normal),
466 /* Terratec Electronic GmbH, Aureon 7.1 Firewire */
467 SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000002, &spec_normal),
Takashi Sakamoto8ac98a32014-04-25 22:45:23 +0900468 /* Yamaha, GO44 */
Takashi Sakamotoe15c2822016-08-24 21:42:43 +0900469 SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_terratec_spec),
Takashi Sakamoto8ac98a32014-04-25 22:45:23 +0900470 /* YAMAHA, GO46 */
Takashi Sakamotoe15c2822016-08-24 21:42:43 +0900471 SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_terratec_spec),
Takashi Sakamoto25784ec2014-04-25 22:45:24 +0900472 /* Focusrite, SaffirePro 26 I/O */
473 SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec),
474 /* Focusrite, SaffirePro 10 I/O */
475 SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000006, &saffirepro_10_spec),
476 /* Focusrite, Saffire(no label and LE) */
477 SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH,
478 &saffire_spec),
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900479 /* M-Audio, Firewire 410 */
Takashi Sakamotoa2b2a772014-04-25 22:45:29 +0900480 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010058, NULL), /* bootloader */
Takashi Sakamoto9076c222014-04-25 22:45:25 +0900481 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010046, &maudio_fw410_spec),
482 /* M-Audio, Firewire Audiophile */
483 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_AUDIOPHILE_BOTH,
484 &maudio_audiophile_spec),
485 /* M-Audio, Firewire Solo */
486 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010062, &maudio_solo_spec),
487 /* M-Audio, Ozonic */
488 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x0000000a, &maudio_ozonic_spec),
489 /* M-Audio NRV10 */
490 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec),
491 /* M-Audio, ProFireLightbridge */
492 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal),
Takashi Sakamoto3149ac42014-04-25 22:45:26 +0900493 /* Firewire 1814 */
Takashi Sakamotoa2b2a772014-04-25 22:45:29 +0900494 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL), /* bootloader */
Takashi Sakamoto3149ac42014-04-25 22:45:26 +0900495 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814,
496 &maudio_special_spec),
497 /* M-Audio ProjectMix */
498 SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROJECTMIX,
499 &maudio_special_spec),
Takashi Sakamoto146a5e32015-05-24 20:51:45 +0900500 /* Digidesign Mbox 2 Pro */
501 SND_BEBOB_DEV_ENTRY(VEN_DIGIDESIGN, 0x0000a9, &spec_normal),
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900502 /* IDs are unknown but able to be supported */
503 /* Apogee, Mini-ME Firewire */
504 /* Apogee, Mini-DAC Firewire */
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900505 /* Cakawalk, Sonar Power Studio 66 */
506 /* CME, UF400e */
507 /* ESI, Quotafire XL */
508 /* Infrasonic, DewX */
509 /* Infrasonic, Windy6 */
510 /* Mackie, Digital X Bus x.200 */
511 /* Mackie, Digital X Bus x.400 */
512 /* Phonic, HB 12 */
513 /* Phonic, HB 24 */
514 /* Phonic, HB 18 */
515 /* Phonic, FireFly 202 */
516 /* Phonic, FireFly 302 */
517 /* Rolf Spuler, Firewire Guitar */
518 {}
519};
520MODULE_DEVICE_TABLE(ieee1394, bebob_id_table);
521
522static struct fw_driver bebob_driver = {
523 .driver = {
524 .owner = THIS_MODULE,
525 .name = "snd-bebob",
526 .bus = &fw_bus_type,
527 },
528 .probe = bebob_probe,
529 .update = bebob_update,
530 .remove = bebob_remove,
531 .id_table = bebob_id_table,
532};
533
534static int __init
535snd_bebob_init(void)
536{
537 return driver_register(&bebob_driver.driver);
538}
539
540static void __exit
541snd_bebob_exit(void)
542{
543 driver_unregister(&bebob_driver.driver);
Takashi Sakamotofd6f4b0d2014-04-25 22:45:14 +0900544}
545
546module_init(snd_bebob_init);
547module_exit(snd_bebob_exit);