Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2594294rdb; Mon, 4 Dec 2023 01:51:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvRWhRzpTYq0Nfz8qZmTUPySVx7hUmRfwb0wbDE9xwvj9PC4qVr+Rf7p7v15A7164wERaA X-Received: by 2002:a9d:5a0b:0:b0:6cd:a9d:bc57 with SMTP id v11-20020a9d5a0b000000b006cd0a9dbc57mr3024016oth.32.1701683510435; Mon, 04 Dec 2023 01:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701683510; cv=none; d=google.com; s=arc-20160816; b=AnFemAXBV1291Logo/bZLvDaq4Ksp81xHRACBssnAhgXLYg/7PsmLJLvkuTETc7mHh zlHzCAVp5zTPb+QnERcnFUZPD85eK/aPGLtiVRrG4OOoIUBvEinZ5Gtmwbc9t6hIqiUq B14rRuM8kQN2wlz0zuwYbN6eIPgoi2rEkqGBl00YeemovA+/K8PSkCiAE7NkncwE+Bs9 2qLg+PSQfc70TW26rajFfA1rXOI5hbaC1R+Dz4P4UfJfZqPTJPM0PmK5/I/WyXWJEwCB hL7CvF3QgYx8hWYGAgUaLyCbbr2Bl1ia+TywyNhQGMiawa2rqzus9MEdhJTdTo3uDll/ /XiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=IDYenk3XujPUqFKq3epEmlE++bDkkQYz2Yyd247S7tM=; fh=O36+efUPlWmSP8gRiBohvOSmSUHgbvFkxo5eScAuXpM=; b=ckrxZuYznG0MWPTsockiimpGr0t9NVIcZ1IKum7wP0BH268YUiVIDDXshq8A2m0wOh j17Rlw4HM1CjECSxVM63eW/GjjOLSWRaS7hTRN5gz+gXNQw+yjDsSs2gh8nQ5Nwb2mLP JRbmcnmBQQQBNZTOj1FxjGdnLyqe+SNBxMFN4zp/KwONwPJeLWywfdkrvbAUcO0fls2K w2v6BJrjfwCeaTkYyla68UXO8ucoL8C/ehVkCPebapIB5xorjVHz1hQ1yb8AMG8itaZm qwoyYteEhhjkeCJrz/IPpl1XclsUz3rOKfD7D8CT3kvXm+lNgHe4jnUu+utADSgwWHew aQGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ho/CWHb5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f9-20020a635109000000b005c661a0e6b5si3324141pgb.750.2023.12.04.01.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 01:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ho/CWHb5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EF4BD807C653; Mon, 4 Dec 2023 01:51:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjLDJvU (ORCPT + 99 others); Mon, 4 Dec 2023 04:51:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbjLDJvP (ORCPT ); Mon, 4 Dec 2023 04:51:15 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C35EB102 for ; Mon, 4 Dec 2023 01:51:19 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62704C433C9; Mon, 4 Dec 2023 09:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701683479; bh=WapbCRUO3S/NfgvTtNfLjSDYaTDi8m3kUjYU8vSz9Y0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ho/CWHb52u731UYrS+MGise5+SKq+Vd+/HDabnoaxmGy7NhtTnq3I07gZxjWWyNFE dB/7eI+Nt2ZH4LJpFIZqd+QrDmKQHyeazYhRyvNV5mjrEGmm6MilxbKeFVolQE2eaD Td6nyZoDPbH/obVmxld9N5tGDYu4Js7Wy5KSd/AwsTHax0ygxPtco6VXy5V6ipofyP PX7G5rRMCVX+788vN4xYj2MZjNwgRZ5eJp4U8foNdMicj16ZgcoTXKPVy6VNI6TU2B H/GvYz77z7XF63giEkSSZRECDMxSchpIIIP6ZBoF9j7A7xX23P5kZ9IRocK/qHsCRc FBqUI9JloHDXw== Date: Mon, 4 Dec 2023 09:51:08 +0000 From: Jonathan Cameron To: Matti Vaittinen Cc: Subhajit Ghosh , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Paul Gazzillo , Matt Ranostay , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: light: Add support for APDS9306 Light Sensor Message-ID: <20231204095108.22f89718@jic23-huawei> In-Reply-To: References: <20231027074545.6055-1-subhajit.ghosh@tweaklogic.com> <20231027074545.6055-3-subhajit.ghosh@tweaklogic.com> <20231028162025.4259f1cc@jic23-huawei> <2974aa13-796c-49ef-bef7-fd7f3f9b7f49@tweaklogic.com> <20231106111355.2f8dfaa1@jic23-huawei> <307f93f9-2a41-4704-ac4f-8d1e427e5060@tweaklogic.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 01:51:48 -0800 (PST) On Mon, 6 Nov 2023 14:10:43 +0200 Matti Vaittinen wrote: > On 11/6/23 14:04, Subhajit Ghosh wrote: > > On 6/11/23 21:43, Jonathan Cameron wrote: =20 > >> On Tue, 31 Oct 2023 19:08:08 +1030 > >> Subhajit Ghosh wrote: > >> =20 > >>>> Scale on the intensity channel is interesting...=C2=A0 What are the = units? > >>>> There tend not to be any well defined units for intensity (as opposed > >>>> to illuminance).=C2=A0 There may be gain on the signal, but it won't= be=20 > >>>> in untils > >>>> that map directly to a scale userspace should apply.=C2=A0 This is o= ne of=20 > >>>> the > >>>> rare reasons for using the HARDWARE_GAIN element of the ABI. > >>>> > >>>> A tricky corner however as relationship between raw value and=20 > >>>> hardwaregain > >>>> is not tightly defined (as it can be really weird!) =20 > >>> Hi Jonathan, > >>> > >>> Thank you for taking time for reviewing and clearing all my tiny=20 > >>> doubts and > >>> queries especially for the dt and versioning part. Much appreciated. > >>> > >>> In the above case, should I not expose scale for the "clear" channel?= =20 > >>> Rather, > >>> how should I expose the "clear" channel to userspace? =20 > >> What is the scale?=C2=A0 What units to you get after applying it? =20 > > The scale is in Lux. The output after applying is Lux. =20 >=20 > Hi Subhajit, >=20 > I am by no means an expert here but maybe you could check if the channel= =20 > should be of type 'illuminance'? (To me 'Lux' sounds like an unit of=20 > illuminance rather than intensity). Absolutely. Light measurements are 'weird'. Lux is a measurement of light as if the human eye were looking at it. Unfortunately light sensors don't have the same sensitivity curves as the eye so instead they tend to do it either by some careful choice of filters, a horrible approximation based on assumption of day light, or most commonly by combining the inputs of several different light sensors. Clear normally means sensitive to both visible light and infrared which means you need to remove the infrared part to get closer to human eye response. Thus in other light sensors, we can't assign standard units to the intensity channels (and so don't provide a scale). We just don't have enough information to work out what they are measuring. In theory we could provide the full sensitivity curve (usually somewhere in the datasheet) but they can be complex multi-peak things so we don't so far. Jonathan >=20 > Yours, > -- Matti >=20