On Tue, Jul 22, 2014 at 08:02:10PM -0400, James P Michels III wrote: > This patch adds usb quirks to improve support for devices > with non standard bInterval values. Quirks are added to support devices with > bInterval values expressed as microframes or frames. The quirks cause the > parse endpoint function to modify the reported bInterval to the standards > conforming value. > > There is currently code in the endpoint parser that checks for bIntervals that are outside > of the valid range (0-15 for USB 2+). In this case, the code assumes the bInterval is being > reported in 1ms frames. However, the correction is only applied if the original bInterval > value is out of the 0-15 range. > > With one of these quirks applied to the device, the bInterval will be accurately adjusted > even when the misreported bInterval is in the 0-15 range. > > Signed-off-by: James P Michels III <james.p.michels@xxxxxxxxx> > --- > drivers/usb/core/config.c | 20 ++++++++++++++++++++ > drivers/usb/core/quirks.c | 4 ++++ > include/linux/usb/quirks.h | 13 +++++++++++++ > 3 files changed, 37 insertions(+) > > diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c > index 1ab4df1..1b343fe 100644 > --- a/drivers/usb/core/config.c > +++ b/drivers/usb/core/config.c > @@ -228,6 +228,26 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, > endpoint->desc.bInterval = n; > } > > + /* Adjust bInterval reported as frames for quirked devices */ > + if (to_usb_device(ddev)->quirks & USB_QUIRK_INTERVAL_AS_FRAMES) { > + endpoint->desc.bInterval = fls(d->bInterval * 8); > + if (endpoint->desc.bInterval > 16) > + endpoint->desc.bInterval = 16; > + dev_warn(ddev, "bInterval adjusted from %d to %d\n", > + d->bInterval, > + endpoint->desc.bInterval); > + } But you don't add a device that uses this quirk, so why add it at all in this patch? We don't add quirks that no one actually uses :) thanks, greg k-h -- 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