lkml.org 
[lkml]   [2010]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver
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



\
 
 \ /
  Last update: 2010-05-21 16:53    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site