Conversation
Migrate frequency storage from u32 Hz to u64 µHz for sub-Hz precision control. This enables more accurate frequency configuration for JESD204 applications requiring precise rates. Key changes: - Change bsync_freq_odiv_a/b from u32 (Hz) to u64 (µHz) with renamed fields to reflect the unit change - Add support for new device tree properties adi,bsync-frequency-uhz and adi,bsync-secondary-frequency-uhz with backward compatibility for existing -hz properties - Avoid potential overflow in TDC measurement calculations by replacing div_s64() chain with mul_u64_u64_div_u64() and proper sign handling The TDC measurement now uses sub-Hz precision and prevents overflow when computing: (time_diff * 10^12) / 2^24 / freq by using 64-bit multiplication helpers instead of chained divisions. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Enhance error messages in TDC measurement and autoalignment functions to include channel information. This makes debugging easier by identifying which specific channels are involved when operations fail due to TDC_BUSY or FSM_BUSY timeout conditions. Updated functions: - adf4030_tdc_measure(): Now reports source and destination channels - adf4030_duty_cycle_measure(): Now reports the channel being measured - adf4030_auto_align_single_channel(): Now reports both channels involved Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
mhennerich
approved these changes
Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Migrate frequency storage from u32 Hz to u64 µHz for sub-Hz precision control. This enables more accurate frequency configuration for JESD204 applications requiring precise rates. Additionally, enhance error messages in TDC measurement and autoalignment functions.
PR Type
PR Checklist