David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * bebob.c - a part of driver for BeBoB based devices |
| 4 | * |
| 5 | * Copyright (c) 2013-2014 Takashi Sakamoto |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 |
Olivier Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame] | 62 | #define OUI_SHOUYO 0x002327 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 63 | |
| 64 | #define MODEL_FOCUSRITE_SAFFIRE_BOTH 0x00000000 |
| 65 | #define MODEL_MAUDIO_AUDIOPHILE_BOTH 0x00010060 |
| 66 | #define MODEL_MAUDIO_FW1814 0x00010071 |
| 67 | #define MODEL_MAUDIO_PROJECTMIX 0x00010091 |
| 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 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 138 | snd_bebob_stream_destroy_duplex(bebob); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | } |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 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; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | err = snd_bebob_stream_init_duplex(bebob); |
| 215 | if (err < 0) |
| 216 | goto error; |
| 217 | |
| 218 | snd_bebob_proc_init(bebob); |
| 219 | |
| 220 | if (bebob->midi_input_ports > 0 || bebob->midi_output_ports > 0) { |
| 221 | err = snd_bebob_create_midi_devices(bebob); |
| 222 | if (err < 0) |
| 223 | goto error; |
| 224 | } |
| 225 | |
| 226 | err = snd_bebob_create_pcm_devices(bebob); |
| 227 | if (err < 0) |
| 228 | goto error; |
| 229 | |
| 230 | err = snd_bebob_create_hwdep_device(bebob); |
| 231 | if (err < 0) |
| 232 | goto error; |
| 233 | |
| 234 | err = snd_card_register(bebob->card); |
| 235 | if (err < 0) |
| 236 | goto error; |
| 237 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 238 | bebob->registered = true; |
| 239 | |
| 240 | return; |
| 241 | error: |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 242 | snd_card_free(bebob->card); |
| 243 | dev_info(&bebob->unit->device, |
| 244 | "Sound card registration failed: %d\n", err); |
| 245 | } |
| 246 | |
| 247 | static int |
| 248 | bebob_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry) |
| 249 | { |
| 250 | struct snd_bebob *bebob; |
| 251 | const struct snd_bebob_spec *spec; |
| 252 | |
| 253 | if (entry->vendor_id == VEN_FOCUSRITE && |
| 254 | entry->model_id == MODEL_FOCUSRITE_SAFFIRE_BOTH) |
| 255 | spec = get_saffire_spec(unit); |
| 256 | else if (entry->vendor_id == VEN_MAUDIO1 && |
| 257 | entry->model_id == MODEL_MAUDIO_AUDIOPHILE_BOTH && |
| 258 | !check_audiophile_booted(unit)) |
| 259 | spec = NULL; |
| 260 | else |
| 261 | spec = (const struct snd_bebob_spec *)entry->driver_data; |
| 262 | |
| 263 | if (spec == NULL) { |
| 264 | if (entry->vendor_id == VEN_MAUDIO1 || |
| 265 | entry->vendor_id == VEN_MAUDIO2) |
| 266 | return snd_bebob_maudio_load_firmware(unit); |
| 267 | else |
| 268 | return -ENODEV; |
| 269 | } |
| 270 | |
| 271 | /* Allocate this independent of sound card instance. */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 272 | bebob = devm_kzalloc(&unit->device, sizeof(struct snd_bebob), |
| 273 | GFP_KERNEL); |
| 274 | if (!bebob) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 275 | return -ENOMEM; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 276 | bebob->unit = fw_unit_get(unit); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 277 | dev_set_drvdata(&unit->device, bebob); |
| 278 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 279 | bebob->entry = entry; |
| 280 | bebob->spec = spec; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 281 | mutex_init(&bebob->mutex); |
| 282 | spin_lock_init(&bebob->lock); |
| 283 | init_waitqueue_head(&bebob->hwdep_wait); |
| 284 | |
| 285 | /* Allocate and register this sound card later. */ |
| 286 | INIT_DEFERRABLE_WORK(&bebob->dwork, do_registration); |
| 287 | |
| 288 | if (entry->vendor_id != VEN_MAUDIO1 || |
| 289 | (entry->model_id != MODEL_MAUDIO_FW1814 && |
| 290 | entry->model_id != MODEL_MAUDIO_PROJECTMIX)) { |
| 291 | snd_fw_schedule_registration(unit, &bebob->dwork); |
| 292 | } else { |
| 293 | /* |
| 294 | * This is a workaround. This bus reset seems to have an effect |
| 295 | * to make devices correctly handling transactions. Without |
| 296 | * this, the devices have gap_count mismatch. This causes much |
| 297 | * failure of transaction. |
| 298 | * |
| 299 | * Just after registration, user-land application receive |
| 300 | * signals from dbus and starts I/Os. To avoid I/Os till the |
| 301 | * future bus reset, registration is done in next update(). |
| 302 | */ |
| 303 | fw_schedule_bus_reset(fw_parent_device(bebob->unit)->card, |
| 304 | false, true); |
| 305 | } |
| 306 | |
| 307 | return 0; |
| 308 | } |
| 309 | |
| 310 | /* |
| 311 | * This driver doesn't update streams in bus reset handler. |
| 312 | * |
| 313 | * DM1000/ DM1100/DM1500 chipsets with BeBoB firmware transfer packets with |
| 314 | * discontinued counter at bus reset. This discontinuity is immediately |
| 315 | * detected in packet streaming layer, then it sets XRUN to PCM substream. |
| 316 | * |
| 317 | * ALSA PCM applications can know the XRUN by getting -EPIPE from PCM operation. |
| 318 | * Then, they can recover the PCM substream by executing ioctl(2) with |
| 319 | * SNDRV_PCM_IOCTL_PREPARE. 'struct snd_pcm_ops.prepare' is called and drivers |
| 320 | * restart packet streaming. |
| 321 | * |
| 322 | * The above processing may be executed before this bus-reset handler is |
| 323 | * executed. When this handler updates streams with current isochronous |
| 324 | * channels, the streams already have the current ones. |
| 325 | */ |
| 326 | static void |
| 327 | bebob_update(struct fw_unit *unit) |
| 328 | { |
| 329 | struct snd_bebob *bebob = dev_get_drvdata(&unit->device); |
| 330 | |
| 331 | if (bebob == NULL) |
| 332 | return; |
| 333 | |
| 334 | /* Postpone a workqueue for deferred registration. */ |
| 335 | if (!bebob->registered) |
| 336 | snd_fw_schedule_registration(unit, &bebob->dwork); |
| 337 | else |
| 338 | fcp_bus_reset(bebob->unit); |
| 339 | } |
| 340 | |
| 341 | static void bebob_remove(struct fw_unit *unit) |
| 342 | { |
| 343 | struct snd_bebob *bebob = dev_get_drvdata(&unit->device); |
| 344 | |
| 345 | if (bebob == NULL) |
| 346 | return; |
| 347 | |
| 348 | /* |
| 349 | * Confirm to stop the work for registration before the sound card is |
| 350 | * going to be released. The work is not scheduled again because bus |
| 351 | * reset handler is not called anymore. |
| 352 | */ |
| 353 | cancel_delayed_work_sync(&bebob->dwork); |
| 354 | |
| 355 | if (bebob->registered) { |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 356 | // Block till all of ALSA character devices are released. |
| 357 | snd_card_free(bebob->card); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 358 | } |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 359 | |
| 360 | mutex_destroy(&bebob->mutex); |
| 361 | fw_unit_put(bebob->unit); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | static const struct snd_bebob_rate_spec normal_rate_spec = { |
| 365 | .get = &snd_bebob_stream_get_rate, |
| 366 | .set = &snd_bebob_stream_set_rate |
| 367 | }; |
| 368 | static const struct snd_bebob_spec spec_normal = { |
| 369 | .clock = NULL, |
| 370 | .rate = &normal_rate_spec, |
| 371 | .meter = NULL |
| 372 | }; |
| 373 | |
| 374 | static const struct ieee1394_device_id bebob_id_table[] = { |
| 375 | /* Edirol, FA-66 */ |
| 376 | SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010049, &spec_normal), |
| 377 | /* Edirol, FA-101 */ |
| 378 | SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010048, &spec_normal), |
| 379 | /* Presonus, FIREBOX */ |
| 380 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010000, &spec_normal), |
| 381 | /* PreSonus, FIREPOD/FP10 */ |
| 382 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010066, &spec_normal), |
| 383 | /* PreSonus, Inspire1394 */ |
| 384 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010001, &spec_normal), |
| 385 | /* BridgeCo, RDAudio1 */ |
| 386 | SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010048, &spec_normal), |
| 387 | /* BridgeCo, Audio5 */ |
| 388 | SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010049, &spec_normal), |
| 389 | /* Mackie, Onyx 1220/1620/1640 (Firewire I/O Card) */ |
| 390 | SND_BEBOB_DEV_ENTRY(VEN_MACKIE2, 0x00010065, &spec_normal), |
Olivier Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame] | 391 | // Mackie, d.2 (optional Firewire card with DM1000). |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 392 | SND_BEBOB_DEV_ENTRY(VEN_MACKIE1, 0x00010067, &spec_normal), |
| 393 | /* Stanton, ScratchAmp */ |
| 394 | SND_BEBOB_DEV_ENTRY(VEN_STANTON, 0x00000001, &spec_normal), |
| 395 | /* Tascam, IF-FW DM */ |
| 396 | SND_BEBOB_DEV_ENTRY(VEN_TASCAM, 0x00010067, &spec_normal), |
| 397 | /* Behringer, XENIX UFX 1204 */ |
| 398 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001204, &spec_normal), |
| 399 | /* Behringer, XENIX UFX 1604 */ |
| 400 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001604, &spec_normal), |
| 401 | /* Behringer, Digital Mixer X32 series (X-UF Card) */ |
| 402 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00000006, &spec_normal), |
| 403 | /* Behringer, F-Control Audio 1616 */ |
| 404 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x001616, &spec_normal), |
| 405 | /* Behringer, F-Control Audio 610 */ |
| 406 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x000610, &spec_normal), |
| 407 | /* Apogee Electronics, Rosetta 200/400 (X-FireWire card) */ |
| 408 | /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */ |
| 409 | SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal), |
| 410 | /* Apogee Electronics, Ensemble */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 411 | SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x01eeee, &spec_normal), |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 412 | /* ESI, Quatafire610 */ |
| 413 | SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal), |
| 414 | /* AcousticReality, eARMasterOne */ |
| 415 | SND_BEBOB_DEV_ENTRY(VEN_ACOUSTIC, 0x00000002, &spec_normal), |
| 416 | /* CME, MatrixKFW */ |
| 417 | SND_BEBOB_DEV_ENTRY(VEN_CME, 0x00030000, &spec_normal), |
| 418 | /* Phonic, Helix Board 12 MkII */ |
| 419 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00050000, &spec_normal), |
| 420 | /* Phonic, Helix Board 18 MkII */ |
| 421 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00060000, &spec_normal), |
| 422 | /* Phonic, Helix Board 24 MkII */ |
| 423 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00070000, &spec_normal), |
| 424 | /* Phonic, Helix Board 12 Universal/18 Universal/24 Universal */ |
| 425 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00000000, &spec_normal), |
| 426 | /* Lynx, Aurora 8/16 (LT-FW) */ |
| 427 | SND_BEBOB_DEV_ENTRY(VEN_LYNX, 0x00000001, &spec_normal), |
| 428 | /* ICON, FireXon */ |
| 429 | SND_BEBOB_DEV_ENTRY(VEN_ICON, 0x00000001, &spec_normal), |
| 430 | /* PrismSound, Orpheus */ |
| 431 | SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x00010048, &spec_normal), |
| 432 | /* PrismSound, ADA-8XR */ |
| 433 | SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x0000ada8, &spec_normal), |
| 434 | /* TerraTec Electronic GmbH, PHASE 88 Rack FW */ |
| 435 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000003, &phase88_rack_spec), |
| 436 | /* TerraTec Electronic GmbH, PHASE 24 FW */ |
| 437 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &yamaha_terratec_spec), |
| 438 | /* TerraTec Electronic GmbH, Phase X24 FW */ |
| 439 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &yamaha_terratec_spec), |
| 440 | /* TerraTec Electronic GmbH, EWS MIC2/MIC8 */ |
| 441 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000005, &spec_normal), |
| 442 | /* Terratec Electronic GmbH, Aureon 7.1 Firewire */ |
| 443 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000002, &spec_normal), |
| 444 | /* Yamaha, GO44 */ |
| 445 | SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_terratec_spec), |
| 446 | /* YAMAHA, GO46 */ |
| 447 | SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_terratec_spec), |
| 448 | /* Focusrite, SaffirePro 26 I/O */ |
| 449 | SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec), |
| 450 | /* Focusrite, SaffirePro 10 I/O */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 451 | { |
| 452 | // The combination of vendor_id and model_id is the same as the |
| 453 | // same as the one of Liquid Saffire 56. |
| 454 | .match_flags = IEEE1394_MATCH_VENDOR_ID | |
| 455 | IEEE1394_MATCH_MODEL_ID | |
| 456 | IEEE1394_MATCH_SPECIFIER_ID | |
| 457 | IEEE1394_MATCH_VERSION, |
| 458 | .vendor_id = VEN_FOCUSRITE, |
| 459 | .model_id = 0x000006, |
| 460 | .specifier_id = 0x00a02d, |
| 461 | .version = 0x010001, |
| 462 | .driver_data = (kernel_ulong_t)&saffirepro_10_spec, |
| 463 | }, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 464 | /* Focusrite, Saffire(no label and LE) */ |
| 465 | SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH, |
| 466 | &saffire_spec), |
| 467 | /* M-Audio, Firewire 410 */ |
| 468 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010058, NULL), /* bootloader */ |
| 469 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010046, &maudio_fw410_spec), |
| 470 | /* M-Audio, Firewire Audiophile */ |
| 471 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_AUDIOPHILE_BOTH, |
| 472 | &maudio_audiophile_spec), |
| 473 | /* M-Audio, Firewire Solo */ |
| 474 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010062, &maudio_solo_spec), |
| 475 | /* M-Audio, Ozonic */ |
| 476 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x0000000a, &maudio_ozonic_spec), |
| 477 | /* M-Audio NRV10 */ |
| 478 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec), |
| 479 | /* M-Audio, ProFireLightbridge */ |
| 480 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal), |
| 481 | /* Firewire 1814 */ |
| 482 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL), /* bootloader */ |
| 483 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814, |
| 484 | &maudio_special_spec), |
| 485 | /* M-Audio ProjectMix */ |
| 486 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROJECTMIX, |
| 487 | &maudio_special_spec), |
| 488 | /* Digidesign Mbox 2 Pro */ |
| 489 | SND_BEBOB_DEV_ENTRY(VEN_DIGIDESIGN, 0x0000a9, &spec_normal), |
Olivier Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame] | 490 | // Toneweal FW66. |
| 491 | SND_BEBOB_DEV_ENTRY(OUI_SHOUYO, 0x020002, &spec_normal), |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 492 | /* IDs are unknown but able to be supported */ |
| 493 | /* Apogee, Mini-ME Firewire */ |
| 494 | /* Apogee, Mini-DAC Firewire */ |
| 495 | /* Cakawalk, Sonar Power Studio 66 */ |
| 496 | /* CME, UF400e */ |
| 497 | /* ESI, Quotafire XL */ |
| 498 | /* Infrasonic, DewX */ |
| 499 | /* Infrasonic, Windy6 */ |
| 500 | /* Mackie, Digital X Bus x.200 */ |
| 501 | /* Mackie, Digital X Bus x.400 */ |
| 502 | /* Phonic, HB 12 */ |
| 503 | /* Phonic, HB 24 */ |
| 504 | /* Phonic, HB 18 */ |
| 505 | /* Phonic, FireFly 202 */ |
| 506 | /* Phonic, FireFly 302 */ |
| 507 | /* Rolf Spuler, Firewire Guitar */ |
| 508 | {} |
| 509 | }; |
| 510 | MODULE_DEVICE_TABLE(ieee1394, bebob_id_table); |
| 511 | |
| 512 | static struct fw_driver bebob_driver = { |
| 513 | .driver = { |
| 514 | .owner = THIS_MODULE, |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 515 | .name = KBUILD_MODNAME, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 516 | .bus = &fw_bus_type, |
| 517 | }, |
| 518 | .probe = bebob_probe, |
| 519 | .update = bebob_update, |
| 520 | .remove = bebob_remove, |
| 521 | .id_table = bebob_id_table, |
| 522 | }; |
| 523 | |
| 524 | static int __init |
| 525 | snd_bebob_init(void) |
| 526 | { |
| 527 | return driver_register(&bebob_driver.driver); |
| 528 | } |
| 529 | |
| 530 | static void __exit |
| 531 | snd_bebob_exit(void) |
| 532 | { |
| 533 | driver_unregister(&bebob_driver.driver); |
| 534 | } |
| 535 | |
| 536 | module_init(snd_bebob_init); |
| 537 | module_exit(snd_bebob_exit); |