[PATCH] iio: dac: adi-axi-dac: fix swapped arguments in axi_dac_set_sample_rate()

From: Nuno Sá

Date: Fri Nov 13 2026 - 12:13:37 EST


When the interface sample rate changes, the DDS frequencies of both
tones are read back and reprogrammed so they are preserved against the
new rate. However, the tone index and the frequency were passed in the
wrong order to __axi_dac_frequency_set().

Pass the arguments in the order the function expects.

Fixes: 4e3949a192e4 ("iio: dac: add support for AXI DAC IP core")
Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
---
AI was used to generate the commit message which I looked at and removed
the extra verbosity.
---
drivers/iio/dac/adi-axi-dac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c
index f4f3bc67c68e..1e2f7f27292d 100644
--- a/drivers/iio/dac/adi-axi-dac.c
+++ b/drivers/iio/dac/adi-axi-dac.c
@@ -596,7 +596,7 @@ static int axi_dac_set_sample_rate(struct iio_backend *back, unsigned int chan,
if (ret)
return ret;

- ret = __axi_dac_frequency_set(st, chan, sample_rate, tone, freq);
+ ret = __axi_dac_frequency_set(st, chan, sample_rate, freq, tone);
if (ret)
return ret;
}

---
base-commit: b70566610b48ba49dec636019da4d696db64b085
change-id: 20261113-iio-fix-axi-dac-b7b401cb06d4
--

Thanks!
- Nuno Sá