Re: [V8, 2/2] media: i2c: ov02a10: Add OV02A10 image sensor driver

Andy Shevchenko
2020-05-11T09:35:55Z

On Sat, May 09, 2020 at 04:06:27PM +0800, Dongchun Zhu wrote:
> Add a V4L2 sub-device driver for OV02A10 image sensor.

...

> +#define OV02A10_ID(_msb, _lsb) ((_msb) << 8 | (_lsb))

How often do you use this macro?

...

> +static int ov02a10_read_smbus(struct ov02a10 *ov02a10, unsigned char reg,
> + unsigned char *val)
> +{
> + struct i2c_client *client = v4l2_get_subdevdata(&ov02a10->subdev);
> + int ret;
> +
> + ret = i2c_smbus_read_byte_data(client, reg);

> +

Extra blank line.

> + if (ret < 0)
> + return ret;
> +
> + *val = (unsigned char)ret;
> +
> + return 0;
> +}

...

> +static int ov02a10_entity_init_cfg(struct v4l2_subdev *sd,
> + struct v4l2_subdev_pad_config *cfg)
> +{
> + struct v4l2_subdev_format fmt = {

> + .which = cfg ? V4L2_SUBDEV_FORMAT_TRY
> + : V4L2_SUBDEV_FORMAT_ACTIVE,

I think it would be fine to have it on one line.

> + .format = {
> + .width = 1600,
> + .height = 1200,
> + }
> + };
> +
> + ov02a10_set_fmt(sd, cfg, &fmt);
> +
> + return 0;
> +}

...

> + if (!ret) {
> + if (rotation == 180) {

if (a) {
if (b) {
...
}
}

==

if (a && b) {
...
}

> + ov02a10->upside_down = true;
> + ov02a10->fmt.code = MEDIA_BUS_FMT_SRGGB10_1X10;
> + }
> + }

--
With Best Regards,
Andy Shevchenko