Re: [PATCH 2/3] media: atomisp: ov2680: Convert to new CCI register access helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 6, 2023 at 7:58 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Use the new comon CCI register access helpers to replace the private
> register access helpers in the ov2680 driver.
>
> While at it also switch to using the same register address defines
> as the standard drivers/media/i2c/ov2680.c driver to make merging
> the 2 drivers simpler.

...

> +       cci_write(sensor->regmap, OV2680_REG_SENSOR_CTRL_0A, sensor_ctrl_0a, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_HORIZONTAL_START, sensor->mode.h_start, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_VERTICAL_START, sensor->mode.v_start, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_HORIZONTAL_END, sensor->mode.h_end, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_VERTICAL_END, sensor->mode.v_end, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_HORIZONTAL_OUTPUT_SIZE,
> +                 sensor->mode.h_output_size, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_VERTICAL_OUTPUT_SIZE,
> +                 sensor->mode.v_output_size, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_TIMING_HTS, sensor->mode.hts, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_TIMING_VTS, sensor->mode.vts, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_ISP_X_WIN, 0, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_ISP_Y_WIN, 0, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_X_INC, inc, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_Y_INC, inc, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_X_WIN, sensor->mode.h_output_size, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_Y_WIN, sensor->mode.v_output_size, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_FORMAT1, fmt1, &ret);
> +       cci_write(sensor->regmap, OV2680_REG_FORMAT2, fmt2, &ret);

I know that &ret thingy was discussed before and Laurent is keen to
have this, but has anybody actually tested how bad or not at all the
code generation becomes?

...

> +       struct device *dev;
> +       struct regmap *regmap;

Isn't the same device associated with regmap? If so, one of them
probably duplicates the other.

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux