Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 00/10] iio: light: veml6030: fix issues and add support for veml6035
@ 2024-09-22 22:17 Javier Carrasco
  2024-09-22 22:17 ` [PATCH v2 01/10] iio: light: veml6030: fix ALS sensor resolution Javier Carrasco
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Carrasco @ 2024-09-22 22:17 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Rishi Gupta
  Cc: linux-iio, devicetree, linux-kernel, Jonathan Cameron,
	Javier Carrasco, stable, Conor Dooley

This series updates the driver for the veml6030 ALS and adds support for
the veml6035, which shares most of its functionality with the former.

The most relevant updates for the veml6030 are the resolution correction
to meet the datasheet update that took place with Rev 1.7, 28-Nov-2023,
a fix to avoid a segmentation fault when reading the
in_illuminance_period_available attribute, and the removal of the
processed value for the WHITE channel, as it uses the ALS resolution.

Vishay does not host the Product Information Notification where the
resolution correction was introduced, but it can still be found
online[1], and the corrected value is the one listed on the latest
version of the datasheet[2] (Rev. 1.7, 28-Nov-2023) and application
note[3] (Rev. 17-Jan-2024).

Link: https://www.farnell.com/datasheets/4379688.pdf [1]
Link: https://www.vishay.com/docs/84366/veml6030.pdf [2]
Link: https://www.vishay.com/docs/84367/designingveml6030.pdf [3]

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Changes in v2:
- Rebase to iio/testing, dropping applied patches [1/7], [4/7].
- Drop [3/7] (applied to iio/fixes-togreg).
- Add patch to use dev_err_probe() in probe error paths.
- Add patch to use read_avail() for available attributes.
- Add patches to use to support a regulator.
- Add patch to ensure that the device is powered off in error paths
  after powering it on.
- Add patch to drop processed values from the WHITE channel.
- Use fsleep() instead of usleep_range() in veml6030_als_pwr_on()
- Link to v1: https://lore.kernel.org/r/20240913-veml6035-v1-0-0b09c0c90418@gmail.com

---
Javier Carrasco (10):
      iio: light: veml6030: fix ALS sensor resolution
      iio: light: veml6030: add set up delay after any power on sequence
      iio: light: veml6030: use dev_err_probe()
      dt-bindings: iio: light: veml6030: add vdd-supply property
      iio: light: veml6030: add support for a regulator
      iio: light: veml6030: use read_avail() for available attributes
      iio: light: veml6030: drop processed info for white channel
      iio: light: veml6030: power off device in probe error paths
      dt-bindings: iio: light: veml6030: add veml6035
      iio: light: veml6030: add support for veml6035

 .../bindings/iio/light/vishay,veml6030.yaml        |  43 +-
 drivers/iio/light/Kconfig                          |   4 +-
 drivers/iio/light/veml6030.c                       | 453 ++++++++++++++++-----
 3 files changed, 391 insertions(+), 109 deletions(-)
---
base-commit: 8bea3878a1511bceadc2fbf284b00bcc5a2ef28d
change-id: 20240903-veml6035-7a91bc088c6f

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 01/10] iio: light: veml6030: fix ALS sensor resolution
  2024-09-22 22:17 [PATCH v2 00/10] iio: light: veml6030: fix issues and add support for veml6035 Javier Carrasco
@ 2024-09-22 22:17 ` Javier Carrasco
  2024-09-28 16:12   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Carrasco @ 2024-09-22 22:17 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Rishi Gupta
  Cc: linux-iio, devicetree, linux-kernel, Jonathan Cameron,
	Javier Carrasco, stable

The driver still uses the sensor resolution provided in the datasheet
until Rev. 1.6, 28-Apr-2022, which was updated with Rev 1.7,
28-Nov-2023. The original ambient light resolution has been updated from
0.0036 lx/ct to 0.0042 lx/ct, which is the value that can be found in
the current device datasheet.

Update the default resolution for IT = 100 ms and GAIN = 1/8 from the
original 4608 mlux/cnt to the current value from the "Resolution and
maximum detection range" table (Application Note 84367, page 5), 5376
mlux/cnt.

Cc: stable@vger.kernel.org
Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/iio/light/veml6030.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
index 4c436c5e0787..a3dfe56b7eec 100644
--- a/drivers/iio/light/veml6030.c
+++ b/drivers/iio/light/veml6030.c
@@ -780,7 +780,7 @@ static int veml6030_hw_init(struct iio_dev *indio_dev)
 
 	/* Cache currently active measurement parameters */
 	data->cur_gain = 3;
-	data->cur_resolution = 4608;
+	data->cur_resolution = 5376;
 	data->cur_integration_time = 3;
 
 	return ret;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 01/10] iio: light: veml6030: fix ALS sensor resolution
  2024-09-22 22:17 ` [PATCH v2 01/10] iio: light: veml6030: fix ALS sensor resolution Javier Carrasco
@ 2024-09-28 16:12   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-09-28 16:12 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rishi Gupta, linux-iio, devicetree, linux-kernel,
	Jonathan Cameron, stable

On Mon, 23 Sep 2024 00:17:49 +0200
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:

> The driver still uses the sensor resolution provided in the datasheet
> until Rev. 1.6, 28-Apr-2022, which was updated with Rev 1.7,
> 28-Nov-2023. The original ambient light resolution has been updated from
> 0.0036 lx/ct to 0.0042 lx/ct, which is the value that can be found in
> the current device datasheet.
> 
> Update the default resolution for IT = 100 ms and GAIN = 1/8 from the
> original 4608 mlux/cnt to the current value from the "Resolution and
> maximum detection range" table (Application Note 84367, page 5), 5376
> mlux/cnt.
> 
> Cc: stable@vger.kernel.org
> Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor")
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied this patch to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/light/veml6030.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
> index 4c436c5e0787..a3dfe56b7eec 100644
> --- a/drivers/iio/light/veml6030.c
> +++ b/drivers/iio/light/veml6030.c
> @@ -780,7 +780,7 @@ static int veml6030_hw_init(struct iio_dev *indio_dev)
>  
>  	/* Cache currently active measurement parameters */
>  	data->cur_gain = 3;
> -	data->cur_resolution = 4608;
> +	data->cur_resolution = 5376;
>  	data->cur_integration_time = 3;
>  
>  	return ret;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-28 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 22:17 [PATCH v2 00/10] iio: light: veml6030: fix issues and add support for veml6035 Javier Carrasco
2024-09-22 22:17 ` [PATCH v2 01/10] iio: light: veml6030: fix ALS sensor resolution Javier Carrasco
2024-09-28 16:12   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox