Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10799962ybl; Fri, 27 Dec 2019 02:25:28 -0800 (PST) X-Google-Smtp-Source: APXvYqztKri6uFI9Woco3joksAGAYmFel8Sa2T5jyXfaU+GFDouSeWFVch19Dxb3rw1zkYbs3x2k X-Received: by 2002:a05:6830:1487:: with SMTP id s7mr34391813otq.269.1577442327987; Fri, 27 Dec 2019 02:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577442327; cv=none; d=google.com; s=arc-20160816; b=CG/L4bbqNilVEe4x+098rOJTa1BG80Of8fyHE25qTfAKvyoX9CJ2cUov8cNG+B0yJ5 IaZalhV0Yk4gP95OWDaLPo5gaZpb2EdcOMQFTR5UdK7zAR1RgLeTpjbIbeyKKl7rTTlr hW7AI4cG5tRabzEvEfLuaxli2HCygwyjwgiH9Uy03UCF/2PTjJ3X7MDvIqCPY3A9GZpK ic721RPoKuNAnslMVP5VupfuvHEptgUsBsNLpcSTwi3PHOWXOKObClrzxXyHm605DboO bh+UDh0TM2S0fh82LWyr3+5JOtSB76oXIARWTAl/h2Ir524U2m6Rs/75KSAM9v12ONFV hY1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lg1hRoH8eONZqeITLCzCd+4i6eU6+C9OrOlicvrAccE=; b=SQNd0LFUK7SzpNEi2CTB/XFyqcThh/ntFqJOdFzi9KWyvG+6t6Dfod8WPUaJi01Ku8 L+rMnzcsH4Cjsq5CkrNJHJVmu4AqzfgOxqqprwdirF1UbIis+1aE2b0YBRdVZ+Ao2Wt2 1Cnlul0h7if3ahlRXKMb0SdQs8NqycY0MeRc3YnUX35J8cMyUF5lM2UxhKWyB1NpCzPt PgkXElHqzd5emgyOiccxdRLs+Qz1A/02INuUkhpBwubY7MUkz1Boi9xdtcxGYEWPvVcS DsJ0IHC/hMORK9Hmbrw6IuW6iq5eyPxoU2w1crh+209Fnbgowwz+76q7jbQJNlBqVP0u 6KcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si16080213oii.37.2019.12.27.02.25.15; Fri, 27 Dec 2019 02:25:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfL0KYe (ORCPT + 99 others); Fri, 27 Dec 2019 05:24:34 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:58928 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfL0KYe (ORCPT ); Fri, 27 Dec 2019 05:24:34 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id C1BF1FB03; Fri, 27 Dec 2019 11:24:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BIslT7T3Kqzi; Fri, 27 Dec 2019 11:24:30 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 2E09C49799; Fri, 27 Dec 2019 11:24:30 +0100 (CET) Date: Fri, 27 Dec 2019 11:24:30 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Marco Felsch Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "Angus Ainslie (Purism)" , Allison Randal , Thomas Gleixner , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: light: vcnl4000: Fix scale for vcnl4040 Message-ID: <20191227102430.GA4358@bogon.m.sigxcpu.org> References: <4f2a980d87a7d5ae27d61ed1d35c4f310bfc607c.1577114947.git.agx@sigxcpu.org> <20191227084720.GA6398@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191227084720.GA6398@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Dec 27, 2019 at 09:47:20AM +0100, Marco Felsch wrote: > Hi Guido, > > On 19-12-23 16:30, Guido G?nther wrote: > > According to the data sheet the ambient sensors's scale is 0.12 > > lux/step, not 0.024 lux/step as used by vcnl4200. > > This is only true if the als_it bits are set to '0'. Is it worth to add > a comment here? Good point. I've added that to the commit message. Cheers, -- Guido > > > See p. 8 in https://www.vishay.com/docs/84307/designingvcnl4040.pdf > > > > Fixes: 5a441aade5b3 ("light: vcnl4000 add support for the VCNL4040 proximity and light sensor") > > Signed-off-by: Guido G?nther > > Reviewed-by: Marco Felsch > > > --- > > drivers/iio/light/vcnl4000.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c > > index 16dacea9eadf..b0e241aaefb4 100644 > > --- a/drivers/iio/light/vcnl4000.c > > +++ b/drivers/iio/light/vcnl4000.c > > @@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000_data *data) > > if (ret < 0) > > return ret; > > > > - data->al_scale = 24000; > > data->vcnl4200_al.reg = VCNL4200_AL_DATA; > > data->vcnl4200_ps.reg = VCNL4200_PS_DATA; > > switch (id) { > > @@ -172,11 +171,13 @@ static int vcnl4200_init(struct vcnl4000_data *data) > > /* show 54ms in total. */ > > data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000); > > data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000); > > + data->al_scale = 24000; > > break; > > case VCNL4040_PROD_ID: > > /* Integration time is 80ms, add 10ms. */ > > data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000); > > data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000); > > + data->al_scale = 120000; > > break; > > } > > data->vcnl4200_al.last_measurement = ktime_set(0, 0); > > -- > > 2.23.0 >