Skip to content

Conversation

@BrentK-ADI
Copy link
Collaborator

@BrentK-ADI BrentK-ADI commented Jan 29, 2026

PR Description

This corrects the implementation of the external VCO functionality for the HMC7044. The existing implementation treated the external VCO mode similar to HMC7043, with CLKIN1 (FIN) being a reference clock for the dividers, bypassing PLL1 and PLL2. This is not the intended functionality of this device mode.

With external VCO mode, PLL1 remains active, using the reference inputs as with normal operation. The PLL2 loop is also closed, with CLKIN1 (FIN) being the VCO, rather than the internal VCO.

There were several changes required to accomodate this:

  • The external VCO has wider frequency limits. PLL2 bounds checks
    are based on the VCO source
  • CLKIN1 is no longer used as the PLL2 frequency, using the
    adi,pll2-output-frequency dt property for both nodes
  • PLL1 and PLL2 must be enabled in both modes
  • Corrected status reporting when external VCO is enabled
  • Remove external VCO as a condition for sync configuration

Additionally, a device tree flag to enable inversion of PLL2 PFD was added to support external VCO loop filters which have an inversion.

Fixes #3061

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

This corrects the implementation of the external VCO functionality
for the HMC7044. The existing implementation treated the external
VCO mode similar to HMC7043, with CLKIN1 (FIN) being a reference
clock for the dividers, bypassing PLL1 and PLL2.  This is not the
intended functionality of this device mode.

With external VCO mode, PLL1 remains active, using the reference
inputs as with normal operation.  The PLL2 loop is also closed,
with CLKIN1 (FIN) being the VCO, rather than the internal VCO.

There were several changes required to accomodate this:
 - The external VCO has wider frequency limits. PLL2 bounds checks
   are based on the VCO source
 - CLKIN1 is no longer used as the PLL2 frequency, using the
   adi,pll2-output-frequency dt property for both nodes
 - PLL1 and PLL2 must be enabled in both modes
 - Corrected status reporting when external VCO is enabled
 - Remove external VCO as a condition for sync configuration

Signed-off-by: Brent Kowal <brent.kowal@analog.com>
Adds the adi,pll2-pfd-invert-enable flag to the bindings file.

Signed-off-by: Brent Kowal <brent.kowal@analog.com>
Adds the adi,pll2-pfd-invert-enable device tree property to support
changing the polarity of the PLL2 PFD.  This is useful for utilizing
an external VCO for PLL 2 which has an inversion in the loop filter.

Signed-off-by: Brent Kowal <brent.kowal@analog.com>
@BrentK-ADI BrentK-ADI changed the title HMC7044 External VCO Mode Fixes iio: frequency: hmc7044: External VCO Mode Fixes Jan 29, 2026
@gastmaier gastmaier changed the base branch from main to main-xlnx-llm-reviews February 4, 2026 10:19
@gastmaier gastmaier closed this Feb 4, 2026
@gastmaier gastmaier reopened this Feb 4, 2026
@gastmaier gastmaier changed the base branch from main-xlnx-llm-reviews to main February 4, 2026 10:44
@BrentK-ADI BrentK-ADI marked this pull request as ready for review February 4, 2026 12:37
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. I'm not familiar enough with the part to reason about the change itself but codewise, LGTM

#define HMC7044_LOW_VCO_MIN_KHZ 2150000
#define HMC7044_LOW_VCO_MAX_KHZ 2880000
#define HMC7044_HIGH_VCO_MIN_KHZ 2650000
#define HMC7044_HIGH_VCO_MAX_KHZ 3200000
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 unrelated change. Adds more diff than needed... Ideally cosmetics changes like this should be done in preliminary patches and apply to the complete driver so the style is consistent.

of_property_read_bool(np, "adi,pll2-pfd-invert-enable");

if (hmc->pll2_pfd_invert_en && !hmc->clkin1_vcoin_en)
dev_warn(dev, "PLL2 PFD inverted using internal VCO.\n");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to make sure. Is this something allowable or should we just return error here?

return -EINVAL;
ret = hmc7044_validate_pll2_freq(hmc, pll2_freq);
if (ret)
return ret;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, the above helper could have been added in a preliminary patch. It makes the reviewer life easier

@BrentK-ADI BrentK-ADI marked this pull request as draft February 5, 2026 14:18
@BrentK-ADI
Copy link
Collaborator Author

@danmois, Moving this back to draft so you can add the additional commits we discussed for PLL1 power-down, PLL2 enabled.

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.

HMC7044 PLL2 External VCO Issue

3 participants