Skip to content

Staging/fix init cal channel mask - #3469

Open
stefpopa wants to merge 2 commits into
mainfrom
staging/fix-init-cal-channel-mask
Open

Staging/fix init cal channel mask#3469
stefpopa wants to merge 2 commits into
mainfrom
staging/fix-init-cal-channel-mask

Conversation

@stefpopa

Copy link
Copy Markdown
Collaborator

PR Description

When triggering initial calibrations via the 'calibrate' sysfs attribute, the driver unconditionally overwrites the user-configured channel masks (rx, tx, orx) with the profile defaults. This prevents users from running calibrations on specific channels only.
For example, setting calibrate_tx_channel_mask to 0x01 (channel 0 only) would be overwritten to 0xFF (all channels) when writing 1 to calibrate.
Fix this by only applying the profile defaults when the user hasn't set a custom channel mask (i.e., when the mask is 0). This matches the behavior of the adrv9025 driver.

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

stefpopa added 2 commits July 31, 2026 09:49
When triggering initial calibrations via the 'calibrate' sysfs attribute,
the driver unconditionally overwrites the user-configured channel masks
(rx, tx, orx) with the profile defaults. This prevents users from running
calibrations on specific channels only.

For example, setting calibrate_tx_channel_mask to 0x01 (channel 0 only)
would be overwritten to 0xFF (all channels) when writing 1 to calibrate.

Fix this by only applying the profile defaults when the user hasn't set
a custom channel mask (i.e., when the mask is 0). This matches the
behavior of the adrv9025 driver.

Fixes: 972f2f0 ("iio: trx-rf: Add ADRV9040 support")
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
When triggering initial calibrations via the 'calibrate' sysfs attribute,
the driver unconditionally overwrites the user-configured channel masks
(rx, tx, orx) with the profile defaults. This prevents users from running
calibrations on specific channels only.

For example, setting calibrate_tx_channel_mask to 0x01 (channel 0 only)
would be overwritten to 0xFF (all channels) when writing 1 to calibrate.

Fix this by only applying the profile defaults when the user hasn't set
a custom channel mask (i.e., when the mask is 0). This matches the
behavior of the adrv9025 driver.

Fixes: 1b4e2c9 ("iio: trx-rf: Add ADRV903X support")
Signed-off-by: Stefan Popa <stefan.popa@analog.com>

@danmois danmois left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

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