Re: [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----- From: "Daniel Mack" <daniel@xxxxxxxx>
To: "Hemanth V" <hemanthv@xxxxxx>
Cc: <linux-kernel@xxxxxxxxxxxxxxx>; <linux-omap@xxxxxxxxxxxxxxx>; <linux-input@xxxxxxxxxxxxxxx>
Sent: Friday, May 21, 2010 6:16 PM
Subject: Re: [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux