Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp141747ybj; Fri, 8 May 2020 08:18:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLcCLJjjpepko59AG4fDowE1c4POvuOMusa8vT54MfBmPbkW74/sxht1xUjyWR9bMsYqEBc X-Received: by 2002:a17:907:1185:: with SMTP id uz5mr2226455ejb.335.1588951131015; Fri, 08 May 2020 08:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588951131; cv=none; d=google.com; s=arc-20160816; b=nYEoF/x6EBaf5x6OvPM261EQmiY8/vcXRU1SFP5zVKakbXmI0YtpK4+qOnroNGwFna G5Sci7Bbp/KVdWFIkZDNIIWRT1k1Zv+zneseJAZWVfgKT1awpfLy0TxEA2HCqw3Er7ej O6XtaENi5yMCMwYdZ21mxS+pPF1k5KAmSiPlLOWlMfU1LicQ6Nig6x/QoeP7MpQBvNCP hr+ZDcOIinG31gWCJ2agyxsoJTfUQs9so6VfD341kxOf5qj3QBlTWeuc5rq7r6/nHlU2 RPqap6JCeyGW5V4tucI8Qi6KVnr1uvHuDrZhOckfq1su82F8kc+3FmXDyOr70p1nzqbG hz7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Kz6SR6ShK5lb+TOMKl6Cela21j86R3qqo+2inJrscKg=; b=iSzFuMBCK9HnVlIwEhX50uH7gIHbGnOLC4TXBA4QAVfwzL3qcq/Q9fSEX2NBIj9eOL UtiQJK4FM+y69WdPTlHpjn4EA505EyNigL8Vzewhp/hCM4hgpBOBhdYvH4JCJjrlaggM W8lKRrQ2WDgRMRzPe9+xkvZ/3tGAaFvirZqgnGJ+6bIDFnPkjw82nbbPGX7JNXOU3vGJ qgnKqRFKQDuphDUFT7ES9jns8ZVDGLYo8vC20wN9NuGG1fgrQfWP7bOrq5Igtzx1ZXAd 7IvvgvLrT296DTctYr7NiEVdteDEsNbqqmghCiQGZdM0W611yM9VJbur4FzCTfiKRRyL LoOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si1128356eju.289.2020.05.08.08.18.26; Fri, 08 May 2020 08:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbgEHPRA (ORCPT + 99 others); Fri, 8 May 2020 11:17:00 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2177 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726627AbgEHPQ7 (ORCPT ); Fri, 8 May 2020 11:16:59 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id 16153BD9B3A15415493E; Fri, 8 May 2020 16:16:58 +0100 (IST) Received: from localhost (10.47.95.97) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Fri, 8 May 2020 16:16:57 +0100 Date: Fri, 8 May 2020 16:16:35 +0100 From: Jonathan Cameron To: Gwendal Grignou CC: , , , , , Subject: Re: [PATCH v2 1/3] iio: Add in_illumincance vectors in different color spaces Message-ID: <20200508161635.00006cd2@Huawei.com> In-Reply-To: <20200506230324.139241-2-gwendal@chromium.org> References: <20200506230324.139241-1-gwendal@chromium.org> <20200506230324.139241-2-gwendal@chromium.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.95.97] X-ClientProxiedBy: lhreml743-chm.china.huawei.com (10.201.108.193) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 May 2020 16:03:22 -0700 Gwendal Grignou wrote: Illuminance in the title. Plus I'm still arguing these aren't illuminance values. The Y value is illuminance but X and Z definitely aren't. RGB needs to stick to intensity - like the other existing RGB sensors. Gah. XYZ and IIO is a mess. I suppose we could introduce a new type and have in_illumiance_raw in_chromacity_x_raw in_chromacity_z_raw but chances of anyone understanding what we are on about without reading wikipedia is low... Sigh. Unless someone else chips in, I'm inclined to be lazy and rely on documentation to let in_illuminance_x,y,z be defined as being cie xyz color space measurements. It seems slighlty preferable to defining another type for these, though I suspect I'll regret this comment when some adds cie lab which was always my favourite colour space :) > Define 2 spaces for defining color coming from color sensors: > RGB and XYZ: Both are in lux. > RGB is the raw output from sensors (Red, Green and Blue channels), in > addition to the existing clear channel (C). > The RGBC vector goes through a matrix transformation to produce the XYZ > vector. Y is illumincance, and XY caries the chromaticity information. > The matrix is model specific, as the color sensor can be behing a glass > that can filter some wavelengths. > > Signed-off-by: Gwendal Grignou > --- > New in v2. > > Documentation/ABI/testing/sysfs-bus-iio | 27 +++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio > index d3e53a6d8331b..256db6e63a25e 100644 > --- a/Documentation/ABI/testing/sysfs-bus-iio > +++ b/Documentation/ABI/testing/sysfs-bus-iio > @@ -1309,6 +1309,33 @@ Description: > Illuminance measurement, units after application of scale > and offset are lux. > > +What: /sys/.../iio:deviceX/in_illuminance_red_raw > +What: /sys/.../iio:deviceX/in_illuminance_green_raw > +What: /sys/.../iio:deviceX/in_illuminance_blue_raw > +KernelVersion: 5.7 > +Contact: linux-iio@vger.kernel.org > +Description: > + Illuminance measuremed in red, green or blue channels, units > + after application of scale and offset are lux. No they aren't. Units are some magic intensity at some magic wavelength. > + > +What: /sys/.../iio:deviceX/in_illuminance_x_raw > +What: /sys/.../iio:deviceX/in_illuminance_y_raw > +What: /sys/.../iio:deviceX/in_illuminance_z_raw > +KernelVersion: 5.7 > +Contact: linux-iio@vger.kernel.org > +Description: > + lluminance measured in the CIE 1931 color space (XYZ). > + in_illuminance_y_raw is a measure of the brightness, and is > + identical in_illuminance_raw. That is fair enough. > + in_illuminance_x_raw and in_illuminance_z_raw carry chromacity > + information. > + in_illuminance_x,y,z_raw are be obtained from the sensor color > + channels using color matching functions that may be device > + specific. > + Units after application of scale and offset are lux. True for Y, not for X and Z which don't have 'units' as such. > + The measurments can be used to represent colors in the CIE > + xyY color space XYZ > + > What: /sys/.../iio:deviceX/in_intensityY_raw > What: /sys/.../iio:deviceX/in_intensityY_ir_raw > What: /sys/.../iio:deviceX/in_intensityY_both_raw