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

From: Andy Shevchenko

Date: Tue Jul 07 2026 - 09:16:27 EST


On Tue, Jul 07, 2026 at 01:42:34PM +0300, Md Shofiqul Islam wrote:
> Add a new 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.
>
> The device has a 32-entry hardware FIFO with a configurable almost-full
> interrupt. Because all samples arrive via the FIFO, the driver uses a
> kfifo buffer (like the sibling MAX30100 and MAX30102 drivers) rather
> than the triggered-buffer framework. The interrupt handler drains the
> FIFO on each A_FULL event and timestamps samples back-calculated from
> the interrupt arrival time by one sample_period_ns per step.
>
> Key implementation details:
> - FIFO draining via iio_buffer_setup_ops postenable/predisable
> - DMA-safe FIFO read buffer aligned to IIO_DMA_MINALIGN
> - IIO_DECLARE_BUFFER_WITH_TS for the push buffer
> - 24-bit FIFO words decoded via get_unaligned_be24()
> - regmap_set_bits() / regmap_clear_bits() for single-direction writes
> - Overflow drops all samples; timestamps are unreliable after overflow
> - Device remains in shutdown between captures to suppress LED current
> - vdd and vled regulators required per datasheet; vref is not a supply

...

> endmenu
>
> +

Now too many blank lines. It rings a bell that I have already commented on this
in v6 or so.

> +config MAX86150
> + tristate "MAX86150 ECG and PPG biosensor"
> + depends on I2C
> + select IIO_BUFFER
> + select IIO_KFIFO_BUF
> + select REGMAP_I2C
> + help
> + Say Y here to enable support for the Maxim MAX86150 combined
> + ECG and photoplethysmography (PPG) biosensor.
> +
> + The driver exposes three IIO channels: two PPG optical channels
> + (Red and IR LED) for heart rate and SpO2 monitoring, and one
> + ECG channel for biopotential recording.
> +
> + This driver can also be built as a module. If so, the module
> + will be called max86150.
> +
> endmenu

...

> +#include <linux/bitfield.h>
> +#include <linux/delay.h>
> +#include <linux/i2c.h>
> +#include <linux/irq.h>
> +#include <linux/iio/buffer.h>
> +#include <linux/iio/iio.h>
> +#include <linux/iio/kfifo_buf.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>

+ types.h // uXX

> +#include <linux/unaligned.h>

Also sounds like I already commented on this and on the grouping of
linux/iio/*.h. Since there are no links in the cover letter I can't
quickly confirm. So I stop review here and waiting for v9 with properly
formed series and cover letter, and take a chance to go through previous
reviews to check if you addressed everything or replied to the comments
you are not agree with.

...

> +static const struct i2c_device_id max86150_id[] = {
> + { "max86150" },

This should be C99 initialiser.

> + { }
> +};

--
With Best Regards,
Andy Shevchenko