From 28ff98dbdf2b5454d8f51bd3399184b391518fb4 Mon Sep 17 00:00:00 2001
From: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Date: Fri, 22 May 2026 14:53:28 +0100
Subject: [PATCH] Revert "media: i2c: imx219: fix binning and rate_factor for
 480p and 1232p"

This reverts commit 002310f6bf7b5d44a81f5f66aba194176462d87c.
---
 drivers/media/i2c/imx219.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -146,12 +146,6 @@
 #define IMX219_PIXEL_ARRAY_WIDTH	3280U
 #define IMX219_PIXEL_ARRAY_HEIGHT	2464U
 
-enum binning_bit_depths {
-	BINNING_IDX_8_BIT,
-	BINNING_IDX_10_BIT,
-	BINNING_IDX_MAX
-};
-
 /* Mode : resolution and related config&values */
 struct imx219_mode {
 	/* Frame width */
@@ -161,10 +155,6 @@ struct imx219_mode {
 
 	/* V-timing */
 	unsigned int fll_def;
-	unsigned int vts_def;
-
-	/* binning mode based on format code */
-	unsigned int binning[BINNING_IDX_MAX];
 };
 
 static const struct cci_reg_sequence imx219_common_regs[] = {
@@ -323,44 +313,24 @@ static const struct imx219_mode supporte
 		.width = 3280,
 		.height = 2464,
 		.fll_def = 3526,
-		.vts_def = 3526,
-		.binning = {
-			[BINNING_IDX_8_BIT] = IMX219_BINNING_NONE,
-			[BINNING_IDX_10_BIT] = IMX219_BINNING_NONE,
-		},
 	},
 	{
 		/* 1080P 30fps cropped */
 		.width = 1920,
 		.height = 1080,
 		.fll_def = 1763,
-		.vts_def = 1763,
-		.binning = {
-			[BINNING_IDX_8_BIT] = IMX219_BINNING_NONE,
-			[BINNING_IDX_10_BIT] = IMX219_BINNING_NONE,
-		},
 	},
 	{
 		/* 2x2 binned 60fps mode */
 		.width = 1640,
 		.height = 1232,
 		.fll_def = 1707,
-		.vts_def = 1763,
-		.binning = {
-			[BINNING_IDX_8_BIT] = IMX219_BINNING_X2_ANALOG,
-			[BINNING_IDX_10_BIT] = IMX219_BINNING_X2,
-		},
 	},
 	{
 		/* 640x480 60fps mode */
 		.width = 640,
 		.height = 480,
 		.fll_def = 1707,
-		.vts_def = 1763,
-		.binning = {
-			[BINNING_IDX_8_BIT] = IMX219_BINNING_X2_ANALOG,
-			[BINNING_IDX_10_BIT] = IMX219_BINNING_X2_ANALOG,
-		},
 	},
 };
 
@@ -461,7 +431,7 @@ static unsigned int imx219_get_binning(s
 	*bin_v = IMX219_BINNING_NONE;
 
 	if (*bin_h == 2 && *bin_v == 2)
-		return bin_mode;
+		return IMX219_BINNING_X2_ANALOG;
 	else if (*bin_h == 2 || *bin_v == 2)
 		/*
 		 * Don't use analog binning if only one dimension
