Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1685469rdb; Sun, 19 Nov 2023 06:26:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0bYcErCgJ2YrvFmuoyMyoWWSMbJKKHLXYosb12b2Ebktfn7subVpMGu1PSuKERQprJbRE X-Received: by 2002:a05:6a21:a5a6:b0:181:a38c:8106 with SMTP id gd38-20020a056a21a5a600b00181a38c8106mr7424490pzc.20.1700403966801; Sun, 19 Nov 2023 06:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700403966; cv=none; d=google.com; s=arc-20160816; b=vttuqCKTaECy1MDs5/yRg3viElavHjuL6YfxTxjFT1TUBusHw1YkgiA0hffz4Rjndp I7kJbrt2qC4o7jBjhYMDAARK/IgQOwss8PbhXJWxTi1xNPO/Z38Yi7EQFLSneGr7OpPj VWoauEbou3oj16UFsmLEM6IlCc6GeQ1YqoJY+EhVeQJrTVe1DPM1T9stXuzZqTvZ47g/ e08smM/7EPDdI8FO07DVWbvoFPYevP2XVjEEUNj9sJPbF7KFhq04oMDXqQO45kSPE4vF kEOs0rYNEoelHObLep4VSm3EhONmJoIvVvtcv0QE/wa0HRRnMpj5inbYNb7pMfER8uxp waYw== 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=baMYnColIZVZYyUfJL+2jbyV0wlLSSHhwj+PeN7lY2I=; fh=WFctVS/hjsRT9aDevEulWP2rqJ2dsHRqYny57R4XUhk=; b=aj3X64R3Vl/yWtN43wE/cmBG2tGz2+vyytWoUHsGoKXf/Gy2Bol+LKEEcyu/Noldwv H8KQ3KHegu6l4XWijB4CDHnPUZTb5xEdZkPU8XzvEJv3gIZHgRCX41AMO+K+81Ok/we+ zM0pPTmBoCtK/rNk8KALPH9svi87jSG6xAPHUTo32OjNxIDZ35CKpqwFfk2Vbxtfe4Ey w4t6cnicSjaFr9cXLJ3hkczlZwttpN/Hu+ya2PcAPPATHpw91oH3kN+YSD8wYN1WCM88 y/sW+sfcD7a8//gQ58ynCrfSHdT/clvgi2U6SmnScsGeBCRanxJuz0biTmFWRW07vPyr e2FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CMQo7IKW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e11-20020a056a001a8b00b006bd9ff6dab2si426841pfv.377.2023.11.19.06.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 06:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CMQo7IKW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 4E70280617C3; Sun, 19 Nov 2023 06:26:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbjKSO0F (ORCPT + 99 others); Sun, 19 Nov 2023 09:26:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjKSO0D (ORCPT ); Sun, 19 Nov 2023 09:26:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C20BFF2 for ; Sun, 19 Nov 2023 06:25:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12CBDC433C7; Sun, 19 Nov 2023 14:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700403959; bh=9IicQLoKgbPMOx935wvUZr6B2SQDDBnP1LwHZpDqu6A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CMQo7IKWZi9ZhX06FvE50+MntX84iK6xRgFPwTILyeKCC+A0CrY7Neghy6fdgSqf6 H0/0BA25yDMQ0b50s44al3amWyu67POZbJb+PrS9qQlOHeIdtQzk+hVgpXKBpkzARc vjrfoVBIO+k7DHqo/gftT/KrY55RgQF/kAvIsXlWj4Zl7VvV2VJoA2zp/2fyR32vcm eus6hIIAaNHIxy4AGqas+z0tZKM98gYmB1eoLtQRKM7Pcx0H/YvHUOKIsHuDnUpqZB Zqh2mQQmsDITbgWpi1ly+Jd8hhHlvqWuMCPy8StaPCZVevanrIvfTwbjZf7Xhzwl4I RWAnJeMFR9B5Q== Date: Sun, 19 Nov 2023 14:25:47 +0000 From: Jonathan Cameron To: Javier Carrasco Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 1/2] iio: light: add VEML6075 UVA and UVB light sensor driver Message-ID: <20231119142547.6524160d@jic23-huawei> In-Reply-To: <4dbcd233-cdd7-49ad-8db6-4bd3d706e82d@gmail.com> References: <20231110-veml6075-v1-0-354b3245e14a@gmail.com> <20231110-veml6075-v1-1-354b3245e14a@gmail.com> <4dbcd233-cdd7-49ad-8db6-4bd3d706e82d@gmail.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=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 06:26:05 -0800 (PST) On Sun, 19 Nov 2023 06:08:25 +0100 Javier Carrasco wrote: > On 19.11.23 05:58, Javier Carrasco wrote: > > The Vishay VEMl6075 is a low power, 16-bit resolution UVA and UVB > > light sensor with I2C interface and noise compensation (visible and > > infrarred). > > > > Every UV channel generates an output measured in counts per integration > > period. Available integration times are 50 ms, 100 ms, 200 ms, 400 ms > > and 800 ms, > > > > This driver adds support for both UV channels and the ultraviolet > > index (UVI) inferred from them according to the device application note > > with open-air (no teflon) coefficients. > > > > Signed-off-by: Javier Carrasco Hi Javier, One process note highlighted by this email. Please crop to only relevant text when replying. Scrolling takes time! + makes it hard to be sure we didn't miss anything buried in hundreds of lines of unnecessary context. I'm jet lagged so may be more grumpy than average today :( Thanks, Jonathan > > +static int veml6075_uva_comp(int raw_uva, int comp1, int comp2) > > +{ > > + int comp1a_c, comp2a_c, uva_comp; > > + > > + comp1a_c = (comp1 * VEML6075_A_COEF) / 1000U; > > + comp2a_c = (comp2 * VEML6075_B_COEF) / 1000U; > > + uva_comp = raw_uva - comp1a_c - comp2a_c; > > + pr_err("JCC: uva=%d, c1=%d, c2=%d, c1ca=%d, c2ca=%d, uvac=%d\n", > > + raw_uva, comp1, comp2, comp1a_c, comp2a_c, uva_comp); > Obviously this debug message should be gone and it will be removed for v2. > > + > > + return clamp_val(uva_comp, 0, U16_MAX); > > +} > > + > > +static int veml6075_uvb_comp(int raw_uvb, int comp1, int comp2) > > +{ > > + int comp1b_c, comp2b_c, uvb_comp; > > + > > + comp1b_c = (comp1 * VEML6075_C_COEF) / 1000U; > > + comp2b_c = (comp2 * VEML6075_D_COEF) / 1000U; > > + uvb_comp = raw_uvb - comp1b_c - comp2b_c; > > + pr_err("JCC: uvb=%d, c1=%d, c2=%d, c1cb=%d, c2cb=%d, uvbc=%d\n", > > + raw_uvb, comp1, comp2, comp1b_c, comp2b_c, uvb_comp); > Same here. > > + > > + return clamp_val(uvb_comp, 0, U16_MAX); > > +} > > +