]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: zl3073x: Implement device mode setting support
authorIvan Vecera <ivecera@redhat.com>
Wed, 14 Jan 2026 12:27:26 +0000 (13:27 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 19 Jan 2026 20:04:57 +0000 (12:04 -0800)
commitd6df0dea24d2a44e08207b3b41c965e50bb212c6
tree04eb24c938fb5a77cda7bdebf2debc68e441790a
parente3f6c65192fe484ab16f0be2b495ceef5ca3b85c
dpll: zl3073x: Implement device mode setting support

Add support for .supported_modes_get() and .mode_set() callbacks
to enable switching between manual and automatic modes via netlink.

Implement .supported_modes_get() to report available modes based
on the current hardware configuration:

* manual mode is always supported
* automatic mode is supported unless the dpll channel is configured
  in NCO (Numerically Controlled Oscillator) mode

Implement .mode_set() to handle the specific logic required when
transitioning between modes:

1) Transition to manual:
* If a valid reference is currently active, switch the hardware
  to ref-lock mode (force lock to that reference).
* If no reference is valid and the DPLL is unlocked, switch to freerun.
* Otherwise, switch to Holdover.

2) Transition to automatic:
* If the currently selected reference pin was previously marked
  as non-selectable (likely during a previous manual forcing
  operation), restore its priority and selectability in the hardware.
* Switch the hardware to Automatic selection mode.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Prathosh Satish <Prathosh.Satish@microchip.com>
Link: https://patch.msgid.link/20260114122726.120303-4-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/zl3073x/dpll.c