ALSA: bebob: fulfil device entries
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 11 Jun 2021 09:37:25 +0000 (18:37 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sat, 12 Jun 2021 07:32:59 +0000 (09:32 +0200)
Although unit directory in root directory of configuration ROM has the
same value (0x00a02d) for its specifier_id entry to express AV/C device,
it has two cases for the value (0x010001/0x014001) to version entry.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210611093730.78254-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob.c
sound/firewire/bebob/bebob.h

index 452317e..5ce25dd 100644 (file)
@@ -348,6 +348,22 @@ static const struct snd_bebob_spec spec_normal = {
        .meter  = NULL
 };
 
+#define SPECIFIER_1394TA       0x00a02d
+
+// The immediate entry for version in unit directory differs depending on models:
+//  * 0x010001
+//  * 0x014001
+#define SND_BEBOB_DEV_ENTRY(vendor, model, data) \
+{ \
+       .match_flags    = IEEE1394_MATCH_VENDOR_ID | \
+                         IEEE1394_MATCH_MODEL_ID | \
+                         IEEE1394_MATCH_SPECIFIER_ID, \
+       .vendor_id      = vendor, \
+       .model_id       = model, \
+       .specifier_id   = SPECIFIER_1394TA, \
+       .driver_data    = (kernel_ulong_t)data \
+}
+
 static const struct ieee1394_device_id bebob_id_table[] = {
        /* Edirol, FA-66 */
        SND_BEBOB_DEV_ENTRY(VEN_EDIROL, 0x00010049, &spec_normal),
@@ -425,19 +441,7 @@ static const struct ieee1394_device_id bebob_id_table[] = {
        /* Focusrite, SaffirePro 26 I/O */
        SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec),
        /* Focusrite, SaffirePro 10 I/O */
-       {
-               // The combination of vendor_id and model_id is the same as the
-               // same as the one of Liquid Saffire 56.
-               .match_flags    = IEEE1394_MATCH_VENDOR_ID |
-                                 IEEE1394_MATCH_MODEL_ID |
-                                 IEEE1394_MATCH_SPECIFIER_ID |
-                                 IEEE1394_MATCH_VERSION,
-               .vendor_id      = VEN_FOCUSRITE,
-               .model_id       = 0x000006,
-               .specifier_id   = 0x00a02d,
-               .version        = 0x010001,
-               .driver_data    = (kernel_ulong_t)&saffirepro_10_spec,
-       },
+       SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x000006, &saffirepro_10_spec),
        /* Focusrite, Saffire(no label and LE) */
        SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH,
                            &saffire_spec),
index dff8e25..c06579d 100644 (file)
@@ -253,13 +253,4 @@ extern const struct snd_bebob_spec maudio_special_spec;
 int snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814);
 int snd_bebob_maudio_load_firmware(struct fw_unit *unit);
 
-#define SND_BEBOB_DEV_ENTRY(vendor, model, data) \
-{ \
-       .match_flags    = IEEE1394_MATCH_VENDOR_ID | \
-                         IEEE1394_MATCH_MODEL_ID, \
-       .vendor_id      = vendor, \
-       .model_id       = model, \
-       .driver_data    = (kernel_ulong_t)data \
-}
-
 #endif