linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: Hemanth V <hemanthv@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-input@vger.kernel.org
Subject: Re: [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver
Date: Fri, 21 May 2010 16:50:23 +0200	[thread overview]
Message-ID: <20100521145023.GT30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <03b301caf8ee$4dc484b0$LocalHost@wipblrx0099946>

On Fri, May 21, 2010 at 07:32:50PM +0530, Hemanth V wrote:
> >On Fri, May 21, 2010 at 06:10:00PM +0530, Hemanth V wrote:
> >>>On Fri, May 21, 2010 at 05:05:50PM +0530, Hemanth V wrote:
> >>>>+ mutex_lock(&ddata->lock);
> >>>>+
> >>>>+ error = bh1780_write(ddata, BH1780_REG_CONTROL, val, "CONTROL");
> >>>>+ if (error < 0) {
> >>>>+ mutex_unlock(&ddata->lock);
> >>>>+ return error;
> >>>>+ }
> >>>>+
> >>>>+ msleep(BH1780_PON_DELAY);
> >>>
> >>>Hmm, what do you wait for here?
> >>
> >>Settling time delay required before lux read out
> >
> >I thought so, but in fact you're just delaying the next two lines by
> >that:
> >
> >>>>+ ddata->power_state = val;
> >>>>+ mutex_unlock(&ddata->lock);
> >
> >... which doesn't make sense to me.
> >
> >I can believe there is need to wait for the value to settle, but I think
> >it's the wrong place where you're doing it currently.
> >
> 
> I could move it one line down,  but not really release the mutex.
> Which other place would you suggest.

Ah, you just need to wait for the power register to take effect. I
didn't get it, sorry. I tought the delay was supposed to be inbetween
the write of one register and the read of another.

So that all looks sane to me then. Once the other minor things are
fixed, feel free to add my

  Reviewed-by: Daniel Mack <daniel@caiaq.de>

Thanks,
Daniel


  reply	other threads:[~2010-05-21 14:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 11:35 [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver Hemanth V
2010-05-21 12:03 ` Daniel Mack
2010-05-21 12:40   ` Hemanth V
2010-05-21 12:46     ` Daniel Mack
2010-05-21 14:02       ` Hemanth V
2010-05-21 14:50         ` Daniel Mack [this message]
2010-05-21 12:06 ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2010-05-21 11:29 Hemanth V

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=20100521145023.GT30801@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=hemanthv@ti.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.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;
as well as URLs for NNTP newsgroup(s).