Re: [PATCH v2 2/2] iio: health: max30100: Add pulse-width configuration via DT

From: David Lechner

Date: Fri Oct 10 2025 - 13:55:51 EST


On 10/7/25 10:17 PM, Shrikant Raskar wrote:

...

> --- a/drivers/iio/health/max30100.c
> +++ b/drivers/iio/health/max30100.c
> @@ -5,7 +5,6 @@
> * Copyright (C) 2015, 2018
> * Author: Matt Ranostay <matt.ranostay@xxxxxxxxxxxx>
> *
> - * TODO: enable pulse length controls via device tree properties
> */
>
> #include <linux/module.h>
> @@ -54,6 +53,10 @@
> #define MAX30100_REG_SPO2_CONFIG 0x07
> #define MAX30100_REG_SPO2_CONFIG_100HZ BIT(2)
> #define MAX30100_REG_SPO2_CONFIG_HI_RES_EN BIT(6)
> +#define MAX30100_REG_SPO2_CONFIG_PW_MASK GENMASK(1, 0)> +#define MAX30100_REG_SPO2_CONFIG_200US 0x0
> +#define MAX30100_REG_SPO2_CONFIG_400US 0x1
> +#define MAX30100_REG_SPO2_CONFIG_800US 0x2
> #define MAX30100_REG_SPO2_CONFIG_1600US 0x3

Would make more sense to put this new code before BIT(2) to preserve the
order of lowest to highest bits.