summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-01-13 17:40:58 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-02-08 10:24:34 +0300
commita6fc86ed57a108cdc5078d93b17bcf56c234f94c (patch)
treefc691b52c84eaf69613033d62209cd70d1df1dfa
parent10704b452ab1b1040cfc08fb901e9226b9bfd460 (diff)
downloadlinux-a6fc86ed57a108cdc5078d93b17bcf56c234f94c.tar.xz
media: atomisp: ov2680: Fix ov2680_enum_frame_interval()
Fix and simplify ov2680_enum_frame_interval(), the index is not an index into ov2680_res_preview[], so using N_PREVIEW is wrong. Instead it is an index indexing the different framerates for the resolution specified in fie->width, fie->height. Since the ov2680 code only supports a single fixed 30 fps, index must always be 0 and we don't need to check the other fie input values. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/i2c/atomisp-ov2680.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index 274acebff79f..e90a7737a56d 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -711,19 +711,12 @@ static int ov2680_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
{
- struct v4l2_fract fract;
-
- if (fie->index >= N_RES_PREVIEW ||
- fie->width > ov2680_res_preview[0].width ||
- fie->height > ov2680_res_preview[0].height ||
- fie->which > V4L2_SUBDEV_FORMAT_ACTIVE)
+ /* Only 1 framerate */
+ if (fie->index)
return -EINVAL;
- fract.numerator = 1;
- fract.denominator = OV2680_FPS;
-
- fie->interval = fract;
-
+ fie->interval.numerator = 1;
+ fie->interval.denominator = OV2680_FPS;
return 0;
}