From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
Matti Vaittinen <matti.vaittinen@linux.dev>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: dac: rohm-bd79703: Fix full-scale voltages
Date: Mon, 30 Nov 2026 10:28:13 +0200 [thread overview]
Message-ID: <d99a933c-f4dc-41f5-ad1a-35415281e961@gmail.com> (raw)
In-Reply-To: <20261128035336.0ad3ba76@jic23-hlaptop>
On 28/11/2026 05:53, Jonathan Cameron wrote:
> On Thu, 26 Nov 2026 15:23:10 +0200
> Matti Vaittinen <matti.vaittinen@linux.dev> wrote:
>
>> From: Matti Vaittinen <mazziesaccount@gmail.com>
>>
>> The BD79702 and BD79703 have a VFS pin which can be used to supply a
>> full-scale voltage to be output with maximum DAC word. The driver
>> assumes this voltage is the full-scale voltage for all of the DAC
>> channels. This, however, is not true.
>>
>> The VFS-pin voltage is only used for the first half of the channels. Eg.
>> on BD79703, channels AO1 and AO2 use VFS, AO3 and, AO4 use the VCC.
>> Similarly, the BD79703 channels AO1, AO2, and, AO3 use VFS, AO4, AO5, and
>> AO6 use the VCC.
>>
>> Fix the driver to use correct full-scale voltages (VCC instead of VFS) on
>> the last channels of the BD79702 and BD79703. The BD79700 and BD79701
>> logic should not be changed.
>>
>> NOTE: This change is visible to the user-space, it makes the scale a
>> per-channel property so the sysFS file out_voltage_scale gets replaced
>> by per-channel variants out_voltageN_scale
>>
>> Fixes: af6aca656a85 ("iio: dac: Support ROHM BD79703 DAC")
>> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Enjoy the side discussion. I'm going to take the expedient path and
> just merge this. Applied to the fixes-togreg branch of iio.git.
Thanks for applying the fix!
> This wins one of those awards for generally odd things to build
> in hardware.
I kind of understand the idea of the HW design. It allows having two
different scale outputs from single IC. For example, 0-3V and 0-5V,
while having all the DAC steps available for both scales. There may be
designs which benefit from this.
But I agree it is odd, and it totally caught me off guard. I only
noticed this when started adding support for the series of next
generation DAC ICs, bd7971[0-3]. They have the same design. It does not
really help that data-sheets do not explicitly say the VCC is used as a
full-scale voltage for some of the outputs. I just happened to notice
the VFS pin was actually said to be full-scale voltage for AO1, AO2 and
AO3 on a device having 6 channels. The full-scale voltage for the rest
of the outputs just weren't mentioned at all.
Then, one of the block diagrams did have VCC written to a box for some
AOs and VFS for others, but at least I missed this when I wrote drivers
for BD7970x. Oh, and I used same voltage for VCC and VFS in my test
setups :rolleyes:
Well, I confirmed this from the HQ designers - hopefully the fix does
not come too late to some of the users... This had a real chance of
frying-up something :|
Yours,
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductor
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
prev parent reply other threads:[~2026-11-30 8:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 13:23 Matti Vaittinen
2026-11-26 13:31 ` Joshua Crofts
2026-11-27 6:34 ` Matti Vaittinen
2026-11-27 11:03 ` Andy Shevchenko
2026-11-27 11:46 ` Matti Vaittinen
2026-11-27 12:08 ` Andy Shevchenko
2026-11-27 15:57 ` Andy Shevchenko
2026-11-30 7:06 ` Matti Vaittinen
2026-11-30 7:01 ` Matti Vaittinen
2026-11-28 3:53 ` Jonathan Cameron
2026-11-30 8:28 ` Matti Vaittinen [this message]
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=d99a933c-f4dc-41f5-ad1a-35415281e961@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@linux.dev \
--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
all inboxes | Powered by JetHome®