Skip to content

Interrupt and Continuous mode support for VL6180

Abhash Jha linux-iio lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/23 patches 1 replyIn review
  2. v3 posting 1/23 patches 0 repliesSuperseded
  3. v23 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches9 repliesSuperseded

Changes in v3 from the cover letter

- Fixed race condition related to reinit_completion
- Used iio_for_each_active_channel instead of manually accessing masklength
- Accepting sampling frequency values in milihertz instead of miliseconds.
- Minor code refactoring.

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iio: light: vl6180: Add configurable inter-measurement period supportdrivers/iio/light/vl6180.c+68 -20 replies
2/3iio: light: vl6180: Added Interrupt support for single shot accessdrivers/iio/light/vl6180.c+42 -120 replies
3/3iio: light: vl6180: Add support for Continuous Modedrivers/iio/light/vl6180.c+129 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/3] Interrupt and Continuous mode support for VL6180

Sending v3 again because I accidently sent it without a subject. Apologies from my side.

Hello,

The first patch adds support for configuring the Sampling frequency (inter-measurement period) of the sensor. The values should be provided in milihertz. The default value for the inter-measurement period for ALS is 10ms or 100000 mHz and for Range is 50ms or 20000 mHz.

The second patch adds support for interrupt based single shot reading. We registered an irq_handler that fires everytime the data is ready. And then we read the appropriate value in the vl6180_measure routine.

The third patch adds support for continuous mode in the sensor by using buffers. We enable the sensor's continuous mode in the buffer_postenable function depending on the active_scan_mask.
The continuous mode can be disabled by disabling the buffer. Added a trigger to the device for the continuous mode. Also validating that the device uses the internal trigger provided by us.

Changes in v2:
- Fixed label followed by a declaration is a C23 extension [-Wc23-extensions] by moving the guard(mutex)(&data->lock) above the switch statement.

- The above error was pointed out during testing by kernel-test-robot

Changes in v3:
- Fixed race condition related to reinit_completion
- Used iio_for_each_active_channel instead of manually accessing masklength
- Accepting sampling frequency values in milihertz instead of miliseconds.
- Minor code refactoring.

Thanks,
Abhash Jha

Abhash Jha (3):
iio: light: vl6180: Add configurable inter-measurement period support
iio: light: vl6180: Added Interrupt support for single shot access
iio: light: vl6180: Add support for Continuous Mode

 drivers/iio/light/vl6180.c | 255 ++++++++++++++++++++++++++++++++++---
 1 file changed, 238 insertions(+), 17 deletions(-)
Signature · 1 line
2.43.0