Re: [PATCH v5 2/3] iio: health: add MAX86150 ECG and PPG biosensor driver

From: Md Shofiqul Islam

Date: Mon Jul 06 2026 - 16:51:30 EST


On Wed, 2 Jul 2026, Jonathan Cameron wrote:
> [PATCH v5 2/3] iio: health: add MAX86150 ECG and PPG biosensor driver

Thank you for the thorough review. I apologise for sending v6 before
addressing the driver feedback — that was a mistake. v7 (being sent now)
addresses all points raised below:

Architectural change:
- Switch from devm_iio_triggered_buffer_setup() to
devm_iio_kfifo_buffer_setup() with iio_buffer_setup_ops
(postenable/predisable), matching MAX30100 and MAX30102. The IIO
trigger object and trigger_ops are removed entirely.

Kconfig:
- Remove spurious 'select IIO_TRIGGER' from AFE4403, AFE4404, MAX30100,
MAX30102. Those were wrong — I was not touching those drivers.
- MAX86150 now selects IIO_KFIFO_BUF, not IIO_TRIGGER or
IIO_TRIGGERED_BUFFER.

Register field macros:
- All renamed to include the parent register name and _MASK suffix,
e.g. MAX86150_PPG_ADC_RGE -> MAX86150_PPG_CONFIG1_ADC_RGE_MASK.

Buffer declaration:
- s32 buf[6] -> IIO_DECLARE_BUFFER_WITH_TS(s32, buf, 3).
- ARCH_DMA_MINALIGN -> IIO_DMA_MINALIGN; comment about
CONFIG_DMA_API_DEBUG removed.

FIFO read:
- get_unaligned_be24() with a single mask for each 24-bit word,
matching si1133.c and rm3100-core.c.

Error handling:
- if (!ret) chains replaced with goto throughout read_raw and
buffer_postenable.

regmap helpers:
- regmap_update_bits(..., SHDN, 0) -> regmap_clear_bits().
- regmap_update_bits(..., SHDN, SHDN) -> regmap_set_bits().

IRQ handler:
- Overflow: flush FIFO pointers and return — no attempt to reconstruct
timestamps from unreliable data.
- memset of push buffer removed.
- iio_push_to_buffers_with_timestamp() -> iio_push_to_buffers_with_ts().
- pf->timestamp replaced with ktime_get_ns() (no trigger object now).

Other style fixes:
- All code-section comments removed (/* Trigger */, /* Probe */, etc.).
- Forced variable declaration alignment removed.
- usleep_range(1000, 2000) -> fsleep(1000).
- 10000000 -> 10 * NSEC_PER_MSEC.
- LED_PA_DEFAULT -> LED_PA_50MA.
- Part ID mismatch: dev_warn() instead of returning -ENODEV.
- IRQ trigger type fallback (IRQF_TRIGGER_FALLING) removed.

Regulators:
- vref removed from driver and DT binding (not a supply per datasheet).
- devm_regulator_get_enable_optional() -> devm_regulator_get_enable().

Signed-off-by: Md Shofiqul Islam <shofiqtest@xxxxxxxxx>