Skip to contentSkip to conversation

dpll: add mode setting support

PATCH Applied Petr Oros 3 participants 3 messages Jan 29 – Jan 30

Subsystems (2)
lore
Share & tools
lore

Petr Oros

author
#0 lore raw

PATCH 1/1 dpll: add mode setting support

Add ability to set DPLL device operating mode (automatic/manual) through "dpll device set id ID mode MODE" command.

In automatic mode, the DPLL autonomously selects the best input source based on priority and quality. In manual mode, the input source must be explicitly configured.

The implementation adds dpll_mode_map for string-to-enum conversion, str_to_dpll_mode() and dpll_parse_mode() functions, and refactors dpll_mode_name() to use str_map_lookup_uint() for consistency.

Man page and bash completion updated accordingly.

---
 bash-completion/dpll |  6 ++++-
 dpll/dpll.c          | 52 +++++++++++++++++++++++++++++++++++---------
 man/man8/dpll.8      | 18 ++++++++++++++-
 3 files changed, 64 insertions(+), 12 deletions(-)
bash-completion/dpll +5 -1
index 6e4d39a5b5b6bb..caf86a36f2adf3 100644
@@ -73,6 +73,10 @@ _dpll_device()
                         "$(_dpll_direct_complete device_id)" -- "$cur" ) )
                     return 0
                     ;;
+                mode)
+                    COMPREPLY=( $( compgen -W "automatic manual" -- "$cur" ) )
+                    return 0
+                    ;;
                 phase-offset-monitor)
                     COMPREPLY=( $( compgen -W "enable disable true false 0 1" -- "$cur" ) )
                     return 0
@@ -82,7 +86,7 @@ _dpll_device()
                     return 0
                     ;;
                 *)
-                    COMPREPLY=( $( compgen -W "id phase-offset-monitor \
+                    COMPREPLY=( $( compgen -W "id mode phase-offset-monitor \
                         phase-offset-avg-factor" -- "$cur" ) )
                     return 0
                     ;;
dpll/dpll.c +42 -10

87 lines not on this page · raw message

man/man8/dpll.8 +17 -1
index fcc1c4a67af5d9..e82f083feac64b 100644
@@ -88,7 +88,7 @@ Temperature (if supported)
 Type (PPS or EEC)
 .RE
 
-.SS dpll device set id ID [ phase-offset-monitor { enable | disable } ] [ phase-offset-avg-factor FACTOR ]
+.SS dpll device set id ID [ mode { automatic | manual } ] [ phase-offset-monitor { enable | disable } ] [ phase-offset-avg-factor FACTOR ]
 
 Configure DPLL device parameters.
 
@@ -96,6 +96,17 @@ Configure DPLL device parameters.
 .BI id " ID"
 Specifies which device to configure (required).
 
+.TP
+.BI mode " { automatic | manual }"
+Set the operating mode of the DPLL device.
+In
+.B automatic
+mode, the DPLL autonomously selects the best available input source
+based on priority and quality. In
+.B manual
+mode, the input source must be explicitly configured and the DPLL
+will not automatically switch sources.
+
 .TP
 .BI phase-offset-monitor " { enable | disable | true | false | 0 | 1 }"
 Enable or disable phase offset monitoring between the device and its pins.
@@ -283,6 +294,11 @@ Press Ctrl+C to stop monitoring.
 .B dpll -j device show id 0
 .fi
 
+.SS Set device 0 to manual mode
+.nf
+.B dpll device set id 0 mode manual
+.fi
+
 .SS Enable phase offset monitoring on device 0
 .nf
 .B dpll device set id 0 phase-offset-monitor enable
Signature · 1 line
2.52.0
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Petr Oros

Add ability to set DPLL device operating mode (automatic/manual) through "dpll device set id ID mode MODE" command.

In automatic mode, the DPLL autonomously selects the best input source based on priority and quality. In manual mode, the input source must be explicitly configured.

The implementation adds dpll_mode_map for string-to-enum conversion, str_to_dpll_mode() and dpll_parse_mode() functions, and refactors dpll_mode_name() to use str_map_lookup_uint() for consistency.

Quoted 8 lines

Man page and bash completion updated accordingly.

---
  bash-completion/dpll |  6 ++++-
  dpll/dpll.c          | 52 +++++++++++++++++++++++++++++++++++---------
  man/man8/dpll.8      | 18 ++++++++++++++-
  3 files changed, 64 insertions(+), 12 deletions(-)
#2 lore raw
In reply to Petr Oros
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 8 lines · On Thu, 29 Jan 2026 12:28:49 +0100 you wrote:

Add ability to set DPLL device operating mode (automatic/manual) through "dpll device set id ID mode MODE" command.

In automatic mode, the DPLL autonomously selects the best input source based on priority and quality. In manual mode, the input source must be explicitly configured.

[...]

Here is the summary with links:
- [iproute2,net-next] dpll: add mode setting support

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=f64542add03b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html