Conversation
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)
mhennerich
requested review from
CiprianRegus,
amiclaus,
btogorean,
buha,
chegbeli,
danmois,
dbogdan,
machschmitt,
nunojsa,
rbolboac and
stefpopa
as code owners
September 16, 2026 12:01
nunojsa
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_selectattribute programs the sniffer ADC mux immediately,but never updates
sniffer_config.pgm.adc, which keeps its probe-timedefault of
ADI_APOLLO_ADC_0.adi_apollo_sniffer_pgm()internally callsadi_apollo_sniffer_adc_mux_set()withpgm.adc, and the driver runs itfrom
buffer_postenable()on a copy ofsniffer_config. So the moment acapture starts the mux is switched back to ADC0, and selecting
adc1hasno visible effect on the captured spectrum.
Keep
pgm.adcin sync with the user selection so the value programmed onbuffer enable matches what was requested.
2. Redundant
side_selassignment in sniffer probeThe
switchonside_selalready stores the matchingadi_apollo_sniffer_select_einst->side_sel; a later unconditionalassignment overwrites it with the
adi_apollo_side_select_eparameter.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 supportcommit (81b4aed).
Compile-tested for arm64 (
adi_zynqmp_defconfig,CONFIG_AD9088=y).PR Type
PR Checklist