On Mon, Jul 21, 2014 at 10:33:31PM -0400, James Michels wrote: > From: James P Michels III <james.p.michels@xxxxxxxxx> > > 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-16 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-16 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-16 range. > > Applies to 3.16-rc5 > > Signed-off-by: James P Michels III <james.p.michels@xxxxxxxxx> > > --- > > drivers/usb/core/config.c | 38 ++++++++++++++++++++++++++++++++++++++ > drivers/usb/core/quirks.c | 4 ++++ > include/linux/usb/quirks.h | 13 +++++++++++++ > 3 files changed, 55 insertions(+) > > diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c > index 1ab4df1..4f71708 100644 > --- a/drivers/usb/core/config.c > +++ b/drivers/usb/core/config.c > @@ -228,6 +228,44 @@ 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); > +/* checkpatch warns about this message even though this > + * format is used extensively in this file. I replaced it > + * so the patch-bot wouldn't automatically reject the patch. > + * > + * dev_warn(ddev, "config %d interface %d altsetting %d " All the tabs got eaten by your email client, making this patch impossible to apply :( Take a look at Documentation/email_clients.txt for how to fix this up. 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