Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4819643ybl; Wed, 22 Jan 2020 05:22:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzqratFBQpI5sLY4SpN0BEw2sRlqH6QS03Vx9odcLyfi2xTA/tXRxEhPJaGKWfYF7a8G3Bp X-Received: by 2002:a9d:7e99:: with SMTP id m25mr7016873otp.212.1579699323812; Wed, 22 Jan 2020 05:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699323; cv=none; d=google.com; s=arc-20160816; b=H08eW+16KYZor5wn7Mzg/J3vJ/7onFRP+22JqeWMwHFzpWDzqmif9ju3nkrw/erTZx qMTj48PDvtqY49GJOJh8ksZ5+JAG1PQKxlse8zv/WEcehtzxG+KgG43fdFtt+E+st0hT HtnwJk/9Lze5vE6KTTOcTUdtCY9r0NhpMMt3u+m75xZbk/Tuy6ujW4q+OP7SdVpOvIgM He2MeXrBY1Hkp23XfKI5YgPf4CwG3FULWhFw9KV2I0Wg9iRBsoVDhYUmlIQrMniTo9oe DM20YNAHk3jHiN0O9n/306/kLY6Xzok3QTdGWzg3SMfusnbOTJuH/u8RYquMGXOEo8hj nbYg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Hl/mQtBoFddl7Nux8pZQnfO15jLla1+Y4K9Nc5LzhfE=; b=lf4a/9Ibxecjcg8x/N3/K1xF2qmX7WGYTAfgyVt/WixWvjZMwmuSaG6oCAGPAAFr+Q U8NeARmfcWvr63jzadhVL0NkiQTjhTvfaKHrIhiD5APqj93Y3lDSyYIh6n0Hm1S+s/3J 3sR49uEfF9OB5h6cSDQxdAH+N7EqlPY1XAmL2cVA9ljShrpHyF6XGa7iH8r7tDaooS7n rE6SsDViv5mLYb/jDt7kxy534bGqLbzumTvtTib+fxW7JrLTKjk5LqFclzveRasxTH3e 7GFfywbeM5Q/GcHVTSWoQO5oPCtX5lhC26V4MQsjqxBvgocPrBGVBvQgYvcqTjkG7eUo aa7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sxSiGhvk; 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 k131si20493246oia.64.2020.01.22.05.21.52; Wed, 22 Jan 2020 05:22:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sxSiGhvk; 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 S1729942AbgAVNUT (ORCPT + 99 others); Wed, 22 Jan 2020 08:20:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:36458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729368AbgAVNUS (ORCPT ); Wed, 22 Jan 2020 08:20:18 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C60DF2467A; Wed, 22 Jan 2020 13:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699217; bh=JSqun9nJBN4MdPIwWzdJTXE21YaHq+B7jgEJA9Z1utg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sxSiGhvknzwG/JDARB6zdrxCTVVFwhCW/LbGNVIudzvGrMeaM1qzXOqzbb9DGQrzB gUsHZvN/DlypIo62+Kgm4t2T+V8xvGjRSxHZOyZ3SFF/4iVItSuWhzm+mhCJ1cRIqp MbxnOeQDuCSXlKcU2iWum2Xk4ICGFTvaEGZcB33I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Guido=20G=C3=BCnther?= , Marco Felsch , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 040/222] iio: light: vcnl4000: Fix scale for vcnl4040 Date: Wed, 22 Jan 2020 10:27:06 +0100 Message-Id: <20200122092836.405074922@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guido Günther commit bc80573ea25bb033a58da81b3ce27205b97c088e upstream. According to the data sheet the ambient sensor's scale is 0.12 lux/step (not 0.024 lux/step as used by vcnl4200) when the integration time is 80ms. The integration time is currently hardcoded in the driver to that value. See p. 8 in https://www.vishay.com/docs/84307/designingvcnl4040.pdf Fixes: 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040 proximity and light sensor") Signed-off-by: Guido Günther Reviewed-by: Marco Felsch Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/light/vcnl4000.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000 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 /* 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);