From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754504AbbCBTDw (ORCPT ); Mon, 2 Mar 2015 14:03:52 -0500 Received: from smtp105.biz.mail.bf1.yahoo.com ([98.139.221.43]:46758 "EHLO smtp105.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846AbbCBTDu convert rfc822-to-8bit (ORCPT ); Mon, 2 Mar 2015 14:03:50 -0500 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: K8olb.gVM1lG36MeRRg7O5DxCh7MHvb1Hx.F.5Er6zpU5ZH LoXb.4_7lYqktGyWlP4YPjPCOWOa9T07A7A7TkUkLPuj_BF9r74R6fihRhJY o3Z2Pm9_wznaUXYFLHZx8cmWPaXvt86n8m8EFlplY7uc2szZMqsCX3ewuWhm F7KytWldOb8T4paq393LWKml5G0mZN2diR.7FSMNB604Us04jS.loVUHejw8 O0WMMJfPA.Z_pYA3jUkCvMMx76NQW7mA4TiUNcHL3C7Wt7PgYg5162nBx3KH SDb4bqsr_KYXD2_r8ikwm3.TJjJ8moqCX9iL1e2mIjhvY7hSWT.K2YaNpFHV brq_MZbTgfbMfdQ4lOj.Yq4beSQD4dceE0bZqhl1lVmMMfcAeMzLPUNcUpND fCTiKuokZKrbcRRzcrThscai4gcxQwpJbsOUqrfy2FbNBjKxjdIjsMYnDvlN Z9khDZWeT5cOsvYvyTQzZZ4i7n9pYEXDpT9c86pE9BxCQWr11DFYbs8jw4Pe bu40Iey0SF7O9cdKX4qjFTft0rZA49T8VcYVRg3oBfRUXfj4FrNLD3HWUIy9 N53CfrKcsCgBH727Znid9PUZfvfYyW4a01MqEGOOZzLsuBT3L.yvKnoOCkvc xPzhB_LKK7C6m X-Yahoo-SMTP: oqiDtsaswBDv2aVUlxVTYPpATqA- From: "Kevin Tsai" To: "'Daniel Baluta'" Cc: "'Jonathan Cameron'" , "'Hartmut Knaack'" , "'Lars-Peter Clausen'" , "'Peter Meerwald'" , , "'Linux Kernel Mailing List'" References: <1421921412-7710-1-git-send-email-daniel.baluta@intel.com> <54C4C510.5090306@kernel.org> In-Reply-To: Subject: RE: [PATCH] iio: light: Add support for Capella CM3323 color/light sensor Date: Mon, 2 Mar 2015 11:03:45 -0800 Message-ID: <000d01d0551b$9d424bb0$d7c6e310$@capellamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 14.0 thread-index: AQITI91QnEbg84qfJ+2AmqucPtdDsgFQcLYBAry1d3cCE6JGvZxS47mA Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Ambient light sensor is trying to match the brightness sensitivity of human visual system. Please see the following links: http://en.wikipedia.org/wiki/Color_vision#mediaviewer/File:Eyesensitivity.svg http://en.wikipedia.org/wiki/Color_vision You can compare the spectrum with the datasheet. The green channel is matched with ALS spectrum. Kevin Tsai 03/02/15 -----Original Message----- From: daniel.baluta@gmail.com [mailto:daniel.baluta@gmail.com] On Behalf Of Daniel Baluta Sent: Monday, March 02, 2015 1:57 AM To: Daniel Baluta Cc: Jonathan Cameron; Kevin Tsai; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald; linux-iio@vger.kernel.org; Linux Kernel Mailing List Subject: Re: [PATCH] iio: light: Add support for Capella CM3323 color/light sensor On Sun, Jan 25, 2015 at 12:50 PM, Daniel Baluta wrote: > On Sun, Jan 25, 2015 at 12:27 PM, Jonathan Cameron 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 >>> Signed-off-by: Daniel Baluta >> >> 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, > > >>> +#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. Hi Kevin, Could you tell us how reliable is using the GREEN channel for getting illuminance readings? If no objection, I will resend this driver exposing only INTENSITY channels for the moment. thanks, Daniel.