Re: [PATCH 1/6] dt-bindings: iio: adc: Add AD7768

From: Janani Sunil

Date: Tue Jul 21 2026 - 04:03:45 EST



On 7/21/26 03:39, David Lechner wrote:
On 7/20/26 9:00 AM, Janani Sunil wrote:
On 7/9/26 17:43, David Lechner wrote:
On 7/9/26 3:50 AM, Janani Sunil wrote:
Devicetree Bindings for AD7768-4 (4 channel) and AD7768 (8 channel)
simultaneous sampling ADC

Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
---
+
+  adi,power-mode:
+    $ref: /schemas/types.yaml#/definitions/string
+    enum:
+      - low
+      - median
+      - fast
+    description:
+      Power mode selection.
Unless there are pins that control this, it seems like it should be
left up to the driver to decide how to set this.

In this case, it looks like the power mode also influences sample rate
which is normally something controlled at runtime.
Looking at this again, there is also an MCLK divider that influences
sample rate, so sampling_frequency to power mode is not straight-forward
anyway.

Hi David,

The reason we'd like to retain power mode control is that certain ODRs are supported across all three power modes (low/median/fast), and the RMS noise and power consumption differ significantly between them at the same ODR.

The higher the power mode, the better the noise performance, but power consumption nearly doubles for every ~3 dB improvement in dynamic range. Silently selecting one power mode in the driver would remove a meaningful hardware tradeoff from the user.

We'd like to propose the following instead:
- Remove adi,power-mode from the DT as suggested.
- Expose power mode as a per-device sysfs attribute.
- in_voltage<N>_sampling_frequency_available dynamically reflects only the ODRs valid for the currently selected power mode.

This keeps the DT clean while still giving the user explicit control over the noise versus power trade off. Would this approach be acceptable?

Thanks,
Jan


Jonathan usually pushes back against userspace power controls. We do have
this for accelerometers, but not ADCs currently.

If we can't think of anything better, maybe we could use this. It only
has low_noise and low_power options though, so the driver would still
need to chose the best power mode of the 3 based on the other requested
parameters. E.g. always make all sampling_frequency available and just
pick the highest power or lowest power mode that can provide that rate
based on the power_mode attribute.

I wanted to suggest maybe adding some kind of noise attribute instead,
but I'm not sure how we could do that in a way using SI units since the
value would depend on so many things (at least V_REF voltage, filter type,
temperature and even the physical input).

We considered the low_power/balanced/low_noise approach, but the customers typically use the datasheet alongside the driver and the datasheet explicitly uses the terms "low power", "median" and "fast" for the three modes. Abstracting them with different names in the sysfs attribute would create a confusion- the users would have to mentally translate between the two naming conventions.
The noise attribute would not actually configure anything on a register level- it would purely be informational. Furthermore, noise performance is not solely determined by the power mode. There are other parameters (eg. filter mode) that has a significant impact. A power_mode attribute directly configures the hardware register and has a deterministic effect on the device.

Jonathan, could we keep the power_mode as an attribute in this case?