Re: [PATCH 3/4] media: ov5640: Don't access ctrl regs when off

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

 



Hi Sam,
   thanks for the patch.

On Mon, Oct 08, 2018 at 11:48:01PM -0700, Sam Bobrowicz wrote:
> Add a check to g_volatile_ctrl to prevent trying to read
> registers when the sensor is not powered.
>
> Signed-off-by: Sam Bobrowicz <sam@xxxxxxxxxxxxxxxxxx>

I've been carrying a similar patch in my tree. I found it is required
when the sensor control handler is add to the receiver driver control
handler, and thus g_voltaile_ctrl can be called when the sensor is
powered off.

Please add my:
Acked-by: Jacopo Mondi <jacopo@xxxxxxxxxx>

Thanks
   j

> ---
>  drivers/media/i2c/ov5640.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index f183222..a50d884 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -2336,6 +2336,13 @@ static int ov5640_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
>
>  	/* v4l2_ctrl_lock() locks our own mutex */
>
> +	/*
> +	 * If the sensor is not powered up by the host driver, do
> +	 * not try to access it to update the volatile controls.
> +	 */
> +	if (sensor->power_count == 0)
> +		return 0;
> +
>  	switch (ctrl->id) {
>  	case V4L2_CID_AUTOGAIN:
>  		val = ov5640_get_gain(sensor);
> --
> 2.7.4
>

Attachment: signature.asc
Description: PGP signature


[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