GNU Linux-libre 4.19.264-gnu1
[releases.git] / sound / firewire / bebob / bebob.c
1 /*
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
17 MODULE_DESCRIPTION("BridgeCo BeBoB driver");
18 MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>");
19 MODULE_LICENSE("GPL v2");
20
21 static int index[SNDRV_CARDS]   = SNDRV_DEFAULT_IDX;
22 static char *id[SNDRV_CARDS]    = SNDRV_DEFAULT_STR;
23 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
24
25 module_param_array(index, int, NULL, 0444);
26 MODULE_PARM_DESC(index, "card index");
27 module_param_array(id, charp, NULL, 0444);
28 MODULE_PARM_DESC(id, "ID string");
29 module_param_array(enable, bool, NULL, 0444);
30 MODULE_PARM_DESC(enable, "enable BeBoB sound card");
31
32 static DEFINE_MUTEX(devices_mutex);
33 static DECLARE_BITMAP(devices_used, SNDRV_CARDS);
34
35 /* Offsets from information register. */
36 #define INFO_OFFSET_BEBOB_VERSION       0x08
37 #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
44 #define VEN_MACKIE1     0x0000000f
45 #define VEN_MACKIE2     0x00000ff2
46 #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
57 #define VEN_TERRATEC    0x00000aac
58 #define VEN_YAMAHA      0x0000a0de
59 #define VEN_FOCUSRITE   0x0000130e
60 #define VEN_MAUDIO1     0x00000d6c
61 #define VEN_MAUDIO2     0x000007f5
62 #define VEN_DIGIDESIGN  0x00a07e
63 #define OUI_SHOUYO      0x002327
64
65 #define MODEL_FOCUSRITE_SAFFIRE_BOTH    0x00000000
66 #define MODEL_MAUDIO_AUDIOPHILE_BOTH    0x00010060
67 #define MODEL_MAUDIO_FW1814             0x00010071
68 #define MODEL_MAUDIO_PROJECTMIX         0x00010091
69
70 static int
71 name_device(struct snd_bebob *bebob)
72 {
73         struct fw_device *fw_dev = fw_parent_device(bebob->unit);
74         char vendor[24] = {0};
75         char model[32] = {0};
76         u32 hw_id;
77         u32 data[2] = {0};
78         u32 revision;
79         u32 version;
80         int err;
81
82         /* get vendor name from root directory */
83         err = fw_csr_string(fw_dev->config_rom + 5, CSR_VENDOR,
84                             vendor, sizeof(vendor));
85         if (err < 0)
86                 goto end;
87
88         /* get model name from unit directory */
89         err = fw_csr_string(bebob->unit->directory, CSR_MODEL,
90                             model, sizeof(model));
91         if (err < 0)
92                 goto end;
93
94         /* get hardware id */
95         err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_ID,
96                                   &hw_id);
97         if (err < 0)
98                 goto end;
99
100         /* get hardware revision */
101         err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_REVISION,
102                                   &revision);
103         if (err < 0)
104                 goto end;
105
106         /* get GUID */
107         err = snd_bebob_read_block(bebob->unit, INFO_OFFSET_GUID,
108                                    data, sizeof(data));
109         if (err < 0)
110                 goto end;
111
112         err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_BEBOB_VERSION,
113                                   &version);
114         if (err < 0)
115                 goto end;
116         bebob->version = version;
117
118         strcpy(bebob->card->driver, "BeBoB");
119         strcpy(bebob->card->shortname, model);
120         strcpy(bebob->card->mixername, model);
121         snprintf(bebob->card->longname, sizeof(bebob->card->longname),
122                  "%s %s (id:%d, rev:%d), GUID %08x%08x at %s, S%d",
123                  vendor, model, hw_id, revision,
124                  data[0], data[1], dev_name(&bebob->unit->device),
125                  100 << fw_dev->max_speed);
126 end:
127         return err;
128 }
129
130 static void bebob_free(struct snd_bebob *bebob)
131 {
132         snd_bebob_stream_destroy_duplex(bebob);
133         fw_unit_put(bebob->unit);
134
135         kfree(bebob->maudio_special_quirk);
136
137         mutex_destroy(&bebob->mutex);
138         kfree(bebob);
139 }
140
141 /*
142  * This module releases the FireWire unit data after all ALSA character devices
143  * are released by applications. This is for releasing stream data or finishing
144  * transactions safely. Thus at returning from .remove(), this module still keep
145  * references for the unit.
146  */
147 static void
148 bebob_card_free(struct snd_card *card)
149 {
150         struct snd_bebob *bebob = card->private_data;
151
152         mutex_lock(&devices_mutex);
153         clear_bit(bebob->card_index, devices_used);
154         mutex_unlock(&devices_mutex);
155
156         bebob_free(card->private_data);
157 }
158
159 static const struct snd_bebob_spec *
160 get_saffire_spec(struct fw_unit *unit)
161 {
162         char name[24] = {0};
163
164         if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
165                 return NULL;
166
167         if (strcmp(name, "SaffireLE") == 0)
168                 return &saffire_le_spec;
169         else
170                 return &saffire_spec;
171 }
172
173 static bool
174 check_audiophile_booted(struct fw_unit *unit)
175 {
176         char name[28] = {0};
177
178         if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
179                 return false;
180
181         return strncmp(name, "FW Audiophile Bootloader", 24) != 0;
182 }
183
184 static void
185 do_registration(struct work_struct *work)
186 {
187         struct snd_bebob *bebob =
188                         container_of(work, struct snd_bebob, dwork.work);
189         unsigned int card_index;
190         int err;
191
192         if (bebob->registered)
193                 return;
194
195         mutex_lock(&devices_mutex);
196
197         for (card_index = 0; card_index < SNDRV_CARDS; card_index++) {
198                 if (!test_bit(card_index, devices_used) && enable[card_index])
199                         break;
200         }
201         if (card_index >= SNDRV_CARDS) {
202                 mutex_unlock(&devices_mutex);
203                 return;
204         }
205
206         err = snd_card_new(&bebob->unit->device, index[card_index],
207                            id[card_index], THIS_MODULE, 0, &bebob->card);
208         if (err < 0) {
209                 mutex_unlock(&devices_mutex);
210                 return;
211         }
212
213         err = name_device(bebob);
214         if (err < 0)
215                 goto error;
216
217         if (bebob->spec == &maudio_special_spec) {
218                 if (bebob->entry->model_id == MODEL_MAUDIO_FW1814)
219                         err = snd_bebob_maudio_special_discover(bebob, true);
220                 else
221                         err = snd_bebob_maudio_special_discover(bebob, false);
222         } else {
223                 err = snd_bebob_stream_discover(bebob);
224         }
225         if (err < 0)
226                 goto error;
227
228         err = snd_bebob_stream_init_duplex(bebob);
229         if (err < 0)
230                 goto error;
231
232         snd_bebob_proc_init(bebob);
233
234         if (bebob->midi_input_ports > 0 || bebob->midi_output_ports > 0) {
235                 err = snd_bebob_create_midi_devices(bebob);
236                 if (err < 0)
237                         goto error;
238         }
239
240         err = snd_bebob_create_pcm_devices(bebob);
241         if (err < 0)
242                 goto error;
243
244         err = snd_bebob_create_hwdep_device(bebob);
245         if (err < 0)
246                 goto error;
247
248         err = snd_card_register(bebob->card);
249         if (err < 0)
250                 goto error;
251
252         set_bit(card_index, devices_used);
253         mutex_unlock(&devices_mutex);
254
255         /*
256          * After registered, bebob instance can be released corresponding to
257          * releasing the sound card instance.
258          */
259         bebob->card->private_free = bebob_card_free;
260         bebob->card->private_data = bebob;
261         bebob->registered = true;
262
263         return;
264 error:
265         mutex_unlock(&devices_mutex);
266         snd_bebob_stream_destroy_duplex(bebob);
267         kfree(bebob->maudio_special_quirk);
268         bebob->maudio_special_quirk = NULL;
269         snd_card_free(bebob->card);
270         dev_info(&bebob->unit->device,
271                  "Sound card registration failed: %d\n", err);
272 }
273
274 static int
275 bebob_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry)
276 {
277         struct snd_bebob *bebob;
278         const struct snd_bebob_spec *spec;
279
280         if (entry->vendor_id == VEN_FOCUSRITE &&
281             entry->model_id == MODEL_FOCUSRITE_SAFFIRE_BOTH)
282                 spec = get_saffire_spec(unit);
283         else if (entry->vendor_id == VEN_MAUDIO1 &&
284                  entry->model_id == MODEL_MAUDIO_AUDIOPHILE_BOTH &&
285                  !check_audiophile_booted(unit))
286                 spec = NULL;
287         else
288                 spec = (const struct snd_bebob_spec *)entry->driver_data;
289
290         if (spec == NULL) {
291                 if (entry->vendor_id == VEN_MAUDIO1 ||
292                     entry->vendor_id == VEN_MAUDIO2)
293                         return snd_bebob_maudio_load_firmware(unit);
294                 else
295                         return -ENODEV;
296         }
297
298         /* Allocate this independent of sound card instance. */
299         bebob = kzalloc(sizeof(struct snd_bebob), GFP_KERNEL);
300         if (bebob == NULL)
301                 return -ENOMEM;
302
303         bebob->unit = fw_unit_get(unit);
304         bebob->entry = entry;
305         bebob->spec = spec;
306         dev_set_drvdata(&unit->device, bebob);
307
308         mutex_init(&bebob->mutex);
309         spin_lock_init(&bebob->lock);
310         init_waitqueue_head(&bebob->hwdep_wait);
311
312         /* Allocate and register this sound card later. */
313         INIT_DEFERRABLE_WORK(&bebob->dwork, do_registration);
314
315         if (entry->vendor_id != VEN_MAUDIO1 ||
316             (entry->model_id != MODEL_MAUDIO_FW1814 &&
317              entry->model_id != MODEL_MAUDIO_PROJECTMIX)) {
318                 snd_fw_schedule_registration(unit, &bebob->dwork);
319         } else {
320                 /*
321                  * This is a workaround. This bus reset seems to have an effect
322                  * to make devices correctly handling transactions. Without
323                  * this, the devices have gap_count mismatch. This causes much
324                  * failure of transaction.
325                  *
326                  * Just after registration, user-land application receive
327                  * signals from dbus and starts I/Os. To avoid I/Os till the
328                  * future bus reset, registration is done in next update().
329                  */
330                 fw_schedule_bus_reset(fw_parent_device(bebob->unit)->card,
331                                       false, true);
332         }
333
334         return 0;
335 }
336
337 /*
338  * This driver doesn't update streams in bus reset handler.
339  *
340  * DM1000/ DM1100/DM1500 chipsets with BeBoB firmware transfer packets with
341  * discontinued counter at bus reset. This discontinuity is immediately
342  * detected in packet streaming layer, then it sets XRUN to PCM substream.
343  *
344  * ALSA PCM applications can know the XRUN by getting -EPIPE from PCM operation.
345  * Then, they can recover the PCM substream by executing ioctl(2) with
346  * SNDRV_PCM_IOCTL_PREPARE. 'struct snd_pcm_ops.prepare' is called and drivers
347  * restart packet streaming.
348  *
349  * The above processing may be executed before this bus-reset handler is
350  * executed. When this handler updates streams with current isochronous
351  * channels, the streams already have the current ones.
352  */
353 static void
354 bebob_update(struct fw_unit *unit)
355 {
356         struct snd_bebob *bebob = dev_get_drvdata(&unit->device);
357
358         if (bebob == NULL)
359                 return;
360
361         /* Postpone a workqueue for deferred registration. */
362         if (!bebob->registered)
363                 snd_fw_schedule_registration(unit, &bebob->dwork);
364         else
365                 fcp_bus_reset(bebob->unit);
366 }
367
368 static void bebob_remove(struct fw_unit *unit)
369 {
370         struct snd_bebob *bebob = dev_get_drvdata(&unit->device);
371
372         if (bebob == NULL)
373                 return;
374
375         /*
376          * Confirm to stop the work for registration before the sound card is
377          * going to be released. The work is not scheduled again because bus
378          * reset handler is not called anymore.
379          */
380         cancel_delayed_work_sync(&bebob->dwork);
381
382         if (bebob->registered) {
383                 /* No need to wait for releasing card object in this context. */
384                 snd_card_free_when_closed(bebob->card);
385         } else {
386                 /* Don't forget this case. */
387                 bebob_free(bebob);
388         }
389 }
390
391 static const struct snd_bebob_rate_spec normal_rate_spec = {
392         .get    = &snd_bebob_stream_get_rate,
393         .set    = &snd_bebob_stream_set_rate
394 };
395 static const struct snd_bebob_spec spec_normal = {
396         .clock  = NULL,
397         .rate   = &normal_rate_spec,
398         .meter  = NULL
399 };
400
401 static const struct ieee1394_device_id bebob_id_table[] = {
402         /* Edirol, FA-66 */
403         SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010049, &spec_normal),
404         /* Edirol, FA-101 */
405         SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010048, &spec_normal),
406         /* Presonus, FIREBOX */
407         SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010000, &spec_normal),
408         /* PreSonus, FIREPOD/FP10 */
409         SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010066, &spec_normal),
410         /* PreSonus, Inspire1394 */
411         SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010001, &spec_normal),
412         /* BridgeCo, RDAudio1 */
413         SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010048, &spec_normal),
414         /* BridgeCo, Audio5 */
415         SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010049, &spec_normal),
416         /* Mackie, Onyx 1220/1620/1640 (Firewire I/O Card) */
417         SND_BEBOB_DEV_ENTRY(VEN_MACKIE2, 0x00010065, &spec_normal),
418         // Mackie, d.2 (optional Firewire card with DM1000).
419         SND_BEBOB_DEV_ENTRY(VEN_MACKIE1, 0x00010067, &spec_normal),
420         /* Stanton, ScratchAmp */
421         SND_BEBOB_DEV_ENTRY(VEN_STANTON, 0x00000001, &spec_normal),
422         /* Tascam, IF-FW DM */
423         SND_BEBOB_DEV_ENTRY(VEN_TASCAM, 0x00010067, &spec_normal),
424         /* Behringer, XENIX UFX 1204 */
425         SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001204, &spec_normal),
426         /* Behringer, XENIX UFX 1604 */
427         SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001604, &spec_normal),
428         /* Behringer, Digital Mixer X32 series (X-UF Card) */
429         SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00000006, &spec_normal),
430         /*  Behringer, F-Control Audio 1616 */
431         SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x001616, &spec_normal),
432         /*  Behringer, F-Control Audio 610 */
433         SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x000610, &spec_normal),
434         /* Apogee Electronics, Rosetta 200/400 (X-FireWire card) */
435         /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */
436         SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal),
437         /* Apogee Electronics, Ensemble */
438         SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x01eeee, &spec_normal),
439         /* ESI, Quatafire610 */
440         SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal),
441         /* AcousticReality, eARMasterOne */
442         SND_BEBOB_DEV_ENTRY(VEN_ACOUSTIC, 0x00000002, &spec_normal),
443         /* CME, MatrixKFW */
444         SND_BEBOB_DEV_ENTRY(VEN_CME, 0x00030000, &spec_normal),
445         /* Phonic, Helix Board 12 MkII */
446         SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00050000, &spec_normal),
447         /* Phonic, Helix Board 18 MkII */
448         SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00060000, &spec_normal),
449         /* Phonic, Helix Board 24 MkII */
450         SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00070000, &spec_normal),
451         /* Phonic, Helix Board 12 Universal/18 Universal/24 Universal */
452         SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00000000, &spec_normal),
453         /* Lynx, Aurora 8/16 (LT-FW) */
454         SND_BEBOB_DEV_ENTRY(VEN_LYNX, 0x00000001, &spec_normal),
455         /* ICON, FireXon */
456         SND_BEBOB_DEV_ENTRY(VEN_ICON, 0x00000001, &spec_normal),
457         /* PrismSound, Orpheus */
458         SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x00010048, &spec_normal),
459         /* PrismSound, ADA-8XR */
460         SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x0000ada8, &spec_normal),
461         /* TerraTec Electronic GmbH, PHASE 88 Rack FW */
462         SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000003, &phase88_rack_spec),
463         /* TerraTec Electronic GmbH, PHASE 24 FW */
464         SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &yamaha_terratec_spec),
465         /* TerraTec Electronic GmbH, Phase X24 FW */
466         SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &yamaha_terratec_spec),
467         /* TerraTec Electronic GmbH, EWS MIC2/MIC8 */
468         SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000005, &spec_normal),
469         /* Terratec Electronic GmbH, Aureon 7.1 Firewire */
470         SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000002, &spec_normal),
471         /* Yamaha, GO44 */
472         SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_terratec_spec),
473         /* YAMAHA, GO46 */
474         SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_terratec_spec),
475         /* Focusrite, SaffirePro 26 I/O */
476         SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec),
477         /* Focusrite, SaffirePro 10 I/O */
478         {
479                 // The combination of vendor_id and model_id is the same as the
480                 // same as the one of Liquid Saffire 56.
481                 .match_flags    = IEEE1394_MATCH_VENDOR_ID |
482                                   IEEE1394_MATCH_MODEL_ID |
483                                   IEEE1394_MATCH_SPECIFIER_ID |
484                                   IEEE1394_MATCH_VERSION,
485                 .vendor_id      = VEN_FOCUSRITE,
486                 .model_id       = 0x000006,
487                 .specifier_id   = 0x00a02d,
488                 .version        = 0x010001,
489                 .driver_data    = (kernel_ulong_t)&saffirepro_10_spec,
490         },
491         /* Focusrite, Saffire(no label and LE) */
492         SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH,
493                             &saffire_spec),
494         /* M-Audio, Firewire 410 */
495         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010058, NULL),     /* bootloader */
496         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010046, &maudio_fw410_spec),
497         /* M-Audio, Firewire Audiophile */
498         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_AUDIOPHILE_BOTH,
499                             &maudio_audiophile_spec),
500         /* M-Audio, Firewire Solo */
501         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010062, &maudio_solo_spec),
502         /* M-Audio, Ozonic */
503         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x0000000a, &maudio_ozonic_spec),
504         /* M-Audio NRV10 */
505         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec),
506         /* M-Audio, ProFireLightbridge */
507         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal),
508         /* Firewire 1814 */
509         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL),     /* bootloader */
510         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814,
511                             &maudio_special_spec),
512         /* M-Audio ProjectMix */
513         SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROJECTMIX,
514                             &maudio_special_spec),
515         /* Digidesign Mbox 2 Pro */
516         SND_BEBOB_DEV_ENTRY(VEN_DIGIDESIGN, 0x0000a9, &spec_normal),
517         // Toneweal FW66.
518         SND_BEBOB_DEV_ENTRY(OUI_SHOUYO, 0x020002, &spec_normal),
519         /* IDs are unknown but able to be supported */
520         /*  Apogee, Mini-ME Firewire */
521         /*  Apogee, Mini-DAC Firewire */
522         /*  Cakawalk, Sonar Power Studio 66 */
523         /*  CME, UF400e */
524         /*  ESI, Quotafire XL */
525         /*  Infrasonic, DewX */
526         /*  Infrasonic, Windy6 */
527         /*  Mackie, Digital X Bus x.200 */
528         /*  Mackie, Digital X Bus x.400 */
529         /*  Phonic, HB 12 */
530         /*  Phonic, HB 24 */
531         /*  Phonic, HB 18 */
532         /*  Phonic, FireFly 202 */
533         /*  Phonic, FireFly 302 */
534         /*  Rolf Spuler, Firewire Guitar */
535         {}
536 };
537 MODULE_DEVICE_TABLE(ieee1394, bebob_id_table);
538
539 static struct fw_driver bebob_driver = {
540         .driver = {
541                 .owner  = THIS_MODULE,
542                 .name   = "snd-bebob",
543                 .bus    = &fw_bus_type,
544         },
545         .probe    = bebob_probe,
546         .update   = bebob_update,
547         .remove   = bebob_remove,
548         .id_table = bebob_id_table,
549 };
550
551 static int __init
552 snd_bebob_init(void)
553 {
554         return driver_register(&bebob_driver.driver);
555 }
556
557 static void __exit
558 snd_bebob_exit(void)
559 {
560         driver_unregister(&bebob_driver.driver);
561 }
562
563 module_init(snd_bebob_init);
564 module_exit(snd_bebob_exit);