Re: [PATCH v4 5/5] media: ov7670: split register setting from set_framerate() logic

From: Sakari Ailus
Date: Tue Jan 15 2019 - 04:09:38 EST


On Tue, Jan 15, 2019 at 09:54:48AM +0100, Lubomir Rintel wrote:
> This will allow us to restore the last set frame rate after the device
> returns from a power off.
>
> Signed-off-by: Lubomir Rintel <lkundrak@xxxxx>

Thanks!

I've applied them, and hopefully all is well now.

> ---
> drivers/media/i2c/ov7670.c | 26 ++++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
> index d0f40d5f6ca0..6f9a53d4dcfc 100644
> --- a/drivers/media/i2c/ov7670.c
> +++ b/drivers/media/i2c/ov7670.c
> @@ -812,13 +812,24 @@ static void ov7675_get_framerate(struct v4l2_subdev *sd,
> (4 * clkrc);
> }
>
> +static int ov7675_apply_framerate(struct v4l2_subdev *sd)
> +{
> + struct ov7670_info *info = to_state(sd);
> + int ret;
> +
> + ret = ov7670_write(sd, REG_CLKRC, info->clkrc);
> + if (ret < 0)
> + return ret;
> +
> + return ov7670_write(sd, REG_DBLV, info->pll_bypass ? DBLV_BYPASS : DBLV_X4);

I wrapped this to avoid it exceeding 80... no other changes.

> +}

--
Sakari Ailus