1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-13 03:41:54 +00:00
openmptcprouter/6.1/target/linux/bcm27xx/patches-6.1/950-0593-media-i2c-imx296-Disable-binning-for-colour-variant.patch
Ycarus (Yannick Chabanois) 3743692973 Fix RPI5 support
2023-11-17 17:31:36 +01:00

31 lines
1.1 KiB
Diff

From 8c0d4e8e2250030c65a61eee9342e954a7ce4c57 Mon Sep 17 00:00:00 2001
From: Naushir Patuck <naush@raspberrypi.com>
Date: Tue, 14 Mar 2023 12:55:14 +0000
Subject: [PATCH] media: i2c: imx296: Disable binning for colour variant
Binning is only supported on the mono variant of the IMX296 sensor.
Disable reporting of the binning mode for the colour variant.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
drivers/media/i2c/imx296.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/media/i2c/imx296.c
+++ b/drivers/media/i2c/imx296.c
@@ -674,11 +674,14 @@ static int imx296_enum_frame_size(struct
struct v4l2_subdev_state *state,
struct v4l2_subdev_frame_size_enum *fse)
{
+ const struct imx296 *sensor = to_imx296(sd);
const struct v4l2_mbus_framefmt *format;
+ /* Binning only works on the mono sensor variant */
+ unsigned int max_index = sensor->mono ? 2 : 1;
format = v4l2_subdev_get_pad_format(sd, state, fse->pad);
- if (fse->index >= 2 || fse->code != format->code)
+ if (fse->index >= max_index || fse->code != format->code)
return -EINVAL;
fse->min_width = IMX296_PIXEL_ARRAY_WIDTH / (fse->index + 1);