Skip to content

Staging/adrv903x ram capture - #3445

Open
stefpopa wants to merge 2 commits into
mainfrom
staging/adrv903x_ram_capture
Open

Staging/adrv903x ram capture#3445
stefpopa wants to merge 2 commits into
mainfrom
staging/adrv903x_ram_capture

Conversation

@stefpopa

@stefpopa stefpopa commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

PR Description

  • Add debugfs interface for quick single-shot RX/ORx RAM captures
  • Add full IIO device (adrv903x-ramc) with I/Q channel support and buffer infrastructure

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

Add a debugfs interface for quick single-shot RX/ORx data captures from
the ADRV903x RAM capture hardware. This provides a simple way to capture
raw ADC samples for debugging and signal analysis.

Usage:
  echo "<channel> <length>" > /sys/kernel/debug/iio/iio:deviceX/rx_data_capture
  cat /sys/kernel/debug/iio/iio:deviceX/rx_data_capture

Where channel is 0-7 for RX0-RX7 or 8-9 for ORX0-ORX1, and length is one
of the hardware-supported capture sizes (32 to 32768 samples).

The memory allocation is done before taking the mutex to allow sleeping
allocations (GFP_KERNEL) without holding the device lock.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Add a full IIO device (adrv903x-ramc) for RX/ORx RAM capture with proper
I/Q channel support and IIO buffer infrastructure.

Features:
- 10 I/Q channel pairs: voltage0_i/q through voltage9_q (RX0-7, ORX0-1)
- Single-shot capture triggered by buffer enable
- Hardware constraint enforcement via available_scan_masks (one channel
  pair at a time)
- Configurable sample count via sample_count sysfs attribute
- 28-bit signed I/Q data with proper sign extension and bank demuxing

The capture hardware can only sample one RX/ORX channel at a time, which
is enforced through available_scan_masks. Users can capture data using
iio_readdev or IIO Oscilloscope.

Example usage:
  iio_readdev -u local: -s 1024 adrv903x-ramc voltage0_i voltage0_q

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
@stefpopa
stefpopa force-pushed the staging/adrv903x_ram_capture branch from 31fde24 to 57266eb Compare July 22, 2026 09:28
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.

1 participant