LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Daniel Baluta <daniel.baluta@intel.com>,
	Kevin Tsai <ktsai@capellamicro.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: light: Add support for Capella CM3323 color/light sensor
Date: Sun, 25 Jan 2015 12:50:02 +0200	[thread overview]
Message-ID: <CAEnQRZAhTQEGiSeAOahG4A_iZhPgMYnoHwLjDeEWKarwVJO3qg@mail.gmail.com> (raw)
In-Reply-To: <54C4C510.5090306@kernel.org>

On Sun, Jan 25, 2015 at 12:27 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 22/01/15 10:10, Daniel Baluta wrote:
>> Minimal implementation providing raw light intensity and illuminance
>> readings. For illuminance user can compute lux values using raw readings
>> and scale.
>>
>> This driver also supports CM3323E sensor chip.
>>
>> Cc: Kevin Tsai <ktsai@capellamicro.com>
>> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
>
> Hi Daniel,
>
> My only real question on this one is whether using the 'green' channel
> and pretending it is a measure of illuminance is a good idea or whether
> we are better leaving that decision to userspace...
>
> I'm guessing the reason it is green rather than clear is that
> the clear is letting infrared through and we don't have an additional
> infrared sensor available to allow that component to be removed?

Hi Jonathan,

<snip>
>> +#define CM3323_COLOR_CHANNEL(_color, _addr) {\
>> +     .type = IIO_INTENSITY, \
>> +     .modified = 1, \
>> +     .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
>> +     .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_INT_TIME), \
>> +     .channel2 = IIO_MOD_LIGHT_##_color, \
>> +     .address = _addr, \
>> +}
>> +
>> +/*
>> + * CM3323's GREEN channel is used for reading illuminance
> That's impressively random and unlikely to be anywhere near correct
> pretty much all the time!
>
> I'd personally prefer just not providing an illuminance channel
> and leaving it up to userspace to make the decision on whether the
> green channel is good enough...

Datasheet says that the GREEN channel should be used
for getting illuminance readings. I'm not sure if this is
totally random.

I understand your worries, perhaps Kevin could 'enlighten' us here.

I would  prefer to have the illuminance channel exported from
IIO because there are already userspace applications/frameworks
 written and tested for ALS that use IIO illuminance channel.
We want to use this driver without modifying user space.

Of course, one option for the moment would be to only export
the INTENSITY channels as per your recommendation and
to decide later what to do for the LIGHT channel.


Thanks for review!

Daniel.

  reply	other threads:[~2015-01-25 10:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 10:10 Daniel Baluta
2015-01-22 10:48 ` Peter Meerwald
2015-01-25 10:27 ` Jonathan Cameron
2015-01-25 10:50   ` Daniel Baluta [this message]
2015-03-02  9:57     ` Daniel Baluta
2015-03-02 19:03       ` Kevin Tsai
2015-03-09 15:45         ` Jonathan Cameron
2015-03-09 20:38           ` Daniel Baluta

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=CAEnQRZAhTQEGiSeAOahG4A_iZhPgMYnoHwLjDeEWKarwVJO3qg@mail.gmail.com \
    --to=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=ktsai@capellamicro.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --subject='Re: [PATCH] iio: light: Add support for Capella CM3323 color/light sensor' \
    /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

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).