diff options
author | John S. Gruber <JohnSGruber@gmail.com> | 2009-12-27 12:19:59 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-28 06:30:57 -0500 |
commit | 52a7a5835173af61b9f6c3038212370d9717526f (patch) | |
tree | 4417f296d3e5a115b7111a2ab5b288df32416169 | |
parent | 98e89f606c38a310a20342f90e0c453e6afadf18 (diff) |
ALSA: usb-audio: use usbquirk.h for detection of HVR-950Q/850
Detect the HVR-950Q HVR-850 urb data alignment quirk using usbquirk.h
rather than using a case statement in snd_usb_audio_probe.
Signed-off-by: John S. Gruber <JohnSGruber@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/usb/usbaudio.c | 30 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 1 | ||||
-rw-r--r-- | sound/usb/usbquirks.h | 114 |
3 files changed, 130 insertions, 15 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 617515f6ec7b..4ada98e16309 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -3203,6 +3203,18 @@ static int ignore_interface_quirk(struct snd_usb_audio *chip, | |||
3203 | return 0; | 3203 | return 0; |
3204 | } | 3204 | } |
3205 | 3205 | ||
3206 | /* | ||
3207 | * Allow alignment on audio sub-slot (channel samples) rather than | ||
3208 | * on audio slots (audio frames) | ||
3209 | */ | ||
3210 | static int create_align_transfer_quirk(struct snd_usb_audio *chip, | ||
3211 | struct usb_interface *iface, | ||
3212 | const struct snd_usb_audio_quirk *quirk) | ||
3213 | { | ||
3214 | chip->txfr_quirk = 1; | ||
3215 | return 1; /* Continue with creating streams and mixer */ | ||
3216 | } | ||
3217 | |||
3206 | 3218 | ||
3207 | /* | 3219 | /* |
3208 | * boot quirks | 3220 | * boot quirks |
@@ -3377,7 +3389,8 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip, | |||
3377 | [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, | 3389 | [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, |
3378 | [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, | 3390 | [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, |
3379 | [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk, | 3391 | [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk, |
3380 | [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk | 3392 | [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk, |
3393 | [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk | ||
3381 | }; | 3394 | }; |
3382 | 3395 | ||
3383 | if (quirk->type < QUIRK_TYPE_COUNT) { | 3396 | if (quirk->type < QUIRK_TYPE_COUNT) { |
@@ -3631,20 +3644,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3631 | } | 3644 | } |
3632 | } | 3645 | } |
3633 | 3646 | ||
3634 | switch (chip->usb_id) { | 3647 | chip->txfr_quirk = 0; |
3635 | case USB_ID(0x2040, 0x7200): /* Hauppage hvr950Q */ | ||
3636 | case USB_ID(0x2040, 0x7221): /* Hauppage hvr950Q */ | ||
3637 | case USB_ID(0x2040, 0x7222): /* Hauppage hvr950Q */ | ||
3638 | case USB_ID(0x2040, 0x7223): /* Hauppage hvr950Q */ | ||
3639 | case USB_ID(0x2040, 0x7224): /* Hauppage hvr950Q */ | ||
3640 | case USB_ID(0x2040, 0x7225): /* Hauppage hvr950Q */ | ||
3641 | case USB_ID(0x2040, 0x7230): /* Hauppage hvr850 */ | ||
3642 | case USB_ID(0x2040, 0x7250): /* Hauppage hvr950Q */ | ||
3643 | chip->txfr_quirk = 1; | ||
3644 | break; | ||
3645 | default: | ||
3646 | chip->txfr_quirk = 0; | ||
3647 | } | ||
3648 | err = 1; /* continue */ | 3648 | err = 1; /* continue */ |
3649 | if (quirk && quirk->ifnum != QUIRK_NO_INTERFACE) { | 3649 | if (quirk && quirk->ifnum != QUIRK_NO_INTERFACE) { |
3650 | /* need some special handlings */ | 3650 | /* need some special handlings */ |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index d180554b81f0..9d8cea48fc5f 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -161,6 +161,7 @@ enum quirk_type { | |||
161 | QUIRK_AUDIO_FIXED_ENDPOINT, | 161 | QUIRK_AUDIO_FIXED_ENDPOINT, |
162 | QUIRK_AUDIO_EDIROL_UA1000, | 162 | QUIRK_AUDIO_EDIROL_UA1000, |
163 | QUIRK_AUDIO_EDIROL_UAXX, | 163 | QUIRK_AUDIO_EDIROL_UAXX, |
164 | QUIRK_AUDIO_ALIGN_TRANSFER, | ||
164 | 165 | ||
165 | QUIRK_TYPE_COUNT | 166 | QUIRK_TYPE_COUNT |
166 | }; | 167 | }; |
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index bd6706c2d534..65bbd22f2e0c 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
@@ -2074,6 +2074,120 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2074 | } | 2074 | } |
2075 | }, | 2075 | }, |
2076 | 2076 | ||
2077 | /* Hauppauge HVR-950Q and HVR-850 */ | ||
2078 | { | ||
2079 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7200), | ||
2080 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2081 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2082 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2083 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2084 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2085 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2086 | .vendor_name = "Hauppauge", | ||
2087 | .product_name = "HVR-950Q", | ||
2088 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2089 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2090 | } | ||
2091 | }, | ||
2092 | { | ||
2093 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7201), | ||
2094 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2095 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2096 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2097 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2098 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2099 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2100 | .vendor_name = "Hauppauge", | ||
2101 | .product_name = "HVR-950Q", | ||
2102 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2103 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2104 | } | ||
2105 | }, | ||
2106 | { | ||
2107 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7202), | ||
2108 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2109 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2110 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2111 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2112 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2113 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2114 | .vendor_name = "Hauppauge", | ||
2115 | .product_name = "HVR-950Q", | ||
2116 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2117 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2118 | } | ||
2119 | }, | ||
2120 | { | ||
2121 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7203), | ||
2122 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2123 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2124 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2125 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2126 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2127 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2128 | .vendor_name = "Hauppauge", | ||
2129 | .product_name = "HVR-950Q", | ||
2130 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2131 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2132 | } | ||
2133 | }, | ||
2134 | { | ||
2135 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7204), | ||
2136 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2137 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2138 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2139 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2140 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2141 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2142 | .vendor_name = "Hauppauge", | ||
2143 | .product_name = "HVR-950Q", | ||
2144 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2145 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2146 | } | ||
2147 | }, | ||
2148 | { | ||
2149 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7205), | ||
2150 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2151 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2152 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2153 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2154 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2155 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2156 | .vendor_name = "Hauppauge", | ||
2157 | .product_name = "HVR-950Q", | ||
2158 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2159 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2160 | } | ||
2161 | }, | ||
2162 | { | ||
2163 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7250), | ||
2164 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2165 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2166 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2167 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2168 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2169 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2170 | .vendor_name = "Hauppauge", | ||
2171 | .product_name = "HVR-950Q", | ||
2172 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2173 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2174 | } | ||
2175 | }, | ||
2176 | { | ||
2177 | USB_DEVICE_VENDOR_SPEC(0x2040, 0x7230), | ||
2178 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | ||
2179 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
2180 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | ||
2181 | .bInterfaceClass = USB_CLASS_AUDIO, | ||
2182 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | ||
2183 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
2184 | .vendor_name = "Hauppauge", | ||
2185 | .product_name = "HVR-850", | ||
2186 | .ifnum = QUIRK_ANY_INTERFACE, | ||
2187 | .type = QUIRK_AUDIO_ALIGN_TRANSFER, | ||
2188 | } | ||
2189 | }, | ||
2190 | |||
2077 | { | 2191 | { |
2078 | /* | 2192 | /* |
2079 | * Some USB MIDI devices don't have an audio control interface, | 2193 | * Some USB MIDI devices don't have an audio control interface, |