Skip to content

Commit 56135c0

Browse files
rzbdzgregkh
authored andcommitted
usb: gadget: uvc: fix interval_duration calculation
To correctly convert bInterval as interval_duration: interval_duration = 2^(bInterval-1) * frame_interval Current code uses a wrong left shift operand, computing 2^bInterval instead of 2^(bInterval-1). Fixes: 010dc57 ("usb: gadget: uvc: fix interval_duration calculation") Cc: stable <stable@kernel.org> Signed-off-by: Junzhong Pan <panjunzhong@linux.spacemit.com> Reviewed-by: Xu Yang <xu.yang_2@nxp.com> Link: https://patch.msgid.link/20260306-fix-uvc-interval-v1-1-9a2df6859859@linux.spacemit.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ae4ff9d commit 56135c0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/gadget/function/uvc_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ uvc_video_prep_requests(struct uvc_video *video)
513513
return;
514514
}
515515

516-
interval_duration = 2 << (video->ep->desc->bInterval - 1);
516+
interval_duration = 1 << (video->ep->desc->bInterval - 1);
517517
if (cdev->gadget->speed < USB_SPEED_HIGH)
518518
interval_duration *= 10000;
519519
else

0 commit comments

Comments
 (0)