Commit 56135c0c authored by Junzhong Pan's avatar Junzhong Pan Committed by Greg Kroah-Hartman
Browse files

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: 010dc57c ("usb: gadget: uvc: fix interval_duration calculation")
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarJunzhong Pan <panjunzhong@linux.spacemit.com>
Reviewed-by: default avatarXu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260306-fix-uvc-interval-v1-1-9a2df6859859@linux.spacemit.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae4ff9de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ uvc_video_prep_requests(struct uvc_video *video)
		return;
	}

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