Re: [PATCH v7 3/3] iio: adc: add driver for the MAX34417 Four-Channel High Dynamic Range Power Accumulator

From: Neil Armstrong

Date: Mon Nov 30 2026 - 10:04:42 EST


On 11/28/26 21:38, Jonathan Cameron wrote:
On Mon, 23 Nov 2026 18:47:46 +0100
Neil Armstrong <neil.armstrong@xxxxxxxxxx> wrote:

The MAX34417 is a specialized current and voltage monitor used to
determine power consumption of portable systems. The driver support
getting the channels voltage, average power, accumulated average
power and energy over an I2C/SMBUS serial interface.

The MAX34417 datasheet only specified on how to calculate the
accumulated average power, but with the Sample Per Second rate
we can easily get accumulated Energy in Joules.

By default the IIO driver only supports single-shot Voltage
and Power sensing, but the accumulation can be enabled by
enabling the Energy IIO channel which then enables the
Continuous Accumulation Mode.

The counter is common to all channels, so when reading a single
channel we will copy all accumulators to registers, so in order
to permit reading individual channels we must accumulate the
other channels in the driver when Continuous Accumulation Mode
is enabled.

Signed-off-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Hi Neil,

A few things from sashiko. They seem on the subtle side so I didn't
spend the time to figure out if they are right or not. Please take
a look and if false positives just reply to say so:
https://sashiko.dev/#/patchset/20261123-topic-sm8x50-iio-max34417-adc-v7-0-d8f87edc5086%40linaro.org

Yeah they are right and I addresses them already, including Andy's comments.


This is a rare case where I think the ABI is complex enough I'd
like to see some documentation. Add a driver specific file in
Documentation/iio/

Talk in particular about which interfaces work only in cam mode
and which work only when not in cam mode. Ideally keep it fairly
short though so not too much to review!

Ok I'll add it for v8!

Thanks
Neil


Otherwise no additional comments from me. This is looking nice.

Thanks,

Jonathan