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