Re: [PATCH v8 0/5] iio: adc: add support for the MAX34417 Four-Channel High Dynamic Range Power Accumulator
From: Jonathan Cameron
Date: Sat Dec 05 2026 - 17:42:33 EST
On Mon, 30 Nov 2026 17:30:34 +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 supports
> getting the channels voltage, average power and 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.
>
> The get_unaligned_be56() helper is added since we effectly
> get an unaligned 56bit value from the HW.
>
> While Analog Devices originally provided an HWMON driver for this
> IC, using IIO makes much more sense because it provides
> much more flexibility to support getting the power values
> and will make it easier to support trigger to dump all
> channels in a single shot and then support the Bulk Update
> feature to update all MAX34417 on the same bus via the
> trigger mechanism.
>
> The v3 implementation has been completely revised since
> v1/v2 to better match the capabilities of the MAX34417.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Applied to the testing branch of iio.git, so lined up for next merge
window. Make sure to check out the minor things Sashiko called out
and send patches on top if they makes sense,
Thanks,
Jonathan