All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>,
	linux-iio@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	s.nawrocki@samsung.com
Subject: Re: [PATCH/RFC v4 2/3] iio: gp2ap020a00f: Add a driver for the device
Date: Tue, 20 Aug 2013 16:50:56 +0200	[thread overview]
Message-ID: <52138250.6040101@samsung.com> (raw)
In-Reply-To: <520FD862.3070802@kernel.org>

On 08/17/2013 10:09 PM, Jonathan Cameron wrote:
> On 08/16/13 14:12, Jacek Anaszewski wrote:
>> Add a new driver for the ambient light/proximity sensor
>> device. The driver exposes three channels: light_clear
>> light_ir and proximity. It also supports triggered buffer,
>> high and low ambient light threshold event and proximity
>> detection events.
>>
>> Signed-off-by: Jacek Anaszewski<j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Signed-off-by: Kyungmin Park<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>
> Looking good but a few little bits and pieces left.
> Superfluous !! when converting to boolean.
> If the proximity detection cannot start with thresholds set to
> the current value then fail to start it, don't fudge the variables.
>
> One question that comes to mind as well.  Does the chip always return
> a value in the same units whatever scale is being applied?  If so then
> all is fine (and this is a cleverer chip than commonly seen!).

The chip can be set into two modes: manual and auto calculation.
In the manual mode it outputs the result of CLEAR photodiode
in D0 register and the result of IR photodiode in D1 register.
Illuminance value can be obtained by making some calculation
basing on these two values and some variables factors.
In the auto calculation mode it outputs the calculated result
without the influence of infrared spectrum in lux units to the
D0 register. In addition raw IR result is stored in the D1 register.

In the recent patch I switched over to using auto calculation mode
to avoid the problems with dynamically changing scale value.

> Otherwise how does userspace know what it is getting?

This was my concern when I asked in the other email how
to inform the user what scale has been applied.

Thanks,
Jacek

  reply	other threads:[~2013-08-20 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 13:12 [PATCH/RFC v4 2/3] iio: gp2ap020a00f: Add a driver for the device Jacek Anaszewski
2013-08-17 20:09 ` Jonathan Cameron
2013-08-20 14:50   ` Jacek Anaszewski [this message]
2013-08-21  9:50     ` Jacek Anaszewski
2013-08-21 15:17       ` Jacek Anaszewski

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=52138250.6040101@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=jic23@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=s.nawrocki@samsung.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 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.