Re: [PATCH] iio: dac: rohm-bd79703: Fix full-scale voltages
From: Matti Vaittinen
Date: Mon Nov 30 2026 - 03:28:22 EST
On 28/11/2026 05:53, Jonathan Cameron wrote:
On Thu, 26 Nov 2026 15:23:10 +0200
Matti Vaittinen <matti.vaittinen@xxxxxxxxx> wrote:
From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>Enjoy the side discussion. I'm going to take the expedient path and
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@xxxxxxxxx>
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! ~~