usb: gadget: uvc: configfs: Sort frame intervals upon writing
authorPaul Elder <paul.elder@ideasonboard.com>
Sun, 2 Sep 2018 23:46:03 +0000 (19:46 -0400)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 24 Sep 2018 16:06:53 +0000 (19:06 +0300)
commit89969a842e72b1b653140a4bbddd927b242736d0
tree779b569b1fe0b4819700a8e930ab6338b4c29bbf
parentcb2200f7af8341aaf0c6abd7ba37e4c667c41639
usb: gadget: uvc: configfs: Sort frame intervals upon writing

There is an issue where the host is unable to tell the gadget what frame
rate it wants if the dwFrameIntervals in the interface descriptors are
not in ascending order. This means that when instantiating a uvc gadget
via configfs the user must make sure the dwFrameIntervals are in
ascending order.

Instead of silently failing the breaking of this rule, we sort the
dwFrameIntervals upon writing to configfs.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/usb/gadget/function/uvc_configfs.c