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