Devicetree
 help / color / mirror / Atom feed
* [PATCH v9 0/2] iio: health: add MAX86150 ECG and PPG biosensor driver
@ 2026-07-07 11:27 Md Shofiqul Islam
  2026-07-07 11:33 ` Joshua Crofts
  2026-07-07 15:08 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Md Shofiqul Islam @ 2026-07-07 11:27 UTC (permalink / raw)
  To: linux-iio
  Cc: jic23, devicetree, robh, krzk+dt, conor+dt, andriy.shevchenko,
	u.kleine-koenig, joshua.crofts1

Add DT bindings and an IIO driver for the Analog Devices MAX86150
integrated biosensor, which combines two PPG optical channels (Red/IR
LED) and one ECG biopotential channel in a single I2C device.

Md Shofiqul Islam (2):
  dt-bindings: iio: health: add adi,max86150
  iio: health: add MAX86150 ECG and PPG biosensor driver

 .../bindings/iio/health/adi,max86150.yaml     |  65 ++
 MAINTAINERS                                   |   7 +
 drivers/iio/health/Kconfig                    |  17 +
 drivers/iio/health/Makefile                   |   1 +
 drivers/iio/health/max86150.c                 | 564 ++++++++++++++++++
 5 files changed, 654 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/health/adi,max86150.yaml
 create mode 100644 drivers/iio/health/max86150.c

Changes in v9:
- Split MAINTAINERS correctly: M:/L:/S:/F: yaml entry in DT binding
  patch, F: .c entry added in driver patch (Joshua Crofts, Jonathan
  Cameron)
- Reorder includes: move linux/iio/* group after linux/module.h,
  linux/regmap.h, linux/regulator/consumer.h (Andy Shevchenko)
- Add linux/timekeeping.h for ktime_get_ns() (IWYU)
- Add synchronize_irq() in predisable() after masking the hardware
  interrupt, preventing a race where a threaded handler in flight
  dereferences active_scan_mask after the IIO core clears it
- Clear INT_STATUS1 before regmap_read_poll_timeout() to avoid
  latching on a stale PPG_RDY flag from a previous session
- Detect FIFO exactly-full condition (wr_ptr == rd_ptr with
  OVF_COUNTER == 0) using the A_FULL status bit so that a full
  32-sample FIFO is not silently treated as empty
- Use unsigned int for FIFO pointer and counter variables; use s32
  for ECG and u32 for PPG values throughout
- Use local struct device *dev in probe() to reduce code repetition
- Remove explicit enum values from scan index (= 0, 1, 2); let
  C auto-increment assign them consistently
- Use named .name initializer in i2c_device_id[] (Uwe Kleine-Koenig,
  already in v8)

Changes in v8:
- Fold MAINTAINERS entry into the driver patch rather than a separate
  patch (Joshua Crofts, Jonathan Cameron)
- Use named .name initializer in i2c_device_id[] (Uwe Kleine-Koenig)

Changes in v7:
- Replace devm_iio_triggered_buffer_setup() with
  devm_iio_kfifo_buffer_setup() to match FIFO-drain pattern
- Use regmap_noinc_read() for burst FIFO reads
- Use IIO_DECLARE_BUFFER_WITH_TS and iio_push_to_buffers_with_ts()
- Back-calculate per-sample timestamps from IRQ arrival time
- Use IIO_DMA_MINALIGN for DMA-safe FIFO read buffer
- Use fsleep() instead of msleep() for short delays
- Use NSEC_PER_MSEC constant for sample period
- Use devm_regulator_get_enable() for power supplies
- Use regmap_set_bits()/regmap_clear_bits() for single-direction writes
- Return IRQ_NONE when A_FULL is not set
- Discard samples on FIFO overflow (timestamps unreliable)
- Add devm_add_action_or_reset() cleanup for power-down on error
- Add FIFO overflow detection and reset
- Use regmap_read_poll_timeout() instead of fixed sleep in read_raw

-- 
2.51.1

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

end of thread, other threads:[~2026-07-07 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 11:27 [PATCH v9 0/2] iio: health: add MAX86150 ECG and PPG biosensor driver Md Shofiqul Islam
2026-07-07 11:33 ` Joshua Crofts
2026-07-07 15:08 ` Andy Shevchenko

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