From: Jun Chen Date: Wed, 25 Dec 2019 02:34:17 +0000 (+0100) Subject: media: uvcvideo: Fix annotation for uvc_video_clock_update() X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~1054^2~281 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=fc8678783c72cedd61e5de24978bcc6e147f4d77;p=linux.git media: uvcvideo: Fix annotation for uvc_video_clock_update() The formula (2) is to convert from SOF to host clock, it should be fix as "TS = ((TS2 - TS1) * SOF + TS1 * SOF2 - TS2 * SOF1) / (SOF2 - SOF1)" Signed-off-by: Jun Chen Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 6249e26e8788..a6a441d92b94 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -622,7 +622,7 @@ static u16 uvc_video_clock_host_sof(const struct uvc_clock_sample *sample) * to avoid losing precision in the division. Similarly, the host timestamp is * computed with * - * TS = ((TS2 - TS1) * PTS + TS1 * SOF2 - TS2 * SOF1) / (SOF2 - SOF1) (2) + * TS = ((TS2 - TS1) * SOF + TS1 * SOF2 - TS2 * SOF1) / (SOF2 - SOF1) (2) * * SOF values are coded on 11 bits by USB. We extend their precision with 16 * decimal bits, leading to a 11.16 coding.