diff options
| author | Jai Luthra <jai.luthra@ideasonboard.com> | 2025-10-17 13:43:50 +0530 |
|---|---|---|
| committer | Hans Verkuil <hverkuil+cisco@kernel.org> | 2025-10-29 14:07:01 +0100 |
| commit | 3dc9770bf2d521e992df5ebcfdbf1dc68653788b (patch) | |
| tree | d9716bca3ddd3f6fb92b05bdb291a4c3b713a366 | |
| parent | 9ef6e4db152c34580cc52792f32485c193945395 (diff) | |
media: i2c: imx219: Simplify imx219_get_binning() function
In imx219_set_pad_format() there is now a constraint to enforce hbin ==
vbin. So, simplify the logic in imx219_get_binning() function by
removing dead code that handles the case where hbin != vbin.
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
| -rw-r--r-- | drivers/media/i2c/imx219.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 300935b1ef24..48efdcd2a8f9 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -409,24 +409,14 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, u32 hbin = crop->width / format->width; u32 vbin = crop->height / format->height; - *bin_h = IMX219_BINNING_NONE; - *bin_v = IMX219_BINNING_NONE; - - /* - * Use analog binning only if both dimensions are binned, as it crops - * the other dimension. - */ if (hbin == 2 && vbin == 2) { *bin_h = IMX219_BINNING_X2_ANALOG; *bin_v = IMX219_BINNING_X2_ANALOG; - - return; + } else { + *bin_h = IMX219_BINNING_NONE; + *bin_v = IMX219_BINNING_NONE; } - if (hbin == 2) - *bin_h = IMX219_BINNING_X2; - if (vbin == 2) - *bin_v = IMX219_BINNING_X2; } static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) |
