On Sat, 26 Jul 2014, James P Michels III wrote: > This patch adds a usb quirk to support devices with interupt endpoints > and bInterval values expressed as microframes. The quirk causes the > parse endpoint function to modify the reported bInterval to a standards > conforming value. > > There is currently code in the endpoint parser that checks for > bIntervals that are outside of the valid range (1-16 for USB 2+ high > speed and super speed interupt endpoints). In this case, the code assumes > the bInterval is being reported in 1ms frames. As well, the correction > is only applied if the original bInterval value is out of the 1-16 range. > > With this quirk applied to the device, the bInterval will be > accurately adjusted from microframes to an exponent. > > Signed-off-by: James P Michels III <james.p.michels@xxxxxxxxx> The closing brace for the "if" statement is still in the wrong column (it's supposed to line up with the 'i' in "if"), but aside from that: Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> > --- a/drivers/usb/core/config.c > +++ b/drivers/usb/core/config.c > @@ -199,6 +199,17 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, > if (n == 0) > n = 9; /* 32 ms = 2^(9-1) uframes */ > j = 16; > + > + /* > + * Adjust bInterval for quirked devices. > + * This quirk fixes bIntervals reported in > + * linear microframes. > + */ > + if (to_usb_device(ddev)->quirks & > + USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL) { > + n = clamp(fls(d->bInterval), i, j); > + i = j = n; > + } -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html