From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796510547; b=zZ1nfF933GCa3+IUkcuQq/mFg5STmTd2xbZM7SzDgvqEVLtnrOnyasCvjlujuOzlthKo VJbdYeyxFIx5c61g4DUT9XrsM+59AXy5CDVyZ2n2KBWYUy016q8uHg8m9kRB3YTlHJ+hN lK3LTWGaHqCvYmIJTvPtjAvOTSiclsZ5MTnj8CKUHZuvmuEmzFomZ/A7m2KPvFkl5LbDY 6CqcfTjoZZ2zy/tOydmwKvEa1aZ2UmaiECQ0FZv7xUYinQBRSAnOQzD9Ql09hXnX8fLX9 L5ok0pYScMcbGIMCKRnh7zk/AFkZx1WNDoM6ub/j86VZS3OeVjBEWItrVBzpP+9dhZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796510547; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=l2SA6Sy1zJsg5GoGzQKUjRIWmUWWTBCNC+x0HBbob5E=; b=xHZNba1VTMwN07CNkHfi2iUYXmEh17PCbk83nLLoRpxG4kKHZQt/vbvrAvKAp/KGtdFu opl2iLP2yck+LRA3R9TtMvdq8tH7rsTe1T7q9Z9Xwvwpk9iifCNfLIa4CkYV5LUsGaUXv 2rWwJFZXDG6pQZSGfk6lFzWzbQ5ijmpnU85iC09oFDvQgiH7V39jiktnQNUD1tmm3O6W+ NugU5i0695He0DFp4cQTWO+5pKxFkqxt8YJG1bHRYdpOgp0iEjPadxGF4wCuExzmXA6AF xFiTPUQxj1N3PRwOVRmwszQ/qsLUhN2LPhCJU/y4LC7oI/WDtCy6GYJccXO9B5JyBog== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AYd9m6Lx; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE7E8606A31F; Sat, 5 Dec 2026 22:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AYd9m6Lx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21AB71F0092B; Sat, 5 Dec 2026 22:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796510547; bh=l2SA6Sy1zJsg5GoGzQKUjRIWmUWWTBCNC+x0HBbob5E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=AYd9m6LxwIpgWlKMZTZVTzdEhqa6LuAOaTTDD0Epuj6elBuOprZKfAzRdCUvd5Qpv t5LMhivGLDQG5yVR617TFmdoyYMVYq/9v00OV9XxNzPJPhXV02AKda4uqeb6aYQZ3t Z7tAXa7PjQRVr4Xw2/WiRXFcxoX+nY3ee0+qYbIuhCWzyiG4/KrgYZC0JGX9uPoNqB 9TQzbU/5AC2KaNfNbYiaPU19aSr6WPQQ30lMAn4K2xK1dtgL+v4OI/sxOKlTQEJbF9 XWY1CtKfy7Awza1HbDKcgCoCccVLd4XTPnmo/qtNzAEoZU/3lnTzwq67IQ4OFPNyUx EYqUjA477cvOw== Date: Sat, 5 Dec 2026 22:42:20 +0000 From: Jonathan Cameron To: Neil Armstrong Cc: David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Jonathan Corbet , Shuah Khan , Randy Dunlap , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux@analog.com, linux-doc@vger.kernel.org, Conor Dooley , Marius Cristea , Andy Shevchenko Subject: Re: [PATCH v8 0/5] iio: adc: add support for the MAX34417 Four-Channel High Dynamic Range Power Accumulator Message-ID: <20261205224220.26f7fed2@jic23-hlaptop> In-Reply-To: <20261130-topic-sm8x50-iio-max34417-adc-v8-0-6efef2782816@linaro.org> References: <20261130-topic-sm8x50-iio-max34417-adc-v8-0-6efef2782816@linaro.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 30 Nov 2026 17:30:34 +0100 Neil Armstrong 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 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