mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: "Guido Günther" <agx@sigxcpu.org>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	"Angus Ainslie (Purism)" <angus@akkea.ca>,
	Allison Randal <allison@lohutok.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: light: vcnl4000: Fix scale for vcnl4040
Date: Fri, 27 Dec 2019 09:47:20 +0100	[thread overview]
Message-ID: <20191227084720.GA6398@pengutronix.de> (raw)
In-Reply-To: <4f2a980d87a7d5ae27d61ed1d35c4f310bfc607c.1577114947.git.agx@sigxcpu.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 <agx@sigxcpu.org>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> ---
>  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

  reply	other threads:[~2019-12-27  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 15:30 Guido Günther
2019-12-27  8:47 ` Marco Felsch [this message]
2019-12-27 10:24   ` Guido Günther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191227084720.GA6398@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=agx@sigxcpu.org \
    --cc=allison@lohutok.net \
    --cc=angus@akkea.ca \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®