drivers/dpll/zl3073x/ref.h
Source file repositories/reference/linux-study-clean/drivers/dpll/zl3073x/ref.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/dpll/zl3073x/ref.h- Extension
.h- Size
- 4560 bytes
- Lines
- 192
- Domain
- Driver Families
- Bucket
- drivers/dpll
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/math64.hlinux/stddef.hlinux/types.hregs.h
Detected Declarations
struct zl3073x_devstruct zl3073x_reffunction zl3073x_ref_meas_freq_getfunction zl3073x_ref_freq_getfunction zl3073x_ref_freq_setfunction zl3073x_ref_sync_mode_getfunction zl3073x_ref_sync_mode_setfunction zl3073x_ref_sync_pair_getfunction zl3073x_ref_sync_pair_setfunction zl3073x_ref_is_difffunction zl3073x_ref_is_enabledfunction zl3073x_ref_is_status_ok
Annotated Snippet
struct zl3073x_ref {
struct_group(cfg, /* Configuration */
u64 phase_comp;
u32 esync_n_div;
u16 freq_base;
u16 freq_mult;
u16 freq_ratio_m;
u16 freq_ratio_n;
u8 sync_ctrl;
);
struct_group(inv, /* Invariants */
u8 config;
);
struct_group(stat, /* Status */
u32 meas_freq;
u8 mon_status;
);
};
int zl3073x_ref_state_fetch(struct zl3073x_dev *zldev, u8 index);
const struct zl3073x_ref *zl3073x_ref_state_get(struct zl3073x_dev *zldev,
u8 index);
int zl3073x_ref_state_set(struct zl3073x_dev *zldev, u8 index,
const struct zl3073x_ref *ref);
int zl3073x_ref_state_update(struct zl3073x_dev *zldev, u8 index);
int zl3073x_ref_freq_factorize(u32 freq, u16 *base, u16 *mult);
/**
* zl3073x_ref_meas_freq_get - get measured input frequency
* @ref: pointer to ref state
*
* Return: measured input frequency in Hz
*/
static inline u32
zl3073x_ref_meas_freq_get(const struct zl3073x_ref *ref)
{
return ref->meas_freq;
}
/**
* zl3073x_ref_freq_get - get given input reference frequency
* @ref: pointer to ref state
*
* Return: frequency of the given input reference
*/
static inline u32
zl3073x_ref_freq_get(const struct zl3073x_ref *ref)
{
return mul_u64_u32_div(ref->freq_base * ref->freq_mult,
ref->freq_ratio_m, ref->freq_ratio_n);
}
/**
* zl3073x_ref_freq_set - set given input reference frequency
* @ref: pointer to ref state
* @freq: frequency to be set
*
* Return: 0 on success, <0 when frequency cannot be factorized
*/
static inline int
zl3073x_ref_freq_set(struct zl3073x_ref *ref, u32 freq)
{
u16 base, mult;
int rc;
rc = zl3073x_ref_freq_factorize(freq, &base, &mult);
if (rc)
return rc;
ref->freq_base = base;
ref->freq_mult = mult;
ref->freq_ratio_m = 1;
ref->freq_ratio_n = 1;
return 0;
}
/**
* zl3073x_ref_sync_mode_get - get sync control mode
* @ref: pointer to ref state
*
* Return: sync control mode (ZL_REF_SYNC_CTRL_MODE_*)
*/
static inline u8
zl3073x_ref_sync_mode_get(const struct zl3073x_ref *ref)
{
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/math64.h`, `linux/stddef.h`, `linux/types.h`, `regs.h`.
- Detected declarations: `struct zl3073x_dev`, `struct zl3073x_ref`, `function zl3073x_ref_meas_freq_get`, `function zl3073x_ref_freq_get`, `function zl3073x_ref_freq_set`, `function zl3073x_ref_sync_mode_get`, `function zl3073x_ref_sync_mode_set`, `function zl3073x_ref_sync_pair_get`, `function zl3073x_ref_sync_pair_set`, `function zl3073x_ref_is_diff`.
- Atlas domain: Driver Families / drivers/dpll.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.