public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Taha Ed-Dafili <0rayn.dev@gmail.com>
To: linux-iio@vger.kernel.org
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org
Subject: [RFC] iio: dac: ad5504: Inquiry regarding voltage scale calculation
Date: Tue, 10 Feb 2026 07:10:32 -0500	[thread overview]
Message-ID: <20260210121032.4630-1-0rayn.dev@gmail.com> (raw)

Greetings everyone,

I've been reviewing the ad5504 driver and comparing it with
the datasheet, and I want to verify my understanding of a potential
discrepancy.

Datasheet:

https://www.analog.com/media/en/technical-documentation/data-sheets/ad5504.pdf

The Issue:

The driver currently uses the vcc regulator voltage to calculate the
output scale. However, the datasheet (Rev B, Page 1) states the device has
an integrated precision reference. The output range (0-30V or 0-60V) is
determined by the R_SEL pin, not the supply voltage.

If my understanding is correct, using vcc for scaling is flawed.
For example, a 40V supply currently results in a ~9.7mV scale
(40V / 4096), whereas the hardware output (in 30V mode) is fixed
at ~7.32mV (30V / 4096).

My Questions:

1. Is it correct to replace the VCC-based scaling with fixed constants?
2. To support the 60V range, the driver needs to know the state of the
`R_SEL` pin. What is the preferred way to handle this hardware
configuration in the bindings?

If you can confirm this and provide guidance on the binding, I would
be happy to prepare a patch to address it.

Thanks,
Taha

             reply	other threads:[~2026-02-10 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10 12:10 Taha Ed-Dafili [this message]
2026-02-10 16:45 ` [RFC] iio: dac: ad5504: Inquiry regarding voltage scale calculation David Lechner
2026-02-11 11:06   ` Taha Ed-Dafili

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=20260210121032.4630-1-0rayn.dev@gmail.com \
    --to=0rayn.dev@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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