Re: [PATCH v3 10/17] media: i2c: os05b10: Add 1080p and 2x2 binning 720p modes
From: Tarang Raval
Date: Fri Jul 24 2026 - 02:44:37 EST
Hi Jai,
Thanks for the feedback.
> Quoting Tarang Raval (2026-07-19 01:39:01)
> > Add support for 1920x1080 and 1280x720 resolutions.
> > The 1280x720 mode uses 2x2 binning.
> >
> > Both 10-bit and 12-bit pixel formats are supported.
> >
> > Signed-off-by: Tarang Raval <tarang.raval@xxxxxxxxxxxxxxxxx>
> > ---
> > drivers/media/i2c/os05b10.c | 120 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 120 insertions(+)
> >
> > diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c
> > index 3fd788bd8b20..c54b466656aa 100644
> > --- a/drivers/media/i2c/os05b10.c
> > +++ b/drivers/media/i2c/os05b10.c
> > @@ -460,6 +460,78 @@ static const struct cci_reg_sequence mode_2592_1944_regs[] = {
> > { CCI_REG8(0x4837), 0x12 },
> > };
> >
> > +static const struct cci_reg_sequence mode_1920_1080_regs[] = {
> > + { OS05B10_REG_X_ADDR_START, 0x0280 },
> > + { OS05B10_REG_Y_ADDR_START, 0x01b4 },
> > + { OS05B10_REG_X_ADDR_END, 0x0a0f },
> > + { OS05B10_REG_Y_ADDR_END, 0x05f3 },
> > + { OS05B10_REG_X_OUTPUT_SIZE, 0x0780 },
> > + { OS05B10_REG_Y_OUTPUT_SIZE, 0x0438 },
> > + { OS05B10_REG_HTS, 0x06d0 },
> > + { OS05B10_REG_ISP_X_WIN, 0x0008 },
> > + { OS05B10_REG_ISP_Y_WIN, 0x0008 },
> > + { OS05B10_REG_X_INC_ODD, 0x01 },
> > + { OS05B10_REG_X_INC_EVEN, 0x01 },
> > + { OS05B10_REG_Y_INC_ODD, 0x01 },
> > + { OS05B10_REG_Y_INC_EVEN, 0x01 },
>
> Mode-based sensor drivers are the last option, especially if the sensor has
> known registers for configuring the crop size, which seems to me is
> possible here?
>
> There's the new common raw sensor model in the works too, which can even
> handle separate userspace configuration for analogue and digital crop,
> subsampling (INC_ODD/INC_EVEN), binning and output size.
>
> Could you please explore that? Adding hard-coded modes would make this
> driver a mess when we move to the new model.
You're right that mode tables aren't a great long term fit here. Looking at
the datasheet again, the analog crop (X/Y_ADDR_START/END), subsampling
(X/Y_INC_ODD/EVEN), digital crop (ISP_X/Y_WIN) and output size
(X/Y_OUTPUT_SIZE) are all independent registers, so this sensor should map
onto the new common raw sensor model reasonably well once it's ready.
I've actually started looking into that approach for os05b10, but it's
going to need its own series to do properly, and I don't want to redesign
the driver against something that's still moving. So my plan is to get this
series in as-is for now, and once the raw sensor model work is finalized,
follow up with a separate series that reworks os05b10 around it and cleans
up the mode handling. Feels like it'll be less churn for everyone that way
than trying to do both at once.
With that said, I'd like to go ahead with the current approach for this
series, and pick this up separately once that lands.
Best Regards,
Tarang