All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Andrew Chew <AChew@nvidia.com>
Cc: "mchehab@redhat.com" <mchehab@redhat.com>,
	"olof@lixom.net" <olof@lixom.net>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 5/5 v2] [media] ov9740: Add suspend/resume
Date: Wed, 1 Jun 2011 21:51:50 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1106012137320.29934@axis700.grange> (raw)
In-Reply-To: <643E69AA4436674C8F39DCC2C05F76382A75BF37C4@HQMAIL03.nvidia.com>

On Tue, 31 May 2011, Andrew Chew wrote:

> > > +	/* For suspend/resume. */
> > > +	struct v4l2_mbus_framefmt	current_mf;
> > > +	int				current_enable;
> > 
> > bool?
> 
> Are you sure you want this to be a bool?  This thing is trying to shadow 
> the "enable" parameter of the s_stream() callback, and that enable 
> parameter is int.

You use it as a bool.

> > > +static int ov9740_suspend(struct soc_camera_device *icd, 
> > pm_message_t state)
> > > +{
> > > +	struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> > > +	struct ov9740_priv *priv = to_ov9740(sd);
> > > +
> > > +	if (priv->current_enable) {
> > > +		int current_enable = priv->current_enable;
> > > +
> > > +		ov9740_s_stream(sd, 0);
> > > +		priv->current_enable = current_enable;
> > 
> > You don't need the local variable, just set
> > 
> > 	priv->current_enable = true;
> 
> I think I do need that local variable, the way the code is arranged now.  
> I'm trying to save the state of enablement inside of 
> priv->current_enable, at the time we are suspending, so it won't 
> necessarily be true.  And one of the side effects of calling 
> ov9740_s_stream(sd, 0) is that priv->current_enable will be set to 
> false, which is why I save off the value of priv->current_enable, and 
> then restore it after the call to ov9740_s_stream().

? Sorry, don't understand. You only _enter_ that "if" statement, if 
priv->current_enable is true. So, your local variable is _certainly_ true. 
And that's what you're then writing in priv->current_enable back again.

> > >  static struct soc_camera_ops ov9740_ops = {
> > > +	.suspend		= ov9740_suspend,
> > > +	.resume			= ov9740_resume,
> > 
> > No, we don't want to use these, whey should disappear some 
> > time... Please, 
> > use .s_power() from struct v4l2_subdev_core_ops, you can check 
> > http://article.gmane.org/gmane.linux.drivers.video-input-infra
> > structure/33105 
> > for an example. If your host is not using these ops, it has 
> > to be fixed. 
> > So far in the mainline only one soc-camera host driver is using these 
> > callbacks: pxa_camera.c, which, looking at your email 
> > address, I doubt is 
> > the driver, that you're using;)
> 
> Okay, will do.  Thanks for pointing that out :)
> 
> Is the camera host driver expected to directly call the sensor driver's 
> s_power (via v4l2_subdev_call(sd, core, s_power, <some value>)?  Or does 
> the v4l2 framework do this for you?  I didn't see an example of this in 
> my last pull of linux-next.

yes, the host driver has to call s_power explicitly.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

      reply	other threads:[~2011-06-01 19:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26  0:04 [PATCH 1/5 v2] [media] ov9740: Cleanup hex casing inconsistencies achew
2011-05-26  0:04 ` [PATCH 2/5 v2] [media] ov9740: Correct print in ov9740_reg_rmw() achew
2011-05-26  0:04 ` [PATCH 3/5 v2] [media] ov9740: Fixed some settings achew
2011-05-29 10:21   ` Guennadi Liakhovetski
2011-06-01  1:12     ` Andrew Chew
2011-05-26  0:04 ` [PATCH 4/5 v2] [media] ov9740: Remove hardcoded resolution regs achew
2011-05-29 10:36   ` Guennadi Liakhovetski
2011-06-01  1:50     ` Andrew Chew
2011-06-01 19:35       ` Guennadi Liakhovetski
2011-05-26  0:04 ` [PATCH 5/5 v2] [media] ov9740: Add suspend/resume achew
2011-05-29 10:58   ` Guennadi Liakhovetski
2011-06-01  1:58     ` Andrew Chew
2011-06-01 19:51       ` Guennadi Liakhovetski [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=Pine.LNX.4.64.1106012137320.29934@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=AChew@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=olof@lixom.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.