[PATCH 4/4] media: i2c: ov4689: Implement 2x2 binning

From: Changhuang Liang
Date: Tue Aug 13 2024 - 09:01:15 EST


Hi, Mikhail

Thanks for your patch.

>
> Implement 2x2 binning support. Compute best binning mode (none or 2x2)
> from pad crop and pad format in ov4689_set_fmt. Use output frame size
> instead of analogue crop to compute control ranges and BLC anchors.
>
> Also move ov4689_hts_min and ov4689_update_ctrl_ranges, since they are
> now also called from ov4689_set_fmt. Update frame timings to
> accommodate the requirements of binning mode and avoid visual
> artefacts. Additionally, report 2x2 binned mode in addition to
> non-binned one in ov4689_enum_frame_sizes.
>
> Signed-off-by: Mikhail Rudenko <mike.rudenko@xxxxxxxxx>

Tested-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>

> ---
> drivers/media/i2c/ov4689.c | 179 ++++++++++++++++++++++++-------------
> 1 file changed, 117 insertions(+), 62 deletions(-)
>
> diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c
> index c4c7c462672a..1499fbe88b76 100644
> --- a/drivers/media/i2c/ov4689.c
> +++ b/drivers/media/i2c/ov4689.c
> @@ -114,7 +114,7 @@
> * Minimum working vertical blanking value. Found experimentally at
> * minimum HTS values.
> */

Regards,
Changhuang