diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-12-08 10:10:45 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-10 04:48:30 -0500 |
commit | ec4dba5053e1109368fb80d1c0b88f2a9c971122 (patch) | |
tree | 6a5345a4fd9b4d78b1880cd2377ff0642eef1549 /sound | |
parent | f3699e2c77455a6cccc977b391c553f2c816f639 (diff) |
ALSA: oxfw: Add support for Behringer/Mackie devices
Some devices produced by Behringer/Mackie are based on OXFW970/971. This
commit adds support for them. Additionally, this commit changes the way to
name card with some information in config rom.
Ids of some Mackie(Loud) models are not identified, therefore this commit
applies name detection for these models.
The devices support capture/playback of PCM-samples and some of them
supports capture/playback of MIDI messages. These functionalities are
implemented by followed commits.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/firewire/Kconfig | 6 | ||||
-rw-r--r-- | sound/firewire/oxfw/oxfw.c | 91 |
2 files changed, 91 insertions, 6 deletions
diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig index 093286087bb0..6364e5b90a00 100644 --- a/sound/firewire/Kconfig +++ b/sound/firewire/Kconfig | |||
@@ -31,6 +31,12 @@ config SND_OXFW | |||
31 | Oxford Semiconductor FW970/971 chipset. | 31 | Oxford Semiconductor FW970/971 chipset. |
32 | * Griffin Firewave | 32 | * Griffin Firewave |
33 | * LaCie Firewire Speakers | 33 | * LaCie Firewire Speakers |
34 | * Behringer F-Control Audio 202 | ||
35 | * Mackie(Loud) Onyx-i series (former models) | ||
36 | * Mackie(Loud) Onyx Satellite | ||
37 | * Mackie(Loud) Tapco Link.Firewire | ||
38 | * Mackie(Loud) d.2 pro/d.4 pro | ||
39 | * Mackie(Loud) U.420/U.420d | ||
34 | 40 | ||
35 | To compile this driver as a module, choose M here: the module | 41 | To compile this driver as a module, choose M here: the module |
36 | will be called snd-oxfw. | 42 | will be called snd-oxfw. |
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index a70149ab511b..797af33c7bcb 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c | |||
@@ -14,7 +14,9 @@ | |||
14 | #define OXFORD_HARDWARE_ID_OXFW970 0x39443841 | 14 | #define OXFORD_HARDWARE_ID_OXFW970 0x39443841 |
15 | #define OXFORD_HARDWARE_ID_OXFW971 0x39373100 | 15 | #define OXFORD_HARDWARE_ID_OXFW971 0x39373100 |
16 | 16 | ||
17 | #define VENDOR_LOUD 0x000ff2 | ||
17 | #define VENDOR_GRIFFIN 0x001292 | 18 | #define VENDOR_GRIFFIN 0x001292 |
19 | #define VENDOR_BEHRINGER 0x001564 | ||
18 | #define VENDOR_LACIE 0x00d04b | 20 | #define VENDOR_LACIE 0x00d04b |
19 | 21 | ||
20 | #define SPECIFIER_1394TA 0x00a02d | 22 | #define SPECIFIER_1394TA 0x00a02d |
@@ -25,22 +27,69 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); | |||
25 | MODULE_LICENSE("GPL v2"); | 27 | MODULE_LICENSE("GPL v2"); |
26 | MODULE_ALIAS("snd-firewire-speakers"); | 28 | MODULE_ALIAS("snd-firewire-speakers"); |
27 | 29 | ||
30 | static bool detect_loud_models(struct fw_unit *unit) | ||
31 | { | ||
32 | const char *const models[] = { | ||
33 | "Onyxi", | ||
34 | "Onyx-i", | ||
35 | "d.Pro", | ||
36 | "Mackie Onyx Satellite", | ||
37 | "Tapco LINK.firewire 4x6", | ||
38 | "U.420"}; | ||
39 | char model[32]; | ||
40 | unsigned int i; | ||
41 | int err; | ||
42 | |||
43 | err = fw_csr_string(unit->directory, CSR_MODEL, | ||
44 | model, sizeof(model)); | ||
45 | if (err < 0) | ||
46 | return err; | ||
47 | |||
48 | for (i = 0; i < ARRAY_SIZE(models); i++) { | ||
49 | if (strcmp(models[i], model) == 0) | ||
50 | break; | ||
51 | } | ||
52 | |||
53 | return (i < ARRAY_SIZE(models)); | ||
54 | } | ||
55 | |||
28 | static int name_card(struct snd_oxfw *oxfw) | 56 | static int name_card(struct snd_oxfw *oxfw) |
29 | { | 57 | { |
30 | struct fw_device *fw_dev = fw_parent_device(oxfw->unit); | 58 | struct fw_device *fw_dev = fw_parent_device(oxfw->unit); |
59 | char vendor[24]; | ||
60 | char model[32]; | ||
31 | const char *d, *v, *m; | 61 | const char *d, *v, *m; |
32 | u32 firmware; | 62 | u32 firmware; |
33 | int err; | 63 | int err; |
34 | 64 | ||
65 | /* get vendor name from root directory */ | ||
66 | err = fw_csr_string(fw_dev->config_rom + 5, CSR_VENDOR, | ||
67 | vendor, sizeof(vendor)); | ||
68 | if (err < 0) | ||
69 | goto end; | ||
70 | |||
71 | /* get model name from unit directory */ | ||
72 | err = fw_csr_string(oxfw->unit->directory, CSR_MODEL, | ||
73 | model, sizeof(model)); | ||
74 | if (err < 0) | ||
75 | goto end; | ||
76 | |||
35 | err = snd_fw_transaction(oxfw->unit, TCODE_READ_QUADLET_REQUEST, | 77 | err = snd_fw_transaction(oxfw->unit, TCODE_READ_QUADLET_REQUEST, |
36 | OXFORD_FIRMWARE_ID_ADDRESS, &firmware, 4, 0); | 78 | OXFORD_FIRMWARE_ID_ADDRESS, &firmware, 4, 0); |
37 | if (err < 0) | 79 | if (err < 0) |
38 | goto end; | 80 | goto end; |
39 | be32_to_cpus(&firmware); | 81 | be32_to_cpus(&firmware); |
40 | 82 | ||
41 | d = oxfw->device_info->driver_name; | 83 | /* to apply card definitions */ |
42 | v = oxfw->device_info->vendor_name; | 84 | if (oxfw->device_info) { |
43 | m = oxfw->device_info->model_name; | 85 | d = oxfw->device_info->driver_name; |
86 | v = oxfw->device_info->vendor_name; | ||
87 | m = oxfw->device_info->model_name; | ||
88 | } else { | ||
89 | d = "OXFW"; | ||
90 | v = vendor; | ||
91 | m = model; | ||
92 | } | ||
44 | 93 | ||
45 | strcpy(oxfw->card->driver, d); | 94 | strcpy(oxfw->card->driver, d); |
46 | strcpy(oxfw->card->mixername, m); | 95 | strcpy(oxfw->card->mixername, m); |
@@ -73,6 +122,9 @@ static int oxfw_probe(struct fw_unit *unit, | |||
73 | struct snd_oxfw *oxfw; | 122 | struct snd_oxfw *oxfw; |
74 | int err; | 123 | int err; |
75 | 124 | ||
125 | if ((id->vendor_id == VENDOR_LOUD) && !detect_loud_models(unit)) | ||
126 | return -ENODEV; | ||
127 | |||
76 | err = snd_card_new(&unit->device, -1, NULL, THIS_MODULE, | 128 | err = snd_card_new(&unit->device, -1, NULL, THIS_MODULE, |
77 | sizeof(*oxfw), &card); | 129 | sizeof(*oxfw), &card); |
78 | if (err < 0) | 130 | if (err < 0) |
@@ -97,9 +149,11 @@ static int oxfw_probe(struct fw_unit *unit, | |||
97 | if (err < 0) | 149 | if (err < 0) |
98 | goto error; | 150 | goto error; |
99 | 151 | ||
100 | err = snd_oxfw_create_mixer(oxfw); | 152 | if (oxfw->device_info) { |
101 | if (err < 0) | 153 | err = snd_oxfw_create_mixer(oxfw); |
102 | goto error; | 154 | if (err < 0) |
155 | goto error; | ||
156 | } | ||
103 | 157 | ||
104 | snd_oxfw_proc_init(oxfw); | 158 | snd_oxfw_proc_init(oxfw); |
105 | 159 | ||
@@ -183,6 +237,31 @@ static const struct ieee1394_device_id oxfw_id_table[] = { | |||
183 | .version = VERSION_AVC, | 237 | .version = VERSION_AVC, |
184 | .driver_data = (kernel_ulong_t)&lacie_speakers, | 238 | .driver_data = (kernel_ulong_t)&lacie_speakers, |
185 | }, | 239 | }, |
240 | /* Behringer,F-Control Audio 202 */ | ||
241 | { | ||
242 | .match_flags = IEEE1394_MATCH_VENDOR_ID | | ||
243 | IEEE1394_MATCH_MODEL_ID, | ||
244 | .vendor_id = VENDOR_BEHRINGER, | ||
245 | .model_id = 0x00fc22, | ||
246 | }, | ||
247 | /* | ||
248 | * Any Mackie(Loud) models (name string/model id): | ||
249 | * Onyx-i series (former models): 0x081216 | ||
250 | * Mackie Onyx Satellite: 0x00200f | ||
251 | * Tapco LINK.firewire 4x6: 0x000460 | ||
252 | * d.2 pro: Unknown | ||
253 | * d.4 pro: Unknown | ||
254 | * U.420: Unknown | ||
255 | * U.420d: Unknown | ||
256 | */ | ||
257 | { | ||
258 | .match_flags = IEEE1394_MATCH_VENDOR_ID | | ||
259 | IEEE1394_MATCH_SPECIFIER_ID | | ||
260 | IEEE1394_MATCH_VERSION, | ||
261 | .vendor_id = VENDOR_LOUD, | ||
262 | .specifier_id = SPECIFIER_1394TA, | ||
263 | .version = VERSION_AVC, | ||
264 | }, | ||
186 | { } | 265 | { } |
187 | }; | 266 | }; |
188 | MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table); | 267 | MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table); |