* [PATCH v2 0/2] iio: light: veml6030: fix channel type for events and remove unused read
@ 2026-05-14 1:01 Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 1/2] iio: light: veml6030: fix channel type when pushing events Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 2/2] iio: light: veml6030: remove unnecessary read of IT index Javier Carrasco
0 siblings, 2 replies; 3+ messages in thread
From: Javier Carrasco @ 2026-05-14 1:01 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rishi Gupta
Cc: Javier Carrasco, linux-iio, linux-kernel, Jonathan Cameron,
stable
This series fixes a current bug that leads to pushing events with the
wrong channel type (IIO_INTENSITY instead of IIO_LIGHT, the latter being
the configured channel for events), and also removes an unnecessary read
operation when setting a new scale.
This series has been tested on real HW (veml6030) with positive results.
V1 of this new series is V2 of the one I recently sent to provide a new
driver for the veml6031x00 family, and additionally fix these issues.
As the driver will be split to ease the review, it will take some
time until I send V3, and they are actually independent matters,
I have moved these 2 simpler patches to this separate series, keeping V2
(where these 2 patches were sent for the first time) as the common
ancestor. I have provided a link to it at the end of this cover letter.
To: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
To: Nuno Sá <nuno.sa@analog.com>
To: Andy Shevchenko <andy@kernel.org>
To: Rishi Gupta <gupt21@gmail.com>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Changes in v2:
- Add fixes tag to the bug fix in [1/2].
- Remove Fixes tag for [2/2] as it does not fix a bug.
- Fix indentation in [1/2].
- Link to v1: https://lore.kernel.org/r/20260513-veml6031x00-v2-0-4703ca661a1d@gmail.com
---
Javier Carrasco (2):
iio: light: veml6030: fix channel type when pushing events
iio: light: veml6030: remove unnecessary read of IT index
drivers/iio/light/veml6030.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260514-veml6030-fixes-ba43c3c72857
Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2 1/2] iio: light: veml6030: fix channel type when pushing events
2026-05-14 1:01 [PATCH v2 0/2] iio: light: veml6030: fix channel type for events and remove unused read Javier Carrasco
@ 2026-05-14 1:01 ` Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 2/2] iio: light: veml6030: remove unnecessary read of IT index Javier Carrasco
1 sibling, 0 replies; 3+ messages in thread
From: Javier Carrasco @ 2026-05-14 1:01 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rishi Gupta
Cc: Javier Carrasco, linux-iio, linux-kernel, Jonathan Cameron,
stable
The events are registered for IIO_LIGHT and not for IIO_INTENSITY.
Use the correct channel type.
When at it, fix minor checkpatch code style warning (alignment).
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 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
index 6bcacae3863c..da8c32cabfd6 100644
--- a/drivers/iio/light/veml6030.c
+++ b/drivers/iio/light/veml6030.c
@@ -875,9 +875,11 @@ static irqreturn_t veml6030_event_handler(int irq, void *private)
else
evtdir = IIO_EV_DIR_FALLING;
- iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_INTENSITY,
- 0, IIO_EV_TYPE_THRESH, evtdir),
- iio_get_time_ns(indio_dev));
+ iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_LIGHT,
+ 0,
+ IIO_EV_TYPE_THRESH,
+ evtdir),
+ iio_get_time_ns(indio_dev));
return IRQ_HANDLED;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH v2 2/2] iio: light: veml6030: remove unnecessary read of IT index
2026-05-14 1:01 [PATCH v2 0/2] iio: light: veml6030: fix channel type for events and remove unused read Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 1/2] iio: light: veml6030: fix channel type when pushing events Javier Carrasco
@ 2026-05-14 1:01 ` Javier Carrasco
1 sibling, 0 replies; 3+ messages in thread
From: Javier Carrasco @ 2026-05-14 1:01 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rishi Gupta
Cc: Javier Carrasco, linux-iio, linux-kernel, Jonathan Cameron
This is dead code as the IT index is not used by gts to set the new scale.
In its current form, the value is read but not used afterward. Remove
the dead code.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/iio/light/veml6030.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
index da8c32cabfd6..2f9a25d59b71 100644
--- a/drivers/iio/light/veml6030.c
+++ b/drivers/iio/light/veml6030.c
@@ -521,13 +521,9 @@ static int veml6030_write_persistence(struct iio_dev *indio_dev,
static int veml6030_set_scale(struct iio_dev *indio_dev, int val, int val2)
{
- int ret, gain_sel, it_idx, it_sel;
+ int ret, gain_sel, it_sel;
struct veml6030_data *data = iio_priv(indio_dev);
- ret = regmap_field_read(data->rf.it, &it_idx);
- if (ret)
- return ret;
-
ret = iio_gts_find_gain_time_sel_for_scale(&data->gts, val, val2,
&gain_sel, &it_sel);
if (ret)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-14 1:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14 1:01 [PATCH v2 0/2] iio: light: veml6030: fix channel type for events and remove unused read Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 1/2] iio: light: veml6030: fix channel type when pushing events Javier Carrasco
2026-05-14 1:01 ` [PATCH v2 2/2] iio: light: veml6030: remove unnecessary read of IT index Javier Carrasco
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox