Linux Media Controller development
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] media: platform: pxa_camera: add missing sensor power on
Date: Tue, 18 Oct 2016 08:56:42 +0200	[thread overview]
Message-ID: <874m4a5emt.fsf@belgarion.home> (raw)
In-Reply-To: <1474656100-7415-1-git-send-email-robert.jarzmik@free.fr> (Robert Jarzmik's message of "Fri, 23 Sep 2016 20:41:39 +0200")

Robert Jarzmik <robert.jarzmik@free.fr> writes:

> During sensors binding, there is a window where the sensor is switched
> off, while there is a call it to set a new format, which can end up in
> an access to the sensor, especially an I2C based sensor.
>
> Remove this window by activating the sensor.
Hi guys,

I can't remember if I have review issues I have to address for this serie or
not. My mailer seems to tell no, but let's check again.

This serie is adding back the "power on" of the sensors through the generic
regulator API, and is my prequisite for pxa submitted changes, which were
formerly a "hook" in soc_camera_link structure, see:
         https://www.spinics.net/lists/kernel/msg2350167.html

Cheers.

--
Robert

[1] Remaining of the patch for reference

> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/media/platform/pxa_camera.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
> index 2978cd6efa63..794c41d24d9f 100644
> --- a/drivers/media/platform/pxa_camera.c
> +++ b/drivers/media/platform/pxa_camera.c
> @@ -2128,17 +2128,22 @@ static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier,
>  				    pix->bytesperline, pix->height);
>  	pix->pixelformat = pcdev->current_fmt->host_fmt->fourcc;
>  	v4l2_fill_mbus_format(mf, pix, pcdev->current_fmt->code);
> -	err = sensor_call(pcdev, pad, set_fmt, NULL, &format);
> +
> +	err = sensor_call(pcdev, core, s_power, 1);
>  	if (err)
>  		goto out;
>  
> +	err = sensor_call(pcdev, pad, set_fmt, NULL, &format);
> +	if (err)
> +		goto out_sensor_poweroff;
> +
>  	v4l2_fill_pix_format(pix, mf);
>  	pr_info("%s(): colorspace=0x%x pixfmt=0x%x\n",
>  		__func__, pix->colorspace, pix->pixelformat);
>  
>  	err = pxa_camera_init_videobuf2(pcdev);
>  	if (err)
> -		goto out;
> +		goto out_sensor_poweroff;
>  
>  	err = video_register_device(&pcdev->vdev, VFL_TYPE_GRABBER, -1);
>  	if (err) {
> @@ -2149,6 +2154,9 @@ static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier,
>  			 "PXA Camera driver attached to camera %s\n",
>  			 subdev->name);
>  	}
> +
> +out_sensor_poweroff:
> +	err = sensor_call(pcdev, core, s_power, 0);
>  out:
>  	mutex_unlock(&pcdev->mlock);
>  	return err;

-- 
Robert

      parent reply	other threads:[~2016-10-18  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 18:41 [PATCH 1/2] media: platform: pxa_camera: add missing sensor power on Robert Jarzmik
2016-09-23 18:41 ` [PATCH 2/2] media: mt9m111: add regulator support Robert Jarzmik
2016-10-18  6:56 ` Robert Jarzmik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874m4a5emt.fsf@belgarion.home \
    --to=robert.jarzmik@free.fr \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox