Re: [RFC PATCH v3 2/2] media: i2c: Add onsemi AR0234 image sensor driver

Alexander Shiyan
2026-05-06T18:41:45Z

Hello Laurent.

> Thank you for the patch.
> On Fri, Mar 06, 2026 at 01:36:14PM +0300, Alexander Shiyan wrote:
> > Add driver for the onsemi AR0234 CMOS image sensor.
> > Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
...
> > +#define AR0234_NATIVE_WIDTH (1940U)
> > +#define AR0234_NATIVE_HEIGHT (1220U)
> > +#define AR0234_PIXEL_ARRAY_LEFT (8U)
> > +#define AR0234_PIXEL_ARRAY_TOP (8U)
> > +#define AR0234_PIXEL_ARRAY_WIDTH (1920U)
> > +#define AR0234_PIXEL_ARRAY_HEIGHT (1200U)
> > +#define AR0234_MIN_CROP_WIDTH (4U)
> > +#define AR0234_MIN_CROP_HEIGHT (2U)
> > +#define AR0234_CROP_WIDTH_STEP (4U)
> > +#define AR0234_CROP_HEIGHT_STEP (2U)
>
> Where do those two step values come from ?

The sensor’s line length register (LINE_LENGTH_PCK) is calculated as:
line_length_pck = (crop->width / 4) + hblank
The width is divided by 4 because the sensor outputs 4 pixels per pixel clock.
The step of 4 ensures a smooth, glitch‑free horizontal blanking range that
always aligns with the sensor’s internal datapath.

AR0234_CROP_HEIGHT_STEP: The sensor currently does not impose a strict
multiple‑of‑2 requirement on the height in normal mode. The step of 2 is a
forward‑looking choice, intended to simplify adding row binning support later.
When row binning is enabled, the datasheet (AND9812‑D, register READ_MODE)
states that y_addr_start must be even. Using a step of 2 now avoids
future ABI changes.

Thanks!