Devicetree
 help / color / mirror / Atom feed
From: Taha Ed-Dafili <0rayn.dev@gmail.com>
To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	skhan@linuxfoundation.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Taha Ed-Dafili <0rayn.dev@gmail.com>
Subject: [PATCH v3 0/5] iio: dac: ad5504: bindings, cleanups, and scale fixes
Date: Sat,  9 May 2026 15:20:38 +0100	[thread overview]
Message-ID: <20260509142047.30302-1-0rayn.dev@gmail.com> (raw)

Hi everyone,

First, I want to sincerely apologize for the long delay between v2 and v3.
I had to step away to focus on finishing my last year studies, but I am
back now to get this series over the finish line!

This v3 series addresses the feedbacks from the v2 review,
specifically focusing on strict DT validation, dropping unnecessary
driver code, and making sure the driver works perfectly at every
individual commit.

Testing & Hardware Proof:
The series has been physically verified on an ARM64 Raspberry Pi 5 using
a custom Device Tree overlay.

The AD5504 is a 12-bit DAC. The hardware scale outputs
now perfectly match the DT inputs:

Testing the 60V path (output-range-microvolt = <0 60000000>):
$ cat /sys/bus/iio/devices/iio:device0/out_voltage_scale
14.648437500  (60000mV / 4096)

Testing the 30V path (output-range-microvolt = <0 30000000>):
$ cat /sys/bus/iio/devices/iio:device0/out_voltage_scale
7.324218750   (30000mV / 4096)

Additionally, providing invalid DT configurations (e.g., 70V) successfully
triggers the strict bounds checking and cleanly aborts the probe with
-EINVAL.

Changes in v3:

* Dropped the patch adding GPIO control for /CLR and /LDAC. As pointed out
  by Nuno Sá, since the driver does not actively handle or toggle these
  pins, requesting them in the driver is dead code. They remain documented
  in the bindings.
* Combined the pdata removal, regulator _enable swap, and DT parsing into
  a single atomic commit (Patch 5) so the driver compiles and runs cleanly
  at every step of the git history.
* Restored the -ENODEV check for the regulator to maintain ACPI
  compatibility.
* Implemented strict min/max array bounds validation for the
  'output-range-microvolt' property.
* Included missing <linux/array_size.h>, <asm/byteorder.h>, and
  <linux/kstrtox.h> headers for full IWYU compliance.
* Reordered commits to group cleanups before functional changes.
* Dropped Suggested-by tags for standard review feedback.

Changes in v2:

* Replaced vendor-specific adi,output-range-volts with the standard
  output-range-microvolt property array.
* Replaced adi,output-range-gpios with standard range-sel-gpios.
* Split header updates into two patches: alphabetical sorting and IWYU
  compliance.
* Used MILLI and MICRO macros to replace hardcoded values.
* Introduced a local dev pointer to respect the 80-character limit and
  realigned function arguments.

Previous versions:
v2: https://lore.kernel.org/linux-iio/20260310174835.24209-1-0rayn.dev@gmail.com/
v1: https://lore.kernel.org/linux-iio/20260212181955.42724-1-0rayn.dev@gmail.com/
RFC: https://lore.kernel.org/linux-iio/20260210121032.4630-1-0rayn.dev@gmail.com/

Thank you to Jonathan Cameron, Krzysztof Kozlowski, Andy Shevchenko,
Nuno Sá, and David Lechner for the extensive reviews, schema guidance,
and C optimizations throughout this series.

Taha Ed-Dafili

Taha Ed-Dafili (5):
  dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  iio: dac: ad5504: sort headers alphabetically
  iio: dac: ad5504: Align headers with IWYU principle
  iio: dac: ad5504: introduce local dev pointer
  iio: dac: ad5504: fix scale via output-range-microvolt

 .../bindings/iio/dac/adi,ad5504.yaml          | 39 +++++++++++-
 drivers/iio/dac/ad5504.c                      | 63 +++++++++++--------
 2 files changed, 74 insertions(+), 28 deletions(-)

-- 
2.47.3


             reply	other threads:[~2026-05-09 14:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 14:20 Taha Ed-Dafili [this message]
2026-05-09 14:20 ` [PATCH v3 1/5] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
2026-05-09 14:45   ` sashiko-bot
2026-05-09 14:20 ` [PATCH v3 2/5] iio: dac: ad5504: sort headers alphabetically Taha Ed-Dafili
2026-05-09 14:20 ` [PATCH v3 3/5] iio: dac: ad5504: Align headers with IWYU principle Taha Ed-Dafili
2026-05-09 14:55   ` sashiko-bot
2026-05-09 14:20 ` [PATCH v3 4/5] iio: dac: ad5504: introduce local dev pointer Taha Ed-Dafili
2026-05-09 14:20 ` [PATCH v3 5/5] iio: dac: ad5504: fix scale via output-range-microvolt Taha Ed-Dafili
2026-05-09 14:57   ` Jonathan Cameron
2026-05-09 15:29   ` sashiko-bot
2026-05-09 20:59   ` David Lechner
2026-05-09 20:46 ` [PATCH v3 0/5] iio: dac: ad5504: bindings, cleanups, and scale fixes David Lechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260509142047.30302-1-0rayn.dev@gmail.com \
    --to=0rayn.dev@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox