diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-02-13 15:55:13 -0500 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2013-10-20 16:07:57 -0400 |
commit | a471fcde8c2c4b65f110bb4210af3513ee4deeb8 (patch) | |
tree | fd68de6d1b36491413cbd89eabf47b77823a4041 /sound/firewire/dice.c | |
parent | ed7e48264cfd3b000ab8dd100e6aa4c1447dd93a (diff) |
ALSA: dice: fix detection of Weiss devices
While most DICE devices keep TCAT's default category ID of 0x04, Weiss
devices identify themselves with 0x00.
Reported-by: Rolf Anderegg <rolf.anderegg@weiss.ch>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/firewire/dice.c')
-rw-r--r-- | sound/firewire/dice.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/firewire/dice.c b/sound/firewire/dice.c index 5f0f102cf5f9..49d630ba2d9f 100644 --- a/sound/firewire/dice.c +++ b/sound/firewire/dice.c | |||
@@ -1109,7 +1109,10 @@ static void dice_card_free(struct snd_card *card) | |||
1109 | mutex_destroy(&dice->mutex); | 1109 | mutex_destroy(&dice->mutex); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | #define DICE_CATEGORY_ID 0x04 | 1112 | #define OUI_WEISS 0x001c6a |
1113 | |||
1114 | #define DICE_CATEGORY_ID 0x04 | ||
1115 | #define WEISS_CATEGORY_ID 0x00 | ||
1113 | 1116 | ||
1114 | static int dice_interface_check(struct fw_unit *unit) | 1117 | static int dice_interface_check(struct fw_unit *unit) |
1115 | { | 1118 | { |
@@ -1123,15 +1126,15 @@ static int dice_interface_check(struct fw_unit *unit) | |||
1123 | struct fw_device *device = fw_parent_device(unit); | 1126 | struct fw_device *device = fw_parent_device(unit); |
1124 | struct fw_csr_iterator it; | 1127 | struct fw_csr_iterator it; |
1125 | int key, value, vendor = -1, model = -1, err; | 1128 | int key, value, vendor = -1, model = -1, err; |
1126 | unsigned int i; | 1129 | unsigned int category, i; |
1127 | __be32 pointers[ARRAY_SIZE(min_values)]; | 1130 | __be32 pointers[ARRAY_SIZE(min_values)]; |
1128 | __be32 version; | 1131 | __be32 version; |
1129 | 1132 | ||
1130 | /* | 1133 | /* |
1131 | * Check that GUID and unit directory are constructed according to DICE | 1134 | * Check that GUID and unit directory are constructed according to DICE |
1132 | * rules, i.e., that the specifier ID is the GUID's OUI, and that the | 1135 | * rules, i.e., that the specifier ID is the GUID's OUI, and that the |
1133 | * GUID chip ID consists of the 8-bit DICE category ID, the 10-bit | 1136 | * GUID chip ID consists of the 8-bit category ID, the 10-bit product |
1134 | * product ID, and a 22-bit serial number. | 1137 | * ID, and a 22-bit serial number. |
1135 | */ | 1138 | */ |
1136 | fw_csr_iterator_init(&it, unit->directory); | 1139 | fw_csr_iterator_init(&it, unit->directory); |
1137 | while (fw_csr_iterator_next(&it, &key, &value)) { | 1140 | while (fw_csr_iterator_next(&it, &key, &value)) { |
@@ -1144,7 +1147,11 @@ static int dice_interface_check(struct fw_unit *unit) | |||
1144 | break; | 1147 | break; |
1145 | } | 1148 | } |
1146 | } | 1149 | } |
1147 | if (device->config_rom[3] != ((vendor << 8) | DICE_CATEGORY_ID) || | 1150 | if (vendor == OUI_WEISS) |
1151 | category = WEISS_CATEGORY_ID; | ||
1152 | else | ||
1153 | category = DICE_CATEGORY_ID; | ||
1154 | if (device->config_rom[3] != ((vendor << 8) | category) || | ||
1148 | device->config_rom[4] >> 22 != model) | 1155 | device->config_rom[4] >> 22 != model) |
1149 | return -ENODEV; | 1156 | return -ENODEV; |
1150 | 1157 | ||