Skip to content

[2026_R1] iio: trx-rf: ad9088: fix FFT sniffer ADC select and side select - #3546

Merged
nunojsa merged 2 commits into
xlnx/release/v6.12.y-2026r1from
xlnx/release/2026r1/fix-ad9084-sniffer-sel
Sep 17, 2026
Merged

nunojsa merged 2 commits into
xlnx/release/v6.12.y-2026r1from
xlnx/release/2026r1/fix-ad9084-sniffer-sel

Conversation

@mhennerich

Copy link
Copy Markdown
Contributor

Backport of #3544 to the 2026 R1 release branch (Fixes: tags rewritten to the release branch hash of the initial APOLLO commit).

PR Description

Two fixes for the AD9084/AD9088 FFT spectrum sniffer (ad9088_fft.c).

1. adc_select is silently reverted to ADC0 on every buffer enable

Writing the adc_select attribute programs the sniffer ADC mux immediately,
but never updates sniffer_config.pgm.adc, which keeps its probe-time
default of ADI_APOLLO_ADC_0. adi_apollo_sniffer_pgm() internally calls
adi_apollo_sniffer_adc_mux_set() with pgm.adc, and the driver runs it
from buffer_postenable() on a copy of sniffer_config. So the moment a
capture starts the mux is switched back to ADC0, and selecting adc1 has
no visible effect on the captured spectrum.

Keep pgm.adc in sync with the user selection so the value programmed on
buffer enable matches what was requested.

2. Redundant side_sel assignment in sniffer probe

The switch on side_sel already stores the matching
adi_apollo_sniffer_select_e in st->side_sel; a later unconditional
assignment overwrites it with the adi_apollo_side_select_e parameter.
The two enums share the same values today so this is harmless, but it is
confusing and would silently break if either enum changed. Drop it.

Both commits carry a Fixes: tag pointing at the initial APOLLO support
commit (81b4aed).

Compile-tested for arm64 (adi_zynqmp_defconfig, CONFIG_AD9088=y).

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

Writing the adc_select attribute programs the sniffer ADC mux right
away, but never updates sniffer_config.pgm.adc, which stays at the
ADI_APOLLO_ADC_0 default set at probe. adi_apollo_sniffer_pgm() calls
adi_apollo_sniffer_adc_mux_set() itself using pgm.adc, and the driver
runs it from buffer_postenable() with a copy of sniffer_config. So every
capture silently switches the mux back to ADC0, and selecting adc1 has
no visible effect on the captured spectrum.

Keep pgm.adc in sync with the user selection so the value programmed on
buffer enable matches what was requested.

Fixes: 9987978 ("iio: trx-rf: ad9088: Add initial support for APOLLO")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
(cherry picked from commit c032839)
The switch on side_sel already stores the matching
adi_apollo_sniffer_select_e value in st->side_sel. The later
unconditional assignment overwrites it with the
adi_apollo_side_select_e parameter. The two enums happen to share the
same values, so this is harmless today, but it is confusing and would
silently break if either enum ever changed. Remove the duplicate.

Fixes: 9987978 ("iio: trx-rf: ad9088: Add initial support for APOLLO")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
(cherry picked from commit 0c858ab)
@nunojsa
nunojsa merged commit b47bbbe into xlnx/release/v6.12.y-2026r1 Sep 17, 2026
35 checks passed
@nunojsa
nunojsa deleted the xlnx/release/2026r1/fix-ad9084-sniffer-sel branch September 17, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants