Skip to content

Staging/xlnx/ad9081 jrx update#3123

Open
mhennerich wants to merge 3 commits intomainfrom
staging/xlnx/ad9081-jrx-update
Open

Staging/xlnx/ad9081 jrx update#3123
mhennerich wants to merge 3 commits intomainfrom
staging/xlnx/ad9081-jrx-update

Conversation

@mhennerich
Copy link
Contributor

PR Description

  • Add JESD204C RX foreground calibration status checking to the AD9081 driver,
    along with new debugfs attributes for runtime tuning.
  • Calibration status check: Introduce two new API functions
    (adi_ad9081_jesd_rx_calibrate_204c_lane_status_get and
    adi_ad9081_jesd_rx_calibrate_204c_status_get) that read per-lane calibration
    status, goodness metric, and SPO values from hardware registers (r2 silicon).
    The driver now checks calibration results after foreground calibration in the
    JESD204 clks_enable path, logging diagnostics and returning -EFAULT on
    failure.
  • Debugfs recalibration attribute: Replace the multichip_sync case 20
    recalibration path with a dedicated jesd_rx_recalibrate_204c debugfs
    attribute. Writing 1 triggers recalibration with full status reporting.
    Returns -ENOTSUPP for non-204C links and -ERANGE if the lane rate is below
    the calibration threshold.
  • Debugfs TPL phase adjust: Add adi,tpl-phase-adjust-link0 and
    adi,tpl-phase-adjust-link1 debugfs attributes for runtime tuning of the JRX
    LMFC delay (TPL phase adjust) without requiring device tree changes and reboot.
  • Files changed: drivers/iio/adc/ad9081.c, drivers/iio/adc/ad9081/adi_ad9081.h,
    drivers/iio/adc/ad9081/adi_ad9081_jesd.c

PR Type

  • New feature (a change that adds new functionality)

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

Copy link
Collaborator

@stefpopa stefpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks and questions, but overall LGTM.

@mhennerich mhennerich force-pushed the staging/xlnx/ad9081-jrx-update branch from f4cb185 to 5741d73 Compare February 12, 2026 07:57
Add support for reading the JESD204C receiver foreground calibration
status after calibration completes. This allows the driver to detect
calibration failures early and report diagnostic information.

Introduce two new API functions:
- adi_ad9081_jesd_rx_calibrate_204c_lane_status_get(): reads per-lane
  calibration status, goodness metric, and SPO values from hardware
  registers (0x21E0-0x21E2 per lane, r2 silicon only).
- adi_ad9081_jesd_rx_calibrate_204c_status_get(): aggregates results
  across all active lanes, reporting worst-case goodness/SPO and a
  bitmask of any failed lanes.

Add the adi_ad9081_jrx_fg_cal_result_t structure to carry the
calibration result (status, failed lane mask, goodness, left/right SPO).

In the ad9081 driver, call the status check after foreground calibration
in the JESD204 clks_enable path. If calibration fails, log the failed
lane mask and return -EFAULT. On success, log the goodness and SPO
values for diagnostic purposes.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
…gfs attribute

Remove multichip_sync case 20 which provided JESD204C RX
foreground recalibration via the multichip_sync interface.

Replace with a dedicated "jesd_rx_recalibrate_204c" debugfs attribute
using the existing debugfs infrastructure. Writing '1' to the attribute
triggers recalibration. Returns -ENOTSUPP if the JESD version is not
204C and -ERANGE if the lane rate is below the calibration threshold.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Add per-link debugfs attributes "adi,tpl-phase-adjust-link0" and
"adi,tpl-phase-adjust-link1" to allow runtime tuning of the JESD RX
LMFC delay (TPL phase adjust) without requiring a device tree change
and reboot. The attributes support both read and write access.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich mhennerich force-pushed the staging/xlnx/ad9081-jrx-update branch from 5741d73 to 0314d2c Compare February 12, 2026 08:12
@stefpopa stefpopa self-requested a review February 12, 2026 08:16
Copy link
Collaborator

@stefpopa stefpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits

return ret;

dev_info(&phy->spi->dev, "running jesd_rx_calibrate_204c, LR %lu kbps",
phy->jrx_link_tx[0].lane_rate_kbps);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of a nitpick but I would put the above as dbg()

if (ret != 0)
return ret;

msleep(10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fsleep()

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.

3 participants