Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10722425ybl; Fri, 27 Dec 2019 00:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqynSwfJ58VBsb1BjHA8OgdhF9bqerJwcx+4sIG6pzg4rHf/P8DlAhakqZYCgu4uqtKRXywu X-Received: by 2002:a9d:32c7:: with SMTP id u65mr36992148otb.224.1577436524627; Fri, 27 Dec 2019 00:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577436524; cv=none; d=google.com; s=arc-20160816; b=CrV0EwkbBUJ+4FSglmsLQOzx0PFQZkVy7/vDnbI2fsFkplpmX5D9t2LI9SrMaHv0Xt IH3kAY/5lhzAkheAOI1snScTGqQxd0Tv7MD2jpWZmP9zkH6xDYaOO712UjYAjN7Y51X1 5J+/02zCWZGv7u7xPXLAfxXgLjLc0mYTq31MehGY2gK6H5+3f6WSJaYEk2feKuSE1ptj NTG51u2U6yowoLXKAzwl3/XTkKvHEWz6MWALopl7PeOweoLL7Cdv5N8n4SoL8A10Y4cv prytUytdGCk8tozRX2ZmH0Tt1XHRSS2Ncse7DKOWqCiHJc+7H1YsQRprqKVYa8j0rium hlNg== 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=L19h8GiEYWVBM5vnU1BG8z5HHLhXHUuSVGIHYjscUKg=; b=TYI5yyKX6rCxheLggV4UBDT3tIAlWBNWcD8w2kf1xpcsirCSkf+uRgBMiEAkVDnzw9 /hCTheSXO1CldUZN8mrCrVgWl+PZMgAT5ckyiOYOiqGb96bT8gL96yGdHoE/udrAKsDQ bWih4NVIF2XagkheWsvJkP/RPpIB23q8eXJ8vxzVwPyBQC3Ql7njnSLQbCUYMSxn3LnQ huo0FPGF/o1XE+KcKOPjuJpWYlWfXRFDCb0RIxrwYUvKqMwCI11GjV4Zc2RWt42FkB1i fvT3gHbLxE/XchhvUhkAFrt8o4hhyIboIzcAu5+DqRCginw30fI9wLcvLD8umHifanzY 3pGw== 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 e59si18416257ote.97.2019.12.27.00.48.32; Fri, 27 Dec 2019 00:48:44 -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 S1726354AbfL0Irl (ORCPT + 99 others); Fri, 27 Dec 2019 03:47:41 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40193 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfL0Irk (ORCPT ); Fri, 27 Dec 2019 03:47:40 -0500 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iklHJ-0002Dw-ML; Fri, 27 Dec 2019 09:47:25 +0100 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1iklHE-0002Re-Do; Fri, 27 Dec 2019 09:47:20 +0100 Date: Fri, 27 Dec 2019 09:47:20 +0100 From: Marco Felsch To: Guido =?iso-8859-1?Q?G=FCnther?= 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: <20191227084720.GA6398@pengutronix.de> References: <4f2a980d87a7d5ae27d61ed1d35c4f310bfc607c.1577114947.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4f2a980d87a7d5ae27d61ed1d35c4f310bfc607c.1577114947.git.agx@sigxcpu.org> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:42:35 up 119 days, 20:56, 75 users, load average: 0.06, 0.12, 0.09 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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