aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/endpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r--sound/usb/endpoint.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index e70a87e0d9fe..289f582c9130 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -471,6 +471,10 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
471 ep->syncinterval = 3; 471 ep->syncinterval = 3;
472 472
473 ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize); 473 ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize);
474
475 if (chip->usb_id == USB_ID(0x0644, 0x8038) /* TEAC UD-H01 */ &&
476 ep->syncmaxsize == 4)
477 ep->udh01_fb_quirk = 1;
474 } 478 }
475 479
476 list_add_tail(&ep->list, &chip->ep_list); 480 list_add_tail(&ep->list, &chip->ep_list);
@@ -1105,7 +1109,16 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
1105 if (f == 0) 1109 if (f == 0)
1106 return; 1110 return;
1107 1111
1108 if (unlikely(ep->freqshift == INT_MIN)) { 1112 if (unlikely(sender->udh01_fb_quirk)) {
1113 /*
1114 * The TEAC UD-H01 firmware sometimes changes the feedback value
1115 * by +/- 0x1.0000.
1116 */
1117 if (f < ep->freqn - 0x8000)
1118 f += 0x10000;
1119 else if (f > ep->freqn + 0x8000)
1120 f -= 0x10000;
1121 } else if (unlikely(ep->freqshift == INT_MIN)) {
1109 /* 1122 /*
1110 * The first time we see a feedback value, determine its format 1123 * The first time we see a feedback value, determine its format
1111 * by shifting it left or right until it matches the nominal 1124 * by shifting it left or right until it matches the nominal