Skip to content

Conversation

@stefpopa
Copy link
Collaborator

PR Description

This PR adds initial Linux kernel driver support for the Analog Devices ADRV904X (Koror) family of wideband transceivers.

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
@gastmaier
Copy link
Collaborator

gastmaier commented Jan 27, 2026

Can drivers/iio/adc/adrv904x/initdata.c and drivers/iio/adc/adrv904x/initdata.h are API files right?
can they placed under any of the rules below?

local api_match="(public/include|public/src|private/include|private/src|navassa/common|adrv902x/common|adrv903x/common|adrv903x/platforms)/"

the rules are at https://github.com/analogdevicesinc/linux/blob/ci/ci/build.sh#L35
feel free to adjust if needed, but focus on 'containerizing' the API code.

The license.pdf is a no no, please remove

All files should have unix endings, even api ones, csv, etc, use dos2unix to convert

I will now take a look on the build_gcc_arm

@gastmaier
Copy link
Collaborator

The api is generating calls to __aeabi_uldivmod(), only compatible with arm64 due to u64 operations.
please check if you can do it in 32 bits, divide first, find gcd (lib/math/gcd.c), etc.
and provide back to the api unit
If not possible, please isolate the 64bit bits into defines, so we don't have to blacklist the whole driver as 'arm64-compatible only'

thanks!

@gastmaier
Copy link
Collaborator

0001-API-dirty-adrv904x-use-math64-and-gcd.patch
Attached should do the trick, please read commit message body.

@stefpopa stefpopa force-pushed the staging/koror_support branch 2 times, most recently from 8a508b1 to 3c1012d Compare January 28, 2026 12:16
danmois and others added 7 commits January 28, 2026 15:46
Add Koror API 2.15.0.5.

Signed-off-by: George Mois <george.mois@analog.com>
Add binaries to be used with the ADRV904X driver.

New adrv904x firmware to reflect the two available use cases,
without ORX (default profile) and with ORX (NLS profile)

Signed-off-by: George Mois <george.mois@analog.com>
Signed-off-by: Andrei Dragomir <andrei.dragomir@analog.com>
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Add the ADRV9040 initial driver including:
- Core driver implementation with JESD204 support
- IIO channel definitions and read/write operations
- Clock framework integration
- Linux platform abstraction layer

Signed-off-by: George Mois <george.mois@analog.com>
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Add dts file for adrv904x (Koror).

Signed-off-by: George Mois <george.mois@analog.com>
Add support for observation receiver (ORX) channels including:
- Add OBS_SAMPL_CLK clock for ORX sampling rate
- Differentiate between RX and OBS_RX channels in read_raw
- Add axi-adrv904x-obs compatible string support

This enables the use case with ORX in NLS mode.

Signed-off-by: George Mois <george.mois@analog.com>
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
New adrv904x dts to implement the use case with ORX in NLS mode

Signed-off-by: AndrDragomir <andrei.dragomir@analog.com>
Direct 64-bit division on ARM32 causes undefined references to
__aeabi_uldivmod and __aeabi_ldivmod. Add platform abstraction
wrappers in adi_library_types.h for division operations and use
them throughout the driver.

Use GCD reduction before squaring in scale_with_squared_ratio()
to prevent overflow in power threshold calculations.

Co-authored-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
@stefpopa stefpopa force-pushed the staging/koror_support branch from 3c1012d to a37e455 Compare January 28, 2026 13:49
@stefpopa
Copy link
Collaborator Author

@gastmaier thank you for your review. See the changelog below:

  • Moved initdata.c/initdata.h to devices/adrv904x/private/src/ per API directory structure requirements
  • Updated Makefile with new paths and include directory
  • Updated adrv904x.c include path (now resolved via Makefile)
  • Removed License.pdf
  • Fixed CRLF line endings in initdata.c
  • added your arm32 build patch which to which I added a platform abstraction layer in adi_library_types.h, as per a request made by Sean Harte
  • Added kernel math64/gcd includes
  • Created ADI_LIBRARY_DIV_* and ADI_LIBRARY_GCD wrapper macros
@stefpopa stefpopa force-pushed the staging/koror_support branch from 5fb6eed to fa6d679 Compare January 28, 2026 15:26
@gastmaier
Copy link
Collaborator

gastmaier commented Jan 28, 2026

Hi,

is adrv904x/platforms API right? so I added to the
https://github.com/analogdevicesinc/linux/blob/ci/ci/build.sh#L35
as a broad

"(public/include|public/src|private/include|private/src|iio/adc/.*/common|iio/adc/.*/platforms)/"

rule

@gastmaier
Copy link
Collaborator

gastmaier commented Jan 28, 2026

Adding new comment to fixup my last comment, you did fix the line endings at
fa6d679

but checkpatch checks per commit

What you can do, if you don't want to force push, is to create a fixup commit with

git commit -s --fixup 7c27e7ba145863d1d069fd9bf8b1d34c5d890511 -m "optional extra msg"

Those commits are intentionally auto squashed during the ci
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
@stefpopa stefpopa force-pushed the staging/koror_support branch from fa6d679 to 1405cc2 Compare January 29, 2026 08:29
@stefpopa
Copy link
Collaborator Author

Hi,

is adrv904x/platforms API right? so I added to the https://github.com/analogdevicesinc/linux/blob/ci/ci/build.sh#L35 as a broad

"(public/include|public/src|private/include|private/src|iio/adc/.*/common|iio/adc/.*/platforms)/"

rule

Yes, adrv904x/platforms contains the platform abstraction layer (adi_library_types.h, adi_library.c). Thanks for adding the board rule!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants