Re: [PATCH v6 2/2] iio: adc: add MAX40080 current-sense amplifier driver

From: Siratul Islam

Date: Fri Jul 31 2026 - 02:00:59 EST


On Thu, 2026-07-30 at 16:17 +0300, Stefan Popa wrote:
> The MAX40080 is a bidirectional current-sense amplifier with an
> integrated 12-bit ADC and an I2C/SMBus interface. It measures the
> voltage across an external shunt resistor and the input bus voltage,
> storing the results in an internal FIFO.
>
...
> +
> +#define MAX40080_REG_FIFO_CFG 0x0A
> +#define  MAX40080_FIFO_CFG_STORE_IV_MSK GENMASK(1, 0)
> +
> +#define MAX40080_REG_IV 0x10
> +/* Current is a 13-bit two's-complement value (magnitude + sign bit). */
> +#define  MAX40080_IV_I_MSK GENMASK(12, 0)
> +#define  MAX40080_IV_I_SIGN_BIT 12
> +#define  MAX40080_IV_V_MAG_MSK GENMASK(27, 16)
> +#define  MAX40080_IV_VALID_MSK BIT(31)
> +
> +/* CFG.mode field values. */
> +#define MAX40080_CFG_MODE_STDBY 0x00
> +#define MAX40080_CFG_MODE_SINGLE 0x02
> +
> +/* CFG.range field values. */
> +#define MAX40080_CFG_RANGE_50MV 0
> +#define MAX40080_CFG_RANGE_10MV 1
this and other "MV"s below should be mV(m lowercase) as 
I suggested in the previous version.
> +
> +/* FIFO_CFG.store_iv field values. */
> +#define MAX40080_FIFO_CFG_STORE_I_V 0x02
I also had a question on why this is I_V and not IV like the rest of them?
> +
> +#define MAX40080_ADC_RES_BITS 12
> +#define MAX40080_INTER_VREF_MV 1250
> +#define MAX40080_V_BUFF_GAIN 30
> +#define MAX40080_CSA_50MV_GAIN 25
> +#define MAX40080_CSA_10MV_GAIN 125
...
Looks like you missed some of the reviews. If it was intentional,
please acknowledge that. It is a good idea to reply to emails
and discuss/confirm stuff before sending a new patch.

Also avoid sending --to mailing lists (linux-iio@xxxxxxxxxxxxxxx). 
Send to maintainers and Cc reviewers and lists.

--
Best regards,
Sirat