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

From: David Lechner

Date: Fri Jul 03 2026 - 16:30:28 EST


On 7/3/26 2:42 PM, Siratul Islam wrote:
> On Fri, 2026-07-03 at 13:29 +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.
>>
>>
> Hi! I already looked at Andy's review and decided to add a few more stuff.
> ...

>> +#define MAX40080_REG_CFG 0x00
>> +#define  MAX40080_MODE_MSK GENMASK(2, 0)
>> +#define  MAX40080_PEC_EN_MSK BIT(5)
>> +#define  MAX40080_RANGE_MSK BIT(6)
>> +#define  MAX40080_FILTER_MSK GENMASK(14, 12)
> Should be one space after #define, like the first one.
>> +
Actually, Jonathan likes to have the extra space to group the
fields of the register under the register address like this.

And even better is to include the register name in the field
macros too, e.g. MAX40080_CFG_MODE_MSK.