public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
	 Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 devicetree@vger.kernel.org,
	 Javier Carrasco <javier.carrasco.cruz@gmail.com>
Subject: [PATCH v4 0/2] iio: light: veml6070: add integration time
Date: Thu, 31 Oct 2024 00:09:56 +0100	[thread overview]
Message-ID: <20241031-veml6070-integration-time-v4-0-c66da6788256@gmail.com> (raw)

This series adds a missing feature in the veml6070 driver to select the
integration time, which also depends on an external restistor that has
been added to the corresponding bindings.

The datasheet provides a Refresh time vs Rset graph (figure 7), which
does not clearly specify the minimum and maximum values for Rset. The
manufacuter has confirmed that no values under 75 kohms should be used
to keep linearity, and the graph does not go beyond 1200 kohms, which is
also the biggest Rset used in the application note. The default value of
270 kohms is the one currently used in the driver to calculate the UVI.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Changes in v4:
- Add vendor prefix to rset-ohms property (bindings and driver).
- Drop default values for out-of-range rset and fail the probe instead.
- Link to v3: https://lore.kernel.org/r/20241028-veml6070-integration-time-v3-0-dd7ace62f480@gmail.com

Changes in v3:
- veml6075.yaml: simplify property handling (describe it completely at
  the top and add block for the devices that do not support it).
- veml6070.c: use int instead of u32 for the integration times.
- veml6070.c: refactor default rset value assignment.
- veml6070.c: drop comment about default Rset and IT.
- veml6070.c: use units from units.h
- Link to v2: https://lore.kernel.org/r/20241024-veml6070-integration-time-v2-0-d53272ec0feb@gmail.com

Changes in v2:
- Rebase onto iio/testing and drop applied patches.
- veml6075.yaml: use documented -ohms, top-level definition and
  per-device restriction.
- veml6075.yaml: add default value.
- veml6075.yaml: fix typo in commit message.
- veml6070.c: adjust rset property name and convert from ohms to kohms
  to avoid overflows and work with the same units as in the datasheet.
- veml6070.c: change default to 270 kohms (already used as default
  value to calculate UVI).
- veml6070.c: calculate UVI according to the current integration time.
- veml6070.c: re-calculate measurement time (i.e. msleep()) with the
  current integration time.
- Link to v1: https://lore.kernel.org/r/20241017-veml6070-integration-time-v1-0-3507d17d562a@gmail.com

---
Javier Carrasco (2):
      dt-bindings: iio: light: veml6075: document vishay,rset-ohms
      iio: light: veml6070: add support for integration time

 .../bindings/iio/light/vishay,veml6075.yaml        |  18 +++
 drivers/iio/light/veml6070.c                       | 131 +++++++++++++++++++--
 2 files changed, 141 insertions(+), 8 deletions(-)
---
base-commit: e2687d0723257db5025a4cf8cefbd80bed1e2681
change-id: 20241014-veml6070-integration-time-78daf4eaad2f

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


             reply	other threads:[~2024-10-30 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 23:09 Javier Carrasco [this message]
2024-10-30 23:09 ` [PATCH v4 1/2] dt-bindings: iio: light: veml6075: document vishay,rset-ohms Javier Carrasco
2024-10-31  7:51   ` Krzysztof Kozlowski
2024-10-30 23:09 ` [PATCH v4 2/2] iio: light: veml6070: add support for integration time Javier Carrasco
2024-10-31 21:52 ` [PATCH v4 0/2] iio: light: veml6070: add " Jonathan Cameron

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=20241031-veml6070-integration-time-v4-0-c66da6788256@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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