media: ov5640: report correct frame rate to user
authorGuoniu.zhou <guoniu.zhou@nxp.com>
Fri, 2 Dec 2022 13:00:00 +0000 (13:00 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 6 Dec 2022 07:21:52 +0000 (07:21 +0000)
commitf33b56d370090e9ce58761a536b174d4f656092f
treeab23ea1ec08b99b4f184b3ba3043beb5ba8af312
parent1b584f20d964ff612beb7e8e61cd9e2b8026d565
media: ov5640: report correct frame rate to user

In commit 3145efcdb4d0 ("media: ov5640: Rework timings programming"),
it defines max_fps field in ov5640_mode_info structure to store maximum
frame rate supported by each mode. But in ov5640_try_frame_interval(), it
assumes the maximum frame rate supported by all modes is 60. But actually,
only VGA support it. For others, the maximum frame rate supported is 30.
So correct it by taking the maximum frame rate supported by each mode as
the initialization value of the local variable maxfps.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov5640.c