linux/drivers/dpll
Ivan Vecera a047497f95 dpll: zl3073x: Fix ref frequency setting
The frequency for an input reference is computed as:

  frequency = freq_base * freq_mult * freq_ratio_m / freq_ratio_n

Before commit 5bc02b190a ("dpll: zl3073x: Cache all reference
properties in zl3073x_ref"), zl3073x_dpll_input_pin_frequency_set()
explicitly wrote 1 to both the REF_RATIO_M and REF_RATIO_N hardware
registers whenever a new frequency was set. This ensured the FEC ratio
was always reset to 1:1 alongside the new base/multiplier values.

The refactoring in that commit introduced zl3073x_ref_freq_set() to
update the cached ref state, but this helper only sets freq_base and
freq_mult without resetting freq_ratio_m and freq_ratio_n to 1. Because
zl3073x_ref_state_set() uses a compare-and-write strategy, unchanged
ratio fields are never written to the hardware. If the device previously
had non-unity FEC ratio values, they remain in effect after a frequency
change, resulting in an incorrect computed frequency.

Explicitly set freq_ratio_m and freq_ratio_n to 1 in zl3073x_ref_freq_set()
to restore the original behavior.

Fixes: 5bc02b190a ("dpll: zl3073x: Cache all reference properties in zl3073x_ref")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260216194007.680416-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-02-17 17:06:51 -08:00
..
zl3073x dpll: zl3073x: Fix ref frequency setting 2026-02-17 17:06:51 -08:00
dpll_core.c dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
dpll_core.h dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
dpll_netlink.c dpll: Add notifier chain for dpll events 2026-02-05 15:57:46 +01:00
dpll_netlink.h dpll: add reference sync get/set 2025-06-27 16:38:02 -07:00
dpll_nl.c dpll: add dpll_device op to set working mode 2026-01-19 12:04:53 -08:00
dpll_nl.h tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
Kconfig dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
Makefile dpll: Add basic Microchip ZL3073x support 2025-07-09 19:08:52 -07:00