blob: e629b88f7d933481a70cb72b6c504856c9a57d98 [file] [log] [blame]
Clemens Ladisch31ef9132011-03-15 07:53:21 +01001/*
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +09002 * oxfw.c - a part of driver for OXFW970/971 based devices
Clemens Ladisch31ef9132011-03-15 07:53:21 +01003 *
4 * Copyright (c) Clemens Ladisch <clemens@ladisch.de>
5 * Licensed under the terms of the GNU General Public License, version 2.
6 */
7
Takashi Sakamotoe2786ca2014-11-29 00:59:27 +09008#include "oxfw.h"
Clemens Ladisch31ef9132011-03-15 07:53:21 +01009
10#define OXFORD_FIRMWARE_ID_ADDRESS (CSR_REGISTER_BASE + 0x50000)
11/* 0x970?vvvv or 0x971?vvvv, where vvvv = firmware version */
12
13#define OXFORD_HARDWARE_ID_ADDRESS (CSR_REGISTER_BASE + 0x90020)
14#define OXFORD_HARDWARE_ID_OXFW970 0x39443841
15#define OXFORD_HARDWARE_ID_OXFW971 0x39373100
16
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090017#define VENDOR_LOUD 0x000ff2
Clemens Ladisch31ef9132011-03-15 07:53:21 +010018#define VENDOR_GRIFFIN 0x001292
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090019#define VENDOR_BEHRINGER 0x001564
Clemens Ladisch31ef9132011-03-15 07:53:21 +010020#define VENDOR_LACIE 0x00d04b
Takashi Sakamoto759a2f42015-10-18 17:09:40 +090021#define VENDOR_TASCAM 0x00022e
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +090022#define OUI_STANTON 0x001260
Clemens Ladisch31ef9132011-03-15 07:53:21 +010023
Takashi Sakamoto13f3a462015-09-20 21:18:55 +090024#define MODEL_SATELLITE 0x00200f
25
Clemens Ladisch31ef9132011-03-15 07:53:21 +010026#define SPECIFIER_1394TA 0x00a02d
27#define VERSION_AVC 0x010001
28
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +090029MODULE_DESCRIPTION("Oxford Semiconductor FW970/971 driver");
Clemens Ladisch31ef9132011-03-15 07:53:21 +010030MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
31MODULE_LICENSE("GPL v2");
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +090032MODULE_ALIAS("snd-firewire-speakers");
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +090033MODULE_ALIAS("snd-scs1x");
Clemens Ladisch31ef9132011-03-15 07:53:21 +010034
Takashi Sakamotod6ce6bb2015-12-16 20:37:57 +090035struct compat_info {
36 const char *driver_name;
37 const char *vendor_name;
38 const char *model_name;
39};
40
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090041static bool detect_loud_models(struct fw_unit *unit)
42{
43 const char *const models[] = {
44 "Onyxi",
45 "Onyx-i",
46 "d.Pro",
47 "Mackie Onyx Satellite",
48 "Tapco LINK.firewire 4x6",
49 "U.420"};
50 char model[32];
51 unsigned int i;
52 int err;
53
54 err = fw_csr_string(unit->directory, CSR_MODEL,
55 model, sizeof(model));
56 if (err < 0)
Dan Carpenter0d3aba32014-12-12 22:28:10 +030057 return false;
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090058
59 for (i = 0; i < ARRAY_SIZE(models); i++) {
60 if (strcmp(models[i], model) == 0)
61 break;
62 }
63
64 return (i < ARRAY_SIZE(models));
65}
66
Takashi Sakamotofec7b752014-12-09 00:10:40 +090067static int name_card(struct snd_oxfw *oxfw)
Clemens Ladisch31ef9132011-03-15 07:53:21 +010068{
Takashi Sakamotofec7b752014-12-09 00:10:40 +090069 struct fw_device *fw_dev = fw_parent_device(oxfw->unit);
Takashi Sakamotod6ce6bb2015-12-16 20:37:57 +090070 const struct compat_info *info;
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090071 char vendor[24];
72 char model[32];
Takashi Sakamotofec7b752014-12-09 00:10:40 +090073 const char *d, *v, *m;
74 u32 firmware;
Clemens Ladisch31ef9132011-03-15 07:53:21 +010075 int err;
76
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090077 /* 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(oxfw->unit->directory, CSR_MODEL,
85 model, sizeof(model));
86 if (err < 0)
87 goto end;
88
Takashi Sakamotofec7b752014-12-09 00:10:40 +090089 err = snd_fw_transaction(oxfw->unit, TCODE_READ_QUADLET_REQUEST,
90 OXFORD_FIRMWARE_ID_ADDRESS, &firmware, 4, 0);
91 if (err < 0)
92 goto end;
93 be32_to_cpus(&firmware);
94
Takashi Sakamotoec4dba52014-12-09 00:10:45 +090095 /* to apply card definitions */
Takashi Sakamoto27e66632015-12-15 23:56:20 +090096 if (oxfw->entry->vendor_id == VENDOR_GRIFFIN ||
97 oxfw->entry->vendor_id == VENDOR_LACIE) {
Takashi Sakamotod6ce6bb2015-12-16 20:37:57 +090098 info = (const struct compat_info *)oxfw->entry->driver_data;
Takashi Sakamoto27e66632015-12-15 23:56:20 +090099 d = info->driver_name;
100 v = info->vendor_name;
101 m = info->model_name;
Takashi Sakamotoec4dba52014-12-09 00:10:45 +0900102 } else {
103 d = "OXFW";
104 v = vendor;
105 m = model;
106 }
Takashi Sakamotofec7b752014-12-09 00:10:40 +0900107
108 strcpy(oxfw->card->driver, d);
109 strcpy(oxfw->card->mixername, m);
110 strcpy(oxfw->card->shortname, m);
111
112 snprintf(oxfw->card->longname, sizeof(oxfw->card->longname),
113 "%s %s (OXFW%x %04x), GUID %08x%08x at %s, S%d",
114 v, m, firmware >> 20, firmware & 0xffff,
115 fw_dev->config_rom[3], fw_dev->config_rom[4],
116 dev_name(&oxfw->unit->device), 100 << fw_dev->max_speed);
117end:
118 return err;
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100119}
120
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900121static void oxfw_free(struct snd_oxfw *oxfw)
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100122{
Takashi Sakamoto5cd1d3f2014-12-09 00:10:42 +0900123 unsigned int i;
124
Takashi Sakamotodec84312015-02-21 23:55:00 +0900125 snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream);
126 if (oxfw->has_output)
127 snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
128
Takashi Sakamoto12ed7192015-02-21 23:54:57 +0900129 fw_unit_put(oxfw->unit);
130
Takashi Sakamotob0ac0002014-12-09 00:10:46 +0900131 for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) {
132 kfree(oxfw->tx_stream_formats[i]);
Takashi Sakamoto5cd1d3f2014-12-09 00:10:42 +0900133 kfree(oxfw->rx_stream_formats[i]);
Takashi Sakamotob0ac0002014-12-09 00:10:46 +0900134 }
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100135
Takashi Sakamotoc582cc62015-12-16 20:37:54 +0900136 kfree(oxfw->spec);
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900137 mutex_destroy(&oxfw->mutex);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100138}
139
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900140/*
141 * This module releases the FireWire unit data after all ALSA character devices
142 * are released by applications. This is for releasing stream data or finishing
143 * transactions safely. Thus at returning from .remove(), this module still keep
144 * references for the unit.
145 */
146static void oxfw_card_free(struct snd_card *card)
147{
148 oxfw_free(card->private_data);
149}
150
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900151static int detect_quirks(struct snd_oxfw *oxfw)
Takashi Sakamoto13f3a462015-09-20 21:18:55 +0900152{
153 struct fw_device *fw_dev = fw_parent_device(oxfw->unit);
154 struct fw_csr_iterator it;
155 int key, val;
156 int vendor, model;
157
Takashi Sakamoto27e66632015-12-15 23:56:20 +0900158 /*
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900159 * Add ALSA control elements for two models to keep compatibility to
160 * old firewire-speaker module.
161 */
Takashi Sakamoto3e2f4572015-12-16 20:37:56 +0900162 if (oxfw->entry->vendor_id == VENDOR_GRIFFIN)
163 return snd_oxfw_add_spkr(oxfw, false);
164 if (oxfw->entry->vendor_id == VENDOR_LACIE)
165 return snd_oxfw_add_spkr(oxfw, true);
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900166
167 /*
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +0900168 * Stanton models supports asynchronous transactions for unique MIDI
169 * messages.
170 */
Takashi Sakamotode5126c2015-12-22 09:15:46 +0900171 if (oxfw->entry->vendor_id == OUI_STANTON) {
172 /* No physical MIDI ports. */
173 oxfw->midi_input_ports = 0;
174 oxfw->midi_output_ports = 0;
175
176 /* Output stream exists but no data channels are useful. */
177 oxfw->has_output = false;
178
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +0900179 return snd_oxfw_scs1x_add(oxfw);
Takashi Sakamotode5126c2015-12-22 09:15:46 +0900180 }
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +0900181
182 /*
Takashi Sakamoto27e66632015-12-15 23:56:20 +0900183 * TASCAM FireOne has physical control and requires a pair of additional
184 * MIDI ports.
185 */
186 if (oxfw->entry->vendor_id == VENDOR_TASCAM) {
187 oxfw->midi_input_ports++;
188 oxfw->midi_output_ports++;
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900189 return 0;
Takashi Sakamoto27e66632015-12-15 23:56:20 +0900190 }
191
Takashi Sakamoto13f3a462015-09-20 21:18:55 +0900192 /* Seek from Root Directory of Config ROM. */
193 vendor = model = 0;
194 fw_csr_iterator_init(&it, fw_dev->config_rom + 5);
195 while (fw_csr_iterator_next(&it, &key, &val)) {
196 if (key == CSR_VENDOR)
197 vendor = val;
198 else if (key == CSR_MODEL)
199 model = val;
200 }
201
202 /*
203 * Mackie Onyx Satellite with base station has a quirk to report a wrong
204 * value in 'dbs' field of CIP header against its format information.
205 */
206 if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE)
207 oxfw->wrong_dbs = true;
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900208
209 return 0;
Takashi Sakamoto13f3a462015-09-20 21:18:55 +0900210}
211
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900212static void do_registration(struct work_struct *work)
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100213{
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900214 struct snd_oxfw *oxfw = container_of(work, struct snd_oxfw, dwork.work);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100215 int err;
216
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900217 if (oxfw->registered)
218 return;
Takashi Sakamotoec4dba52014-12-09 00:10:45 +0900219
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900220 err = snd_card_new(&oxfw->unit->device, -1, NULL, THIS_MODULE, 0,
221 &oxfw->card);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100222 if (err < 0)
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900223 return;
Takashi Sakamoto5cd1d3f2014-12-09 00:10:42 +0900224
Takashi Sakamoto3f471522015-12-22 09:15:39 +0900225 err = name_card(oxfw);
Takashi Sakamoto5ce8cc42015-12-15 23:56:21 +0900226 if (err < 0)
227 goto error;
Takashi Sakamoto13f3a462015-09-20 21:18:55 +0900228
Takashi Sakamoto3f471522015-12-22 09:15:39 +0900229 err = detect_quirks(oxfw);
Takashi Sakamotofec7b752014-12-09 00:10:40 +0900230 if (err < 0)
231 goto error;
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100232
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900233 err = snd_oxfw_stream_discover(oxfw);
234 if (err < 0)
235 goto error;
236
237 err = snd_oxfw_stream_init_simplex(oxfw, &oxfw->rx_stream);
238 if (err < 0)
239 goto error;
240 if (oxfw->has_output) {
241 err = snd_oxfw_stream_init_simplex(oxfw, &oxfw->tx_stream);
242 if (err < 0)
243 goto error;
244 }
245
Takashi Sakamoto3713d932014-11-29 00:59:28 +0900246 err = snd_oxfw_create_pcm(oxfw);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100247 if (err < 0)
248 goto error;
249
Takashi Sakamoto3c961012014-12-09 00:10:43 +0900250 snd_oxfw_proc_init(oxfw);
251
Takashi Sakamoto05588d32014-12-09 00:10:48 +0900252 err = snd_oxfw_create_midi(oxfw);
253 if (err < 0)
254 goto error;
255
Takashi Sakamoto8985f4a2014-12-09 00:10:49 +0900256 err = snd_oxfw_create_hwdep(oxfw);
257 if (err < 0)
258 goto error;
259
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900260 err = snd_card_register(oxfw->card);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100261 if (err < 0)
262 goto error;
263
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900264 /*
265 * After registered, oxfw instance can be released corresponding to
266 * releasing the sound card instance.
267 */
268 oxfw->card->private_free = oxfw_card_free;
269 oxfw->card->private_data = oxfw;
270 oxfw->registered = true;
271
272 return;
273error:
274 snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream);
275 if (oxfw->has_output)
276 snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
277 snd_card_free(oxfw->card);
278 dev_info(&oxfw->unit->device,
279 "Sound card registration failed: %d\n", err);
280}
281
282static int oxfw_probe(struct fw_unit *unit,
283 const struct ieee1394_device_id *entry)
284{
285 struct snd_oxfw *oxfw;
286
287 if (entry->vendor_id == VENDOR_LOUD && !detect_loud_models(unit))
288 return -ENODEV;
289
290 /* Allocate this independent of sound card instance. */
291 oxfw = kzalloc(sizeof(struct snd_oxfw), GFP_KERNEL);
292 if (oxfw == NULL)
293 return -ENOMEM;
294
295 oxfw->entry = entry;
296 oxfw->unit = fw_unit_get(unit);
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900297 dev_set_drvdata(&unit->device, oxfw);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100298
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900299 mutex_init(&oxfw->mutex);
300 spin_lock_init(&oxfw->lock);
301 init_waitqueue_head(&oxfw->hwdep_wait);
302
303 /* Allocate and register this sound card later. */
304 INIT_DEFERRABLE_WORK(&oxfw->dwork, do_registration);
305 snd_fw_schedule_registration(unit, &oxfw->dwork);
306
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100307 return 0;
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100308}
309
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900310static void oxfw_bus_reset(struct fw_unit *unit)
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100311{
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900312 struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100313
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900314 if (!oxfw->registered)
315 snd_fw_schedule_registration(unit, &oxfw->dwork);
316
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900317 fcp_bus_reset(oxfw->unit);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100318
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900319 if (oxfw->registered) {
320 mutex_lock(&oxfw->mutex);
Takashi Sakamotob0ac0002014-12-09 00:10:46 +0900321
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900322 snd_oxfw_stream_update_simplex(oxfw, &oxfw->rx_stream);
323 if (oxfw->has_output)
324 snd_oxfw_stream_update_simplex(oxfw, &oxfw->tx_stream);
Takashi Sakamotob0ac0002014-12-09 00:10:46 +0900325
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900326 mutex_unlock(&oxfw->mutex);
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +0900327
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900328 if (oxfw->entry->vendor_id == OUI_STANTON)
329 snd_oxfw_scs1x_update(oxfw);
330 }
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100331}
332
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900333static void oxfw_remove(struct fw_unit *unit)
Stefan Richter94a87152013-06-09 18:15:00 +0200334{
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900335 struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device);
Stefan Richter94a87152013-06-09 18:15:00 +0200336
Takashi Sakamoto6c292302016-03-31 08:47:07 +0900337 /*
338 * Confirm to stop the work for registration before the sound card is
339 * going to be released. The work is not scheduled again because bus
340 * reset handler is not called anymore.
341 */
342 cancel_delayed_work_sync(&oxfw->dwork);
343
344 if (oxfw->registered) {
345 /* No need to wait for releasing card object in this context. */
346 snd_card_free_when_closed(oxfw->card);
347 } else {
348 /* Don't forget this case. */
349 oxfw_free(oxfw);
350 }
Stefan Richter94a87152013-06-09 18:15:00 +0200351}
352
Takashi Sakamotod6ce6bb2015-12-16 20:37:57 +0900353static const struct compat_info griffin_firewave = {
Stefan Richter94a87152013-06-09 18:15:00 +0200354 .driver_name = "FireWave",
Takashi Sakamotofec7b752014-12-09 00:10:40 +0900355 .vendor_name = "Griffin",
356 .model_name = "FireWave",
Stefan Richter94a87152013-06-09 18:15:00 +0200357};
358
Takashi Sakamotod6ce6bb2015-12-16 20:37:57 +0900359static const struct compat_info lacie_speakers = {
Stefan Richter94a87152013-06-09 18:15:00 +0200360 .driver_name = "FWSpeakers",
Takashi Sakamotofec7b752014-12-09 00:10:40 +0900361 .vendor_name = "LaCie",
362 .model_name = "FireWire Speakers",
Stefan Richter94a87152013-06-09 18:15:00 +0200363};
364
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900365static const struct ieee1394_device_id oxfw_id_table[] = {
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100366 {
367 .match_flags = IEEE1394_MATCH_VENDOR_ID |
368 IEEE1394_MATCH_MODEL_ID |
369 IEEE1394_MATCH_SPECIFIER_ID |
370 IEEE1394_MATCH_VERSION,
371 .vendor_id = VENDOR_GRIFFIN,
372 .model_id = 0x00f970,
373 .specifier_id = SPECIFIER_1394TA,
374 .version = VERSION_AVC,
Stefan Richter94a87152013-06-09 18:15:00 +0200375 .driver_data = (kernel_ulong_t)&griffin_firewave,
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100376 },
377 {
378 .match_flags = IEEE1394_MATCH_VENDOR_ID |
379 IEEE1394_MATCH_MODEL_ID |
380 IEEE1394_MATCH_SPECIFIER_ID |
381 IEEE1394_MATCH_VERSION,
382 .vendor_id = VENDOR_LACIE,
383 .model_id = 0x00f970,
384 .specifier_id = SPECIFIER_1394TA,
385 .version = VERSION_AVC,
Stefan Richter94a87152013-06-09 18:15:00 +0200386 .driver_data = (kernel_ulong_t)&lacie_speakers,
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100387 },
Takashi Sakamotoec4dba52014-12-09 00:10:45 +0900388 /* Behringer,F-Control Audio 202 */
389 {
390 .match_flags = IEEE1394_MATCH_VENDOR_ID |
391 IEEE1394_MATCH_MODEL_ID,
392 .vendor_id = VENDOR_BEHRINGER,
393 .model_id = 0x00fc22,
394 },
395 /*
396 * Any Mackie(Loud) models (name string/model id):
397 * Onyx-i series (former models): 0x081216
398 * Mackie Onyx Satellite: 0x00200f
399 * Tapco LINK.firewire 4x6: 0x000460
400 * d.2 pro: Unknown
401 * d.4 pro: Unknown
402 * U.420: Unknown
403 * U.420d: Unknown
404 */
405 {
406 .match_flags = IEEE1394_MATCH_VENDOR_ID |
407 IEEE1394_MATCH_SPECIFIER_ID |
408 IEEE1394_MATCH_VERSION,
409 .vendor_id = VENDOR_LOUD,
410 .specifier_id = SPECIFIER_1394TA,
411 .version = VERSION_AVC,
412 },
Takashi Sakamoto759a2f42015-10-18 17:09:40 +0900413 /* TASCAM, FireOne */
414 {
415 .match_flags = IEEE1394_MATCH_VENDOR_ID |
416 IEEE1394_MATCH_MODEL_ID,
417 .vendor_id = VENDOR_TASCAM,
418 .model_id = 0x800007,
419 },
Takashi Sakamoto9e2004f2015-12-22 09:15:45 +0900420 /* Stanton, Stanton Controllers & Systems 1 Mixer (SCS.1m) */
421 {
422 .match_flags = IEEE1394_MATCH_VENDOR_ID |
423 IEEE1394_MATCH_MODEL_ID,
424 .vendor_id = OUI_STANTON,
425 .model_id = 0x001000,
426 },
427 /* Stanton, Stanton Controllers & Systems 1 Deck (SCS.1d) */
428 {
429 .match_flags = IEEE1394_MATCH_VENDOR_ID |
430 IEEE1394_MATCH_MODEL_ID,
431 .vendor_id = OUI_STANTON,
432 .model_id = 0x002000,
433 },
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100434 { }
435};
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900436MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100437
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900438static struct fw_driver oxfw_driver = {
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100439 .driver = {
440 .owner = THIS_MODULE,
441 .name = KBUILD_MODNAME,
442 .bus = &fw_bus_type,
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100443 },
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900444 .probe = oxfw_probe,
445 .update = oxfw_bus_reset,
446 .remove = oxfw_remove,
447 .id_table = oxfw_id_table,
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100448};
449
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900450static int __init snd_oxfw_init(void)
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100451{
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900452 return driver_register(&oxfw_driver.driver);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100453}
454
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900455static void __exit snd_oxfw_exit(void)
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100456{
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900457 driver_unregister(&oxfw_driver.driver);
Clemens Ladisch31ef9132011-03-15 07:53:21 +0100458}
459
Takashi Sakamoto8832c5a2014-11-29 00:59:25 +0900460module_init(snd_oxfw_init);
461module_exit(snd_oxfw_exit);