Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 1 | /* |
| 2 | * TC Applied Technologies Digital Interface Communications Engine driver |
| 3 | * |
| 4 | * Copyright (c) Clemens Ladisch <clemens@ladisch.de> |
| 5 | * Licensed under the terms of the GNU General Public License, version 2. |
| 6 | */ |
| 7 | |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 8 | #include "dice.h" |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 9 | |
| 10 | MODULE_DESCRIPTION("DICE driver"); |
| 11 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 12 | MODULE_LICENSE("GPL v2"); |
| 13 | |
Clemens Ladisch | a471fcd | 2012-02-13 21:55:13 +0100 | [diff] [blame] | 14 | #define OUI_WEISS 0x001c6a |
Takashi Sakamoto | 5d5563b | 2015-11-14 16:42:04 +0900 | [diff] [blame] | 15 | #define OUI_LOUD 0x000ff2 |
Takashi Sakamoto | 7cafc65b | 2016-03-07 22:35:45 +0900 | [diff] [blame] | 16 | #define OUI_FOCUSRITE 0x00130e |
| 17 | #define OUI_TCELECTRONIC 0x001486 |
Clemens Ladisch | a471fcd | 2012-02-13 21:55:13 +0100 | [diff] [blame] | 18 | |
| 19 | #define DICE_CATEGORY_ID 0x04 |
| 20 | #define WEISS_CATEGORY_ID 0x00 |
Takashi Sakamoto | 5d5563b | 2015-11-14 16:42:04 +0900 | [diff] [blame] | 21 | #define LOUD_CATEGORY_ID 0x10 |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 22 | |
Takashi Sakamoto | 7cafc65b | 2016-03-07 22:35:45 +0900 | [diff] [blame] | 23 | /* |
| 24 | * Some models support several isochronous channels, while these streams are not |
| 25 | * always available. In this case, add the model name to this list. |
| 26 | */ |
| 27 | static bool force_two_pcm_support(struct fw_unit *unit) |
| 28 | { |
| 29 | const char *const models[] = { |
| 30 | /* TC Electronic models. */ |
| 31 | "StudioKonnekt48", |
| 32 | /* Focusrite models. */ |
| 33 | "SAFFIRE_PRO_40", |
| 34 | "LIQUID_SAFFIRE_56", |
| 35 | "SAFFIRE_PRO_40_1", |
| 36 | }; |
| 37 | char model[32]; |
| 38 | unsigned int i; |
| 39 | int err; |
| 40 | |
| 41 | err = fw_csr_string(unit->directory, CSR_MODEL, model, sizeof(model)); |
| 42 | if (err < 0) |
| 43 | return false; |
| 44 | |
| 45 | for (i = 0; i < ARRAY_SIZE(models); i++) { |
| 46 | if (strcmp(models[i], model) == 0) |
| 47 | break; |
| 48 | } |
| 49 | |
| 50 | return i < ARRAY_SIZE(models); |
| 51 | } |
| 52 | |
Takashi Sakamoto | 4a47a87 | 2015-12-31 13:58:11 +0900 | [diff] [blame] | 53 | static int check_dice_category(struct fw_unit *unit) |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 54 | { |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 55 | struct fw_device *device = fw_parent_device(unit); |
| 56 | struct fw_csr_iterator it; |
Takashi Sakamoto | 4a47a87 | 2015-12-31 13:58:11 +0900 | [diff] [blame] | 57 | int key, val, vendor = -1, model = -1; |
| 58 | unsigned int category; |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 59 | |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 60 | /* |
| 61 | * Check that GUID and unit directory are constructed according to DICE |
| 62 | * rules, i.e., that the specifier ID is the GUID's OUI, and that the |
Clemens Ladisch | a471fcd | 2012-02-13 21:55:13 +0100 | [diff] [blame] | 63 | * GUID chip ID consists of the 8-bit category ID, the 10-bit product |
| 64 | * ID, and a 22-bit serial number. |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 65 | */ |
| 66 | fw_csr_iterator_init(&it, unit->directory); |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 67 | while (fw_csr_iterator_next(&it, &key, &val)) { |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 68 | switch (key) { |
| 69 | case CSR_SPECIFIER_ID: |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 70 | vendor = val; |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 71 | break; |
| 72 | case CSR_MODEL: |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 73 | model = val; |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 74 | break; |
| 75 | } |
| 76 | } |
Takashi Sakamoto | 7cafc65b | 2016-03-07 22:35:45 +0900 | [diff] [blame] | 77 | |
| 78 | if (vendor == OUI_FOCUSRITE || vendor == OUI_TCELECTRONIC) { |
| 79 | if (force_two_pcm_support(unit)) |
| 80 | return 0; |
| 81 | } |
| 82 | |
Clemens Ladisch | a471fcd | 2012-02-13 21:55:13 +0100 | [diff] [blame] | 83 | if (vendor == OUI_WEISS) |
| 84 | category = WEISS_CATEGORY_ID; |
Takashi Sakamoto | 5d5563b | 2015-11-14 16:42:04 +0900 | [diff] [blame] | 85 | else if (vendor == OUI_LOUD) |
| 86 | category = LOUD_CATEGORY_ID; |
Clemens Ladisch | a471fcd | 2012-02-13 21:55:13 +0100 | [diff] [blame] | 87 | else |
| 88 | category = DICE_CATEGORY_ID; |
| 89 | if (device->config_rom[3] != ((vendor << 8) | category) || |
Takashi Sakamoto | 4a47a87 | 2015-12-31 13:58:11 +0900 | [diff] [blame] | 90 | device->config_rom[4] >> 22 != model) |
| 91 | return -ENODEV; |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 92 | |
Takashi Sakamoto | 4a47a87 | 2015-12-31 13:58:11 +0900 | [diff] [blame] | 93 | return 0; |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 94 | } |
| 95 | |
Takashi Sakamoto | 6f68826 | 2016-02-08 22:54:19 +0900 | [diff] [blame] | 96 | static int check_clock_caps(struct snd_dice *dice) |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 97 | { |
Clemens Ladisch | a030199 | 2011-12-04 21:47:00 +0100 | [diff] [blame] | 98 | __be32 value; |
Takashi Sakamoto | 6f68826 | 2016-02-08 22:54:19 +0900 | [diff] [blame] | 99 | int err; |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 100 | |
Clemens Ladisch | a030199 | 2011-12-04 21:47:00 +0100 | [diff] [blame] | 101 | /* some very old firmwares don't tell about their clock support */ |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 102 | if (dice->clock_caps > 0) { |
| 103 | err = snd_dice_transaction_read_global(dice, |
| 104 | GLOBAL_CLOCK_CAPABILITIES, |
| 105 | &value, 4); |
Clemens Ladisch | a030199 | 2011-12-04 21:47:00 +0100 | [diff] [blame] | 106 | if (err < 0) |
| 107 | return err; |
| 108 | dice->clock_caps = be32_to_cpu(value); |
| 109 | } else { |
| 110 | /* this should be supported by any device */ |
| 111 | dice->clock_caps = CLOCK_CAP_RATE_44100 | |
| 112 | CLOCK_CAP_RATE_48000 | |
| 113 | CLOCK_CAP_SOURCE_ARX1 | |
| 114 | CLOCK_CAP_SOURCE_INTERNAL; |
| 115 | } |
| 116 | |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 117 | return 0; |
| 118 | } |
| 119 | |
Takashi Sakamoto | 732d153 | 2014-11-29 00:59:11 +0900 | [diff] [blame] | 120 | static void dice_card_strings(struct snd_dice *dice) |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 121 | { |
| 122 | struct snd_card *card = dice->card; |
| 123 | struct fw_device *dev = fw_parent_device(dice->unit); |
| 124 | char vendor[32], model[32]; |
| 125 | unsigned int i; |
| 126 | int err; |
| 127 | |
| 128 | strcpy(card->driver, "DICE"); |
| 129 | |
| 130 | strcpy(card->shortname, "DICE"); |
| 131 | BUILD_BUG_ON(NICK_NAME_SIZE < sizeof(card->shortname)); |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 132 | err = snd_dice_transaction_read_global(dice, GLOBAL_NICK_NAME, |
| 133 | card->shortname, |
| 134 | sizeof(card->shortname)); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 135 | if (err >= 0) { |
| 136 | /* DICE strings are returned in "always-wrong" endianness */ |
| 137 | BUILD_BUG_ON(sizeof(card->shortname) % 4 != 0); |
| 138 | for (i = 0; i < sizeof(card->shortname); i += 4) |
| 139 | swab32s((u32 *)&card->shortname[i]); |
| 140 | card->shortname[sizeof(card->shortname) - 1] = '\0'; |
| 141 | } |
| 142 | |
| 143 | strcpy(vendor, "?"); |
| 144 | fw_csr_string(dev->config_rom + 5, CSR_VENDOR, vendor, sizeof(vendor)); |
| 145 | strcpy(model, "?"); |
| 146 | fw_csr_string(dice->unit->directory, CSR_MODEL, model, sizeof(model)); |
| 147 | snprintf(card->longname, sizeof(card->longname), |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 148 | "%s %s (serial %u) at %s, S%d", |
| 149 | vendor, model, dev->config_rom[4] & 0x3fffff, |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 150 | dev_name(&dice->unit->device), 100 << dev->max_speed); |
| 151 | |
| 152 | strcpy(card->mixername, "DICE"); |
| 153 | } |
| 154 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 155 | static void dice_free(struct snd_dice *dice) |
| 156 | { |
| 157 | snd_dice_stream_destroy_duplex(dice); |
| 158 | snd_dice_transaction_destroy(dice); |
| 159 | fw_unit_put(dice->unit); |
| 160 | |
| 161 | mutex_destroy(&dice->mutex); |
| 162 | kfree(dice); |
| 163 | } |
| 164 | |
Takashi Sakamoto | 12ed719 | 2015-02-21 23:54:57 +0900 | [diff] [blame] | 165 | /* |
| 166 | * This module releases the FireWire unit data after all ALSA character devices |
| 167 | * are released by applications. This is for releasing stream data or finishing |
| 168 | * transactions safely. Thus at returning from .remove(), this module still keep |
| 169 | * references for the unit. |
| 170 | */ |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 171 | static void dice_card_free(struct snd_card *card) |
| 172 | { |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 173 | dice_free(card->private_data); |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 174 | } |
| 175 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 176 | static void do_registration(struct work_struct *work) |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 177 | { |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 178 | struct snd_dice *dice = container_of(work, struct snd_dice, dwork.work); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 179 | int err; |
| 180 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 181 | if (dice->registered) |
| 182 | return; |
| 183 | |
| 184 | err = snd_card_new(&dice->unit->device, -1, NULL, THIS_MODULE, 0, |
| 185 | &dice->card); |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 186 | if (err < 0) |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 187 | return; |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 188 | |
Takashi Sakamoto | 7cafc65b | 2016-03-07 22:35:45 +0900 | [diff] [blame] | 189 | if (force_two_pcm_support(dice->unit)) |
| 190 | dice->force_two_pcms = true; |
| 191 | |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 192 | err = snd_dice_transaction_init(dice); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 193 | if (err < 0) |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 194 | goto error; |
Clemens Ladisch | 5ea4018 | 2011-12-05 22:09:42 +0100 | [diff] [blame] | 195 | |
Takashi Sakamoto | 6f68826 | 2016-02-08 22:54:19 +0900 | [diff] [blame] | 196 | err = check_clock_caps(dice); |
Clemens Ladisch | 5ea4018 | 2011-12-05 22:09:42 +0100 | [diff] [blame] | 197 | if (err < 0) |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 198 | goto error; |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 199 | |
| 200 | dice_card_strings(dice); |
| 201 | |
Takashi Sakamoto | 0eced45 | 2016-03-31 08:47:03 +0900 | [diff] [blame] | 202 | err = snd_dice_stream_init_duplex(dice); |
| 203 | if (err < 0) |
| 204 | goto error; |
| 205 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 206 | snd_dice_create_proc(dice); |
| 207 | |
Takashi Sakamoto | c50fb91 | 2014-11-29 00:59:15 +0900 | [diff] [blame] | 208 | err = snd_dice_create_pcm(dice); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 209 | if (err < 0) |
| 210 | goto error; |
| 211 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 212 | err = snd_dice_create_midi(dice); |
| 213 | if (err < 0) |
| 214 | goto error; |
| 215 | |
Takashi Sakamoto | 19af57b | 2014-11-29 00:59:16 +0900 | [diff] [blame] | 216 | err = snd_dice_create_hwdep(dice); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 217 | if (err < 0) |
| 218 | goto error; |
| 219 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 220 | err = snd_card_register(dice->card); |
Takashi Sakamoto | a113ff8 | 2014-12-09 00:10:39 +0900 | [diff] [blame] | 221 | if (err < 0) |
| 222 | goto error; |
| 223 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 224 | /* |
| 225 | * After registered, dice instance can be released corresponding to |
| 226 | * releasing the sound card instance. |
| 227 | */ |
| 228 | dice->card->private_free = dice_card_free; |
| 229 | dice->card->private_data = dice; |
| 230 | dice->registered = true; |
| 231 | |
| 232 | return; |
| 233 | error: |
Takashi Sakamoto | 0eced45 | 2016-03-31 08:47:03 +0900 | [diff] [blame] | 234 | snd_dice_stream_destroy_duplex(dice); |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 235 | snd_dice_transaction_destroy(dice); |
Takashi Sakamoto | 923f92e | 2016-03-31 08:47:04 +0900 | [diff] [blame] | 236 | snd_dice_stream_destroy_duplex(dice); |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 237 | snd_card_free(dice->card); |
| 238 | dev_info(&dice->unit->device, |
| 239 | "Sound card registration failed: %d\n", err); |
| 240 | } |
| 241 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 242 | static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) |
| 243 | { |
| 244 | struct snd_dice *dice; |
| 245 | int err; |
| 246 | |
| 247 | err = check_dice_category(unit); |
| 248 | if (err < 0) |
| 249 | return -ENODEV; |
| 250 | |
| 251 | /* Allocate this independent of sound card instance. */ |
| 252 | dice = kzalloc(sizeof(struct snd_dice), GFP_KERNEL); |
| 253 | if (dice == NULL) |
| 254 | return -ENOMEM; |
| 255 | |
| 256 | dice->unit = fw_unit_get(unit); |
| 257 | dev_set_drvdata(&unit->device, dice); |
| 258 | |
| 259 | spin_lock_init(&dice->lock); |
| 260 | mutex_init(&dice->mutex); |
| 261 | init_completion(&dice->clock_accepted); |
| 262 | init_waitqueue_head(&dice->hwdep_wait); |
| 263 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 264 | /* Allocate and register this sound card later. */ |
| 265 | INIT_DEFERRABLE_WORK(&dice->dwork, do_registration); |
Takashi Sakamoto | 923f92e | 2016-03-31 08:47:04 +0900 | [diff] [blame] | 266 | snd_fw_schedule_registration(unit, &dice->dwork); |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 267 | |
| 268 | return 0; |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | static void dice_remove(struct fw_unit *unit) |
| 272 | { |
Takashi Sakamoto | 732d153 | 2014-11-29 00:59:11 +0900 | [diff] [blame] | 273 | struct snd_dice *dice = dev_get_drvdata(&unit->device); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 274 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 275 | /* |
| 276 | * Confirm to stop the work for registration before the sound card is |
| 277 | * going to be released. The work is not scheduled again because bus |
| 278 | * reset handler is not called anymore. |
| 279 | */ |
| 280 | cancel_delayed_work_sync(&dice->dwork); |
| 281 | |
| 282 | if (dice->registered) { |
| 283 | /* No need to wait for releasing card object in this context. */ |
| 284 | snd_card_free_when_closed(dice->card); |
| 285 | } else { |
| 286 | /* Don't forget this case. */ |
| 287 | dice_free(dice); |
| 288 | } |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | static void dice_bus_reset(struct fw_unit *unit) |
| 292 | { |
Takashi Sakamoto | 732d153 | 2014-11-29 00:59:11 +0900 | [diff] [blame] | 293 | struct snd_dice *dice = dev_get_drvdata(&unit->device); |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 294 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 295 | /* Postpone a workqueue for deferred registration. */ |
| 296 | if (!dice->registered) |
Takashi Sakamoto | 923f92e | 2016-03-31 08:47:04 +0900 | [diff] [blame] | 297 | snd_fw_schedule_registration(unit, &dice->dwork); |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 298 | |
Takashi Sakamoto | 7c2d4c0c | 2014-11-29 00:59:13 +0900 | [diff] [blame] | 299 | /* The handler address register becomes initialized. */ |
| 300 | snd_dice_transaction_reinit(dice); |
| 301 | |
Takashi Sakamoto | b59fb19 | 2015-12-31 13:58:12 +0900 | [diff] [blame] | 302 | /* |
| 303 | * After registration, userspace can start packet streaming, then this |
| 304 | * code block works fine. |
| 305 | */ |
| 306 | if (dice->registered) { |
| 307 | mutex_lock(&dice->mutex); |
| 308 | snd_dice_stream_update_duplex(dice); |
| 309 | mutex_unlock(&dice->mutex); |
| 310 | } |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 311 | } |
| 312 | |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 313 | #define DICE_INTERFACE 0x000001 |
| 314 | |
| 315 | static const struct ieee1394_device_id dice_id_table[] = { |
| 316 | { |
Clemens Ladisch | cbab328 | 2011-09-04 22:16:02 +0200 | [diff] [blame] | 317 | .match_flags = IEEE1394_MATCH_VERSION, |
| 318 | .version = DICE_INTERFACE, |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 319 | }, |
Takashi Sakamoto | f8ff65b | 2016-04-30 22:06:46 +0900 | [diff] [blame] | 320 | /* M-Audio Profire 610/2626 has a different value in version field. */ |
| 321 | { |
| 322 | .match_flags = IEEE1394_MATCH_VENDOR_ID | |
| 323 | IEEE1394_MATCH_SPECIFIER_ID, |
| 324 | .vendor_id = 0x000d6c, |
| 325 | .specifier_id = 0x000d6c, |
| 326 | }, |
Clemens Ladisch | 82fbb4f | 2011-09-04 22:04:49 +0200 | [diff] [blame] | 327 | { } |
| 328 | }; |
| 329 | MODULE_DEVICE_TABLE(ieee1394, dice_id_table); |
| 330 | |
| 331 | static struct fw_driver dice_driver = { |
| 332 | .driver = { |
| 333 | .owner = THIS_MODULE, |
| 334 | .name = KBUILD_MODNAME, |
| 335 | .bus = &fw_bus_type, |
| 336 | }, |
| 337 | .probe = dice_probe, |
| 338 | .update = dice_bus_reset, |
| 339 | .remove = dice_remove, |
| 340 | .id_table = dice_id_table, |
| 341 | }; |
| 342 | |
| 343 | static int __init alsa_dice_init(void) |
| 344 | { |
| 345 | return driver_register(&dice_driver.driver); |
| 346 | } |
| 347 | |
| 348 | static void __exit alsa_dice_exit(void) |
| 349 | { |
| 350 | driver_unregister(&dice_driver.driver); |
| 351 | } |
| 352 | |
| 353 | module_init(alsa_dice_init); |
| 354 | module_exit(alsa_dice_exit); |