From: jacopo mondi <jacopo@jmondi.org>
To: Sam Bobrowicz <sam@elite-embedded.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 3/4] media: ov5640: Don't access ctrl regs when off
Date: Wed, 10 Oct 2018 10:48:17 +0200 [thread overview]
Message-ID: <20181010084817.GB7677@w540> (raw)
In-Reply-To: <1539067682-60604-4-git-send-email-sam@elite-embedded.com>
[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]
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@elite-embedded.com>
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@jmondi.org>
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2018-10-10 16:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 6:47 [PATCH 0/4] ov5640: small fixes for compatibility Sam Bobrowicz
2018-10-09 6:47 ` [PATCH 1/4] media: ov5640: fix resolution update Sam Bobrowicz
2018-10-10 10:58 ` jacopo mondi
2018-10-10 12:41 ` Laurent Pinchart
2018-10-15 15:13 ` Hugues FRUCHET
2018-10-15 15:24 ` jacopo mondi
2018-10-16 8:49 ` Hugues FRUCHET
2018-10-16 12:15 ` Laurent Pinchart
2018-10-16 18:14 ` Samuel Bobrowicz
2018-10-09 6:48 ` [PATCH 2/4] media: ov5640: fix get_light_freq on auto Sam Bobrowicz
2018-10-10 8:49 ` jacopo mondi
2018-10-09 6:48 ` [PATCH 3/4] media: ov5640: Don't access ctrl regs when off Sam Bobrowicz
2018-10-10 8:48 ` jacopo mondi [this message]
2018-10-09 6:48 ` [PATCH 4/4] media: ov5640: Add additional media bus formats Sam Bobrowicz
2018-11-16 13:18 ` Sakari Ailus
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=20181010084817.GB7677@w540 \
--to=jacopo@jmondi.org \
--cc=linux-media@vger.kernel.org \
--cc=sam@elite-embedded.com \
/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;
as well as URLs for NNTP newsgroup(s).