Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 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. */ |
Takashi Sakamoto | 7b4d7dc | 2015-06-14 12:49:33 +0900 | [diff] [blame] | 36 | #define INFO_OFFSET_BEBOB_VERSION 0x08 |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 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_MACKIE 0x0000000f |
| 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 |
Takashi Sakamoto | 326b9ca | 2014-04-25 22:45:22 +0900 | [diff] [blame] | 56 | #define VEN_TERRATEC 0x00000aac |
Takashi Sakamoto | 8ac98a3 | 2014-04-25 22:45:23 +0900 | [diff] [blame] | 57 | #define VEN_YAMAHA 0x0000a0de |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 58 | #define VEN_FOCUSRITE 0x0000130e |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 59 | #define VEN_MAUDIO1 0x00000d6c |
| 60 | #define VEN_MAUDIO2 0x000007f5 |
Takashi Sakamoto | 146a5e3 | 2015-05-24 20:51:45 +0900 | [diff] [blame] | 61 | #define VEN_DIGIDESIGN 0x00a07e |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 62 | |
| 63 | #define MODEL_FOCUSRITE_SAFFIRE_BOTH 0x00000000 |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 64 | #define MODEL_MAUDIO_AUDIOPHILE_BOTH 0x00010060 |
Takashi Sakamoto | 3149ac4 | 2014-04-25 22:45:26 +0900 | [diff] [blame] | 65 | #define MODEL_MAUDIO_FW1814 0x00010071 |
| 66 | #define MODEL_MAUDIO_PROJECTMIX 0x00010091 |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 67 | |
| 68 | static int |
| 69 | name_device(struct snd_bebob *bebob, unsigned int vendor_id) |
| 70 | { |
| 71 | struct fw_device *fw_dev = fw_parent_device(bebob->unit); |
| 72 | char vendor[24] = {0}; |
| 73 | char model[32] = {0}; |
Takashi Sakamoto | 791c67b | 2014-05-28 00:14:44 +0900 | [diff] [blame] | 74 | u32 hw_id; |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 75 | u32 data[2] = {0}; |
| 76 | u32 revision; |
Takashi Sakamoto | 7b4d7dc | 2015-06-14 12:49:33 +0900 | [diff] [blame] | 77 | u32 version; |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 78 | int err; |
| 79 | |
| 80 | /* get vendor name from root directory */ |
| 81 | err = fw_csr_string(fw_dev->config_rom + 5, CSR_VENDOR, |
| 82 | vendor, sizeof(vendor)); |
| 83 | if (err < 0) |
| 84 | goto end; |
| 85 | |
| 86 | /* get model name from unit directory */ |
| 87 | err = fw_csr_string(bebob->unit->directory, CSR_MODEL, |
| 88 | model, sizeof(model)); |
| 89 | if (err < 0) |
| 90 | goto end; |
| 91 | |
| 92 | /* get hardware id */ |
| 93 | err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_ID, |
Takashi Sakamoto | 791c67b | 2014-05-28 00:14:44 +0900 | [diff] [blame] | 94 | &hw_id); |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 95 | if (err < 0) |
| 96 | goto end; |
| 97 | |
| 98 | /* get hardware revision */ |
| 99 | err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_REVISION, |
| 100 | &revision); |
| 101 | if (err < 0) |
| 102 | goto end; |
| 103 | |
| 104 | /* get GUID */ |
| 105 | err = snd_bebob_read_block(bebob->unit, INFO_OFFSET_GUID, |
| 106 | data, sizeof(data)); |
| 107 | if (err < 0) |
| 108 | goto end; |
| 109 | |
Takashi Sakamoto | 7b4d7dc | 2015-06-14 12:49:33 +0900 | [diff] [blame] | 110 | err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_BEBOB_VERSION, |
| 111 | &version); |
| 112 | if (err < 0) |
| 113 | goto end; |
| 114 | bebob->version = version; |
| 115 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 116 | strcpy(bebob->card->driver, "BeBoB"); |
| 117 | strcpy(bebob->card->shortname, model); |
| 118 | strcpy(bebob->card->mixername, model); |
| 119 | snprintf(bebob->card->longname, sizeof(bebob->card->longname), |
| 120 | "%s %s (id:%d, rev:%d), GUID %08x%08x at %s, S%d", |
Takashi Sakamoto | 791c67b | 2014-05-28 00:14:44 +0900 | [diff] [blame] | 121 | vendor, model, hw_id, revision, |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 122 | data[0], data[1], dev_name(&bebob->unit->device), |
| 123 | 100 << fw_dev->max_speed); |
| 124 | end: |
| 125 | return err; |
| 126 | } |
| 127 | |
Takashi Sakamoto | 12ed719 | 2015-02-21 23:54:57 +0900 | [diff] [blame] | 128 | /* |
| 129 | * This module releases the FireWire unit data after all ALSA character devices |
| 130 | * are released by applications. This is for releasing stream data or finishing |
| 131 | * transactions safely. Thus at returning from .remove(), this module still keep |
| 132 | * references for the unit. |
| 133 | */ |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 134 | static void |
| 135 | bebob_card_free(struct snd_card *card) |
| 136 | { |
| 137 | struct snd_bebob *bebob = card->private_data; |
| 138 | |
Takashi Sakamoto | dec8431 | 2015-02-21 23:55:00 +0900 | [diff] [blame] | 139 | snd_bebob_stream_destroy_duplex(bebob); |
Takashi Sakamoto | 12ed719 | 2015-02-21 23:54:57 +0900 | [diff] [blame] | 140 | fw_unit_put(bebob->unit); |
| 141 | |
Takashi Sakamoto | dec8431 | 2015-02-21 23:55:00 +0900 | [diff] [blame] | 142 | kfree(bebob->maudio_special_quirk); |
| 143 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 144 | if (bebob->card_index >= 0) { |
| 145 | mutex_lock(&devices_mutex); |
| 146 | clear_bit(bebob->card_index, devices_used); |
| 147 | mutex_unlock(&devices_mutex); |
| 148 | } |
| 149 | |
| 150 | mutex_destroy(&bebob->mutex); |
| 151 | } |
| 152 | |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 153 | static const struct snd_bebob_spec * |
| 154 | get_saffire_spec(struct fw_unit *unit) |
| 155 | { |
| 156 | char name[24] = {0}; |
| 157 | |
| 158 | if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0) |
| 159 | return NULL; |
| 160 | |
| 161 | if (strcmp(name, "SaffireLE") == 0) |
| 162 | return &saffire_le_spec; |
| 163 | else |
| 164 | return &saffire_spec; |
| 165 | } |
| 166 | |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 167 | static bool |
| 168 | check_audiophile_booted(struct fw_unit *unit) |
| 169 | { |
| 170 | char name[24] = {0}; |
| 171 | |
| 172 | if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0) |
| 173 | return false; |
| 174 | |
| 175 | return strncmp(name, "FW Audiophile Bootloader", 15) != 0; |
| 176 | } |
| 177 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 178 | static int |
| 179 | bebob_probe(struct fw_unit *unit, |
| 180 | const struct ieee1394_device_id *entry) |
| 181 | { |
| 182 | struct snd_card *card; |
| 183 | struct snd_bebob *bebob; |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 184 | const struct snd_bebob_spec *spec; |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 185 | unsigned int card_index; |
| 186 | int err; |
| 187 | |
| 188 | mutex_lock(&devices_mutex); |
| 189 | |
| 190 | for (card_index = 0; card_index < SNDRV_CARDS; card_index++) { |
| 191 | if (!test_bit(card_index, devices_used) && enable[card_index]) |
| 192 | break; |
| 193 | } |
| 194 | if (card_index >= SNDRV_CARDS) { |
| 195 | err = -ENOENT; |
| 196 | goto end; |
| 197 | } |
| 198 | |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 199 | if ((entry->vendor_id == VEN_FOCUSRITE) && |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 200 | (entry->model_id == MODEL_FOCUSRITE_SAFFIRE_BOTH)) |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 201 | spec = get_saffire_spec(unit); |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 202 | else if ((entry->vendor_id == VEN_MAUDIO1) && |
| 203 | (entry->model_id == MODEL_MAUDIO_AUDIOPHILE_BOTH) && |
| 204 | !check_audiophile_booted(unit)) |
| 205 | spec = NULL; |
| 206 | else |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 207 | spec = (const struct snd_bebob_spec *)entry->driver_data; |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 208 | |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 209 | if (spec == NULL) { |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 210 | if ((entry->vendor_id == VEN_MAUDIO1) || |
| 211 | (entry->vendor_id == VEN_MAUDIO2)) |
| 212 | err = snd_bebob_maudio_load_firmware(unit); |
| 213 | else |
| 214 | err = -ENOSYS; |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 215 | goto end; |
| 216 | } |
| 217 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 218 | err = snd_card_new(&unit->device, index[card_index], id[card_index], |
| 219 | THIS_MODULE, sizeof(struct snd_bebob), &card); |
| 220 | if (err < 0) |
| 221 | goto end; |
| 222 | bebob = card->private_data; |
| 223 | bebob->card_index = card_index; |
| 224 | set_bit(card_index, devices_used); |
| 225 | card->private_free = bebob_card_free; |
| 226 | |
| 227 | bebob->card = card; |
Takashi Sakamoto | 12ed719 | 2015-02-21 23:54:57 +0900 | [diff] [blame] | 228 | bebob->unit = fw_unit_get(unit); |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 229 | bebob->spec = spec; |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 230 | mutex_init(&bebob->mutex); |
| 231 | spin_lock_init(&bebob->lock); |
Takashi Sakamoto | 618eabe | 2014-04-25 22:45:20 +0900 | [diff] [blame] | 232 | init_waitqueue_head(&bebob->hwdep_wait); |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 233 | |
| 234 | err = name_device(bebob, entry->vendor_id); |
| 235 | if (err < 0) |
| 236 | goto error; |
| 237 | |
Takashi Sakamoto | 3149ac4 | 2014-04-25 22:45:26 +0900 | [diff] [blame] | 238 | if ((entry->vendor_id == VEN_MAUDIO1) && |
| 239 | (entry->model_id == MODEL_MAUDIO_FW1814)) |
| 240 | err = snd_bebob_maudio_special_discover(bebob, true); |
| 241 | else if ((entry->vendor_id == VEN_MAUDIO1) && |
| 242 | (entry->model_id == MODEL_MAUDIO_PROJECTMIX)) |
| 243 | err = snd_bebob_maudio_special_discover(bebob, false); |
| 244 | else |
| 245 | err = snd_bebob_stream_discover(bebob); |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 246 | if (err < 0) |
| 247 | goto error; |
Takashi Sakamoto | eb7b3a0 | 2014-04-25 22:45:15 +0900 | [diff] [blame] | 248 | |
Takashi Sakamoto | ad9697b | 2014-04-25 22:45:17 +0900 | [diff] [blame] | 249 | snd_bebob_proc_init(bebob); |
| 250 | |
Takashi Sakamoto | 248b780 | 2014-04-25 22:45:18 +0900 | [diff] [blame] | 251 | if ((bebob->midi_input_ports > 0) || |
| 252 | (bebob->midi_output_ports > 0)) { |
| 253 | err = snd_bebob_create_midi_devices(bebob); |
| 254 | if (err < 0) |
| 255 | goto error; |
| 256 | } |
| 257 | |
Takashi Sakamoto | fbbebd2 | 2014-04-25 22:45:19 +0900 | [diff] [blame] | 258 | err = snd_bebob_create_pcm_devices(bebob); |
| 259 | if (err < 0) |
| 260 | goto error; |
| 261 | |
Takashi Sakamoto | 618eabe | 2014-04-25 22:45:20 +0900 | [diff] [blame] | 262 | err = snd_bebob_create_hwdep_device(bebob); |
| 263 | if (err < 0) |
| 264 | goto error; |
| 265 | |
Takashi Sakamoto | eb7b3a0 | 2014-04-25 22:45:15 +0900 | [diff] [blame] | 266 | err = snd_bebob_stream_init_duplex(bebob); |
| 267 | if (err < 0) |
| 268 | goto error; |
| 269 | |
Takashi Sakamoto | 9b1ee0b | 2014-04-25 22:45:30 +0900 | [diff] [blame] | 270 | if (!bebob->maudio_special_quirk) { |
| 271 | err = snd_card_register(card); |
| 272 | if (err < 0) { |
| 273 | snd_bebob_stream_destroy_duplex(bebob); |
| 274 | goto error; |
| 275 | } |
| 276 | } else { |
| 277 | /* |
| 278 | * This is a workaround. This bus reset seems to have an effect |
| 279 | * to make devices correctly handling transactions. Without |
| 280 | * this, the devices have gap_count mismatch. This causes much |
| 281 | * failure of transaction. |
| 282 | * |
| 283 | * Just after registration, user-land application receive |
| 284 | * signals from dbus and starts I/Os. To avoid I/Os till the |
| 285 | * future bus reset, registration is done in next update(). |
| 286 | */ |
| 287 | bebob->deferred_registration = true; |
| 288 | fw_schedule_bus_reset(fw_parent_device(bebob->unit)->card, |
| 289 | false, true); |
Takashi Sakamoto | eb7b3a0 | 2014-04-25 22:45:15 +0900 | [diff] [blame] | 290 | } |
| 291 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 292 | dev_set_drvdata(&unit->device, bebob); |
| 293 | end: |
| 294 | mutex_unlock(&devices_mutex); |
| 295 | return err; |
| 296 | error: |
| 297 | mutex_unlock(&devices_mutex); |
| 298 | snd_card_free(card); |
| 299 | return err; |
| 300 | } |
| 301 | |
| 302 | static void |
| 303 | bebob_update(struct fw_unit *unit) |
| 304 | { |
| 305 | struct snd_bebob *bebob = dev_get_drvdata(&unit->device); |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 306 | |
| 307 | if (bebob == NULL) |
| 308 | return; |
| 309 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 310 | fcp_bus_reset(bebob->unit); |
Takashi Sakamoto | eb7b3a0 | 2014-04-25 22:45:15 +0900 | [diff] [blame] | 311 | snd_bebob_stream_update_duplex(bebob); |
Takashi Sakamoto | 9b1ee0b | 2014-04-25 22:45:30 +0900 | [diff] [blame] | 312 | |
| 313 | if (bebob->deferred_registration) { |
| 314 | if (snd_card_register(bebob->card) < 0) { |
| 315 | snd_bebob_stream_destroy_duplex(bebob); |
| 316 | snd_card_free(bebob->card); |
| 317 | } |
| 318 | bebob->deferred_registration = false; |
| 319 | } |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | static void bebob_remove(struct fw_unit *unit) |
| 323 | { |
| 324 | struct snd_bebob *bebob = dev_get_drvdata(&unit->device); |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 325 | |
| 326 | if (bebob == NULL) |
| 327 | return; |
| 328 | |
Takashi Sakamoto | dec8431 | 2015-02-21 23:55:00 +0900 | [diff] [blame] | 329 | /* Awake bus-reset waiters. */ |
| 330 | if (!completion_done(&bebob->bus_reset)) |
| 331 | complete_all(&bebob->bus_reset); |
Takashi Sakamoto | 12ed719 | 2015-02-21 23:54:57 +0900 | [diff] [blame] | 332 | |
| 333 | /* No need to wait for releasing card object in this context. */ |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 334 | snd_card_free_when_closed(bebob->card); |
| 335 | } |
| 336 | |
Takashi Sakamoto | 9fb01cd | 2014-05-28 00:14:45 +0900 | [diff] [blame] | 337 | static struct snd_bebob_rate_spec normal_rate_spec = { |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 338 | .get = &snd_bebob_stream_get_rate, |
| 339 | .set = &snd_bebob_stream_set_rate |
| 340 | }; |
| 341 | static const struct snd_bebob_spec spec_normal = { |
| 342 | .clock = NULL, |
| 343 | .rate = &normal_rate_spec, |
| 344 | .meter = NULL |
| 345 | }; |
| 346 | |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 347 | static const struct ieee1394_device_id bebob_id_table[] = { |
| 348 | /* Edirol, FA-66 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 349 | SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010049, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 350 | /* Edirol, FA-101 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 351 | SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010048, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 352 | /* Presonus, FIREBOX */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 353 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 354 | /* PreSonus, FIREPOD/FP10 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 355 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010066, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 356 | /* PreSonus, Inspire1394 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 357 | SND_BEBOB_DEV_ENTRY(VEN_PRESONUS, 0x00010001, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 358 | /* BridgeCo, RDAudio1 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 359 | SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010048, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 360 | /* BridgeCo, Audio5 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 361 | SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010049, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 362 | /* Mackie, Onyx 1220/1620/1640 (Firewire I/O Card) */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 363 | SND_BEBOB_DEV_ENTRY(VEN_MACKIE, 0x00010065, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 364 | /* Mackie, d.2 (Firewire Option) */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 365 | SND_BEBOB_DEV_ENTRY(VEN_MACKIE, 0x00010067, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 366 | /* Stanton, ScratchAmp */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 367 | SND_BEBOB_DEV_ENTRY(VEN_STANTON, 0x00000001, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 368 | /* Tascam, IF-FW DM */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 369 | SND_BEBOB_DEV_ENTRY(VEN_TASCAM, 0x00010067, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 370 | /* Behringer, XENIX UFX 1204 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 371 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001204, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 372 | /* Behringer, XENIX UFX 1604 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 373 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00001604, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 374 | /* Behringer, Digital Mixer X32 series (X-UF Card) */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 375 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x00000006, &spec_normal), |
Takashi Sakamoto | cf8a471 | 2015-06-14 12:49:37 +0900 | [diff] [blame] | 376 | /* Behringer, F-Control Audio 1616 */ |
| 377 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x001616, &spec_normal), |
| 378 | /* Behringer, F-Control Audio 610 */ |
| 379 | SND_BEBOB_DEV_ENTRY(VEN_BEHRINGER, 0x000610, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 380 | /* Apogee Electronics, Rosetta 200/400 (X-FireWire card) */ |
| 381 | /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 382 | SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 383 | /* Apogee Electronics, Ensemble */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 384 | SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00001eee, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 385 | /* ESI, Quatafire610 */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 386 | SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 387 | /* AcousticReality, eARMasterOne */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 388 | SND_BEBOB_DEV_ENTRY(VEN_ACOUSTIC, 0x00000002, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 389 | /* CME, MatrixKFW */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 390 | SND_BEBOB_DEV_ENTRY(VEN_CME, 0x00030000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 391 | /* Phonic, Helix Board 12 MkII */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 392 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00050000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 393 | /* Phonic, Helix Board 18 MkII */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 394 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00060000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 395 | /* Phonic, Helix Board 24 MkII */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 396 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00070000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 397 | /* Phonic, Helix Board 12 Universal/18 Universal/24 Universal */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 398 | SND_BEBOB_DEV_ENTRY(VEN_PHONIC, 0x00000000, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 399 | /* Lynx, Aurora 8/16 (LT-FW) */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 400 | SND_BEBOB_DEV_ENTRY(VEN_LYNX, 0x00000001, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 401 | /* ICON, FireXon */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 402 | SND_BEBOB_DEV_ENTRY(VEN_ICON, 0x00000001, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 403 | /* PrismSound, Orpheus */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 404 | SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x00010048, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 405 | /* PrismSound, ADA-8XR */ |
Takashi Sakamoto | 1fc9522 | 2014-04-25 22:45:21 +0900 | [diff] [blame] | 406 | SND_BEBOB_DEV_ENTRY(VEN_PRISMSOUND, 0x0000ada8, &spec_normal), |
Takashi Sakamoto | 326b9ca | 2014-04-25 22:45:22 +0900 | [diff] [blame] | 407 | /* TerraTec Electronic GmbH, PHASE 88 Rack FW */ |
| 408 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000003, &phase88_rack_spec), |
| 409 | /* TerraTec Electronic GmbH, PHASE 24 FW */ |
| 410 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &phase24_series_spec), |
| 411 | /* TerraTec Electronic GmbH, Phase X24 FW */ |
| 412 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &phase24_series_spec), |
| 413 | /* TerraTec Electronic GmbH, EWS MIC2/MIC8 */ |
| 414 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000005, &spec_normal), |
| 415 | /* Terratec Electronic GmbH, Aureon 7.1 Firewire */ |
| 416 | SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000002, &spec_normal), |
Takashi Sakamoto | 8ac98a3 | 2014-04-25 22:45:23 +0900 | [diff] [blame] | 417 | /* Yamaha, GO44 */ |
| 418 | SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_go_spec), |
| 419 | /* YAMAHA, GO46 */ |
| 420 | SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_go_spec), |
Takashi Sakamoto | 25784ec | 2014-04-25 22:45:24 +0900 | [diff] [blame] | 421 | /* Focusrite, SaffirePro 26 I/O */ |
| 422 | SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec), |
| 423 | /* Focusrite, SaffirePro 10 I/O */ |
| 424 | SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000006, &saffirepro_10_spec), |
| 425 | /* Focusrite, Saffire(no label and LE) */ |
| 426 | SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH, |
| 427 | &saffire_spec), |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 428 | /* M-Audio, Firewire 410 */ |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 429 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010058, NULL), /* bootloader */ |
Takashi Sakamoto | 9076c22 | 2014-04-25 22:45:25 +0900 | [diff] [blame] | 430 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO2, 0x00010046, &maudio_fw410_spec), |
| 431 | /* M-Audio, Firewire Audiophile */ |
| 432 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_AUDIOPHILE_BOTH, |
| 433 | &maudio_audiophile_spec), |
| 434 | /* M-Audio, Firewire Solo */ |
| 435 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010062, &maudio_solo_spec), |
| 436 | /* M-Audio, Ozonic */ |
| 437 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x0000000a, &maudio_ozonic_spec), |
| 438 | /* M-Audio NRV10 */ |
| 439 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec), |
| 440 | /* M-Audio, ProFireLightbridge */ |
| 441 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal), |
Takashi Sakamoto | 3149ac4 | 2014-04-25 22:45:26 +0900 | [diff] [blame] | 442 | /* Firewire 1814 */ |
Takashi Sakamoto | a2b2a77 | 2014-04-25 22:45:29 +0900 | [diff] [blame] | 443 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL), /* bootloader */ |
Takashi Sakamoto | 3149ac4 | 2014-04-25 22:45:26 +0900 | [diff] [blame] | 444 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814, |
| 445 | &maudio_special_spec), |
| 446 | /* M-Audio ProjectMix */ |
| 447 | SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROJECTMIX, |
| 448 | &maudio_special_spec), |
Takashi Sakamoto | 146a5e3 | 2015-05-24 20:51:45 +0900 | [diff] [blame] | 449 | /* Digidesign Mbox 2 Pro */ |
| 450 | SND_BEBOB_DEV_ENTRY(VEN_DIGIDESIGN, 0x0000a9, &spec_normal), |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 451 | /* IDs are unknown but able to be supported */ |
| 452 | /* Apogee, Mini-ME Firewire */ |
| 453 | /* Apogee, Mini-DAC Firewire */ |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 454 | /* Cakawalk, Sonar Power Studio 66 */ |
| 455 | /* CME, UF400e */ |
| 456 | /* ESI, Quotafire XL */ |
| 457 | /* Infrasonic, DewX */ |
| 458 | /* Infrasonic, Windy6 */ |
| 459 | /* Mackie, Digital X Bus x.200 */ |
| 460 | /* Mackie, Digital X Bus x.400 */ |
| 461 | /* Phonic, HB 12 */ |
| 462 | /* Phonic, HB 24 */ |
| 463 | /* Phonic, HB 18 */ |
| 464 | /* Phonic, FireFly 202 */ |
| 465 | /* Phonic, FireFly 302 */ |
| 466 | /* Rolf Spuler, Firewire Guitar */ |
| 467 | {} |
| 468 | }; |
| 469 | MODULE_DEVICE_TABLE(ieee1394, bebob_id_table); |
| 470 | |
| 471 | static struct fw_driver bebob_driver = { |
| 472 | .driver = { |
| 473 | .owner = THIS_MODULE, |
| 474 | .name = "snd-bebob", |
| 475 | .bus = &fw_bus_type, |
| 476 | }, |
| 477 | .probe = bebob_probe, |
| 478 | .update = bebob_update, |
| 479 | .remove = bebob_remove, |
| 480 | .id_table = bebob_id_table, |
| 481 | }; |
| 482 | |
| 483 | static int __init |
| 484 | snd_bebob_init(void) |
| 485 | { |
| 486 | return driver_register(&bebob_driver.driver); |
| 487 | } |
| 488 | |
| 489 | static void __exit |
| 490 | snd_bebob_exit(void) |
| 491 | { |
| 492 | driver_unregister(&bebob_driver.driver); |
Takashi Sakamoto | fd6f4b0d | 2014-04-25 22:45:14 +0900 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | module_init(snd_bebob_init); |
| 496 | module_exit(snd_bebob_exit); |