* [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods
@ 2020-02-18 15:44 Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 1/2] iio: light: vcnl4000: update sampling periods for vcnl4200 Tomas Novotny
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tomas Novotny @ 2020-02-18 15:44 UTC (permalink / raw)
To: linux-iio
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Angus Ainslie, Marco Felsch,
Thomas Gleixner, Guido Günther, Tomas Novotny
Vishay has published new information which explain drifts seen in
experiments. So update the sampling periods for affected variants.
As pointed out in another series, the variable has a misleading name
(rate instead of period). This will be fixed in the other series to make
backporting of these patches straightforward.
Tested on vcnl4200. Tests on vcnl4040 done by Guido.
Changes in v2:
- fix rate -> period in commit messages and subjects
- collect tags
Tomas Novotny (2):
iio: light: vcnl4000: update sampling periods for vcnl4200
iio: light: vcnl4000: update sampling periods for vcnl4040
drivers/iio/light/vcnl4000.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--
2.16.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] iio: light: vcnl4000: update sampling periods for vcnl4200
2020-02-18 15:44 [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Tomas Novotny
@ 2020-02-18 15:44 ` Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 2/2] iio: light: vcnl4000: update sampling periods for vcnl4040 Tomas Novotny
2020-02-21 15:12 ` [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Tomas Novotny @ 2020-02-18 15:44 UTC (permalink / raw)
To: linux-iio
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Angus Ainslie, Marco Felsch,
Thomas Gleixner, Guido Günther, Tomas Novotny
Vishay has published a new version of "Designing the VCNL4200 Into an
Application" application note in October 2019. The new version specifies
that there is +-20% of part to part tolerance. This explains the drift
seen during experiments. The proximity pulse width is also changed from
32us to 30us. According to the support, the tolerance also applies to
ambient light.
So update the sampling periods. As the reading is blocking, current
users may notice slightly longer response time.
Fixes: be38866fbb97 ("iio: vcnl4000: add support for VCNL4200")
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Tomas Novotny <tomas@novotny.cz>
---
drivers/iio/light/vcnl4000.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index b0e241aaefb4..98428bf430bd 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -167,10 +167,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
switch (id) {
case VCNL4200_PROD_ID:
- /* Integration time is 50ms, but the experiments */
- /* show 54ms in total. */
- data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
- data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
+ /* Default wait time is 50ms, add 20% tolerance. */
+ data->vcnl4200_al.sampling_rate = ktime_set(0, 60000 * 1000);
+ /* Default wait time is 4.8ms, add 20% tolerance. */
+ data->vcnl4200_ps.sampling_rate = ktime_set(0, 5760 * 1000);
data->al_scale = 24000;
break;
case VCNL4040_PROD_ID:
--
2.16.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] iio: light: vcnl4000: update sampling periods for vcnl4040
2020-02-18 15:44 [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 1/2] iio: light: vcnl4000: update sampling periods for vcnl4200 Tomas Novotny
@ 2020-02-18 15:44 ` Tomas Novotny
2020-02-21 15:12 ` [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Tomas Novotny @ 2020-02-18 15:44 UTC (permalink / raw)
To: linux-iio
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Angus Ainslie, Marco Felsch,
Thomas Gleixner, Guido Günther, Tomas Novotny
Vishay has published a new version of "Designing the VCNL4200 Into an
Application" application note in October 2019. The new version specifies
that there is +-20% of part to part tolerance. Although the application
note is related to vcnl4200, according to support the vcnl4040's "ASIC
is quite similar to that one for the VCNL4200".
So update the sampling periods (and comment), including the correct
sampling period for proximity. Both sampling periods are lower. Users
relying on the blocking behaviour of reading will get proximity
measurements much earlier.
Fixes: 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040 proximity and light sensor")
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Tested-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Tomas Novotny <tomas@novotny.cz>
---
drivers/iio/light/vcnl4000.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 98428bf430bd..e5b00a6611ac 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -174,9 +174,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
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);
+ /* Default wait time is 80ms, add 20% tolerance. */
+ data->vcnl4200_al.sampling_rate = ktime_set(0, 96000 * 1000);
+ /* Default wait time is 5ms, add 20% tolerance. */
+ data->vcnl4200_ps.sampling_rate = ktime_set(0, 6000 * 1000);
data->al_scale = 120000;
break;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods
2020-02-18 15:44 [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 1/2] iio: light: vcnl4000: update sampling periods for vcnl4200 Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 2/2] iio: light: vcnl4000: update sampling periods for vcnl4040 Tomas Novotny
@ 2020-02-21 15:12 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2020-02-21 15:12 UTC (permalink / raw)
To: Tomas Novotny
Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Angus Ainslie, Marco Felsch,
Thomas Gleixner, Guido Günther
On Tue, 18 Feb 2020 16:44:49 +0100
Tomas Novotny <tomas@novotny.cz> wrote:
> Vishay has published new information which explain drifts seen in
> experiments. So update the sampling periods for affected variants.
>
> As pointed out in another series, the variable has a misleading name
> (rate instead of period). This will be fixed in the other series to make
> backporting of these patches straightforward.
>
> Tested on vcnl4200. Tests on vcnl4040 done by Guido.
Both applied to the fixes-togreg branch of iio.git and marked as suitable
for stable.
Thanks,
Jonathan
>
> Changes in v2:
> - fix rate -> period in commit messages and subjects
> - collect tags
>
> Tomas Novotny (2):
> iio: light: vcnl4000: update sampling periods for vcnl4200
> iio: light: vcnl4000: update sampling periods for vcnl4040
>
> drivers/iio/light/vcnl4000.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-21 15:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 15:44 [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 1/2] iio: light: vcnl4000: update sampling periods for vcnl4200 Tomas Novotny
2020-02-18 15:44 ` [PATCH v2 2/2] iio: light: vcnl4000: update sampling periods for vcnl4040 Tomas Novotny
2020-02-21 15:12 ` [PATCH v2 0/2] iio: light: vcnl4000: update sampling periods Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).