openwrt/target/linux/bcm27xx/patches-6.1/950-0596-media-i2c-imx296-Disable-binning-for-colour-variant.patch
Álvaro Fernández Rojas 793f8ab62c bcm27xx: 6.1: add kernel patches
Add kernel patches for version 6.1.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-06-09 19:12:30 +02:00

33 lines
1.2 KiB
Diff

From 6e52a6d45d5296b5396b0b8ad27bbe6dfc3db235 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);