]> git.ipfire.org Git - thirdparty/linux.git/commit
usb: gadget: uvc: fix interval_duration calculation
authorXu Yang <xu.yang_2@nxp.com>
Tue, 13 Jan 2026 09:53:08 +0000 (17:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jan 2026 15:03:17 +0000 (16:03 +0100)
commit010dc57cb5163e5f4a32430dd5091cc29efd0471
tree5ecb4e99eb343c032bdceaee94b03462c2f87c3d
parent2edc1acb1a2512843425aa19d0c6060a0a924605
usb: gadget: uvc: fix interval_duration calculation

According to USB specification:

  For full-/high-speed isochronous endpoints, the bInterval value is
  used as the exponent for a 2^(bInterval-1) value.

To correctly convert bInterval as interval_duration:
  interval_duration = 2^(bInterval-1) * frame_interval

Because the unit of video->interval is 100ns, add a comment info to
make it clear.

Fixes: 48dbe731171e ("usb: gadget: uvc: set req_size and n_requests based on the frame interval")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260113-uvc-gadget-fix-patch-v2-2-62950ef5bcb5@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc.h
drivers/usb/gadget/function/uvc_video.c