DPLL_PIN_TYPE_INT_NCO is the kernel pin type of the virtual pin that represents the NCO mode of a DPLL, and the zl3073x driver registers such a pin. The uapi header in iproute2 already has the value, but the tool has no name for it. The pin is shown with "type: unknown" and "type int-nco" is refused both as a filter of "dpll pin show" and as an argument of "dpll pin id-get". Add the name to the pin type map, to the man page and to the bash completion. The list of type names used by the two error messages moves to a macro, so that it is kept in one place and the lines that print it stay within 100 columns. Signed-off-by: Petr Oros --- bash-completion/dpll | 4 ++-- dpll/dpll.c | 8 +++++--- man/man8/dpll.8 | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bash-completion/dpll b/bash-completion/dpll index 8b11f8d0c34fad..cfd39c5e0c7a53 100644 --- a/bash-completion/dpll +++ b/bash-completion/dpll @@ -178,7 +178,7 @@ _dpll_pin() ;; type) COMPREPLY=( $( compgen -W "mux ext synce-eth-port \ - int-oscillator gnss" -- "$cur" ) ) + int-oscillator gnss int-nco" -- "$cur" ) ) return 0 ;; direction) @@ -279,7 +279,7 @@ _dpll_pin() ;; type) COMPREPLY=( $( compgen -W "mux ext synce-eth-port \ - int-oscillator gnss" -- "$cur" ) ) + int-oscillator gnss int-nco" -- "$cur" ) ) return 0 ;; *) diff --git a/dpll/dpll.c b/dpll/dpll.c index 5828e78f738eac..a0a5e3f9a2f152 100644 --- a/dpll/dpll.c +++ b/dpll/dpll.c @@ -78,11 +78,14 @@ static struct str_num_map pin_type_map[] = { { .str = "synce-eth-port", .num = DPLL_PIN_TYPE_SYNCE_ETH_PORT }, { .str = "int-oscillator", .num = DPLL_PIN_TYPE_INT_OSCILLATOR }, { .str = "gnss", .num = DPLL_PIN_TYPE_GNSS }, + { .str = "int-nco", .num = DPLL_PIN_TYPE_INT_NCO }, { .str = NULL, }, }; +#define DPLL_PIN_TYPE_NAMES "mux/ext/synce-eth-port/int-oscillator/gnss/int-nco" + static struct str_num_map pin_direction_map[] = { { .str = "input", .num = DPLL_PIN_DIRECTION_INPUT }, { .str = "output", .num = DPLL_PIN_DIRECTION_OUTPUT }, @@ -253,8 +256,7 @@ static int dpll_parse_pin_type(struct dpll *dpll, __u32 *type) const char *str = dpll_argv(dpll); if (str_to_dpll_pin_type(str, type)) { - pr_err("invalid type: %s (use mux/ext/synce-eth-port/int-oscillator/gnss)\n", - str); + pr_err("invalid type: %s (use " DPLL_PIN_TYPE_NAMES ")\n", str); return -EINVAL; } dpll_arg_inc(dpll); @@ -2052,7 +2054,7 @@ static int cmd_pin_show(struct dpll *dpll) &filter.present, DPLL_FILTER_PIN_TYPE, str_to_dpll_pin_type, - "mux/ext/synce-eth-port/int-oscillator/gnss")) + DPLL_PIN_TYPE_NAMES)) return -EINVAL; } else if (dpll_argv_match(dpll, "direction")) { if (dpll_filter_parse_enum(dpll, "direction", diff --git a/man/man8/dpll.8 b/man/man8/dpll.8 index 92d4ead0010bc6..84c21e7980eb2b 100644 --- a/man/man8/dpll.8 +++ b/man/man8/dpll.8 @@ -245,7 +245,7 @@ Show only pins with the specified package label. .TP .BI type " TYPE" Show only pins of the specified type: -.BR mux ", " ext ", " synce-eth-port ", " int-oscillator ", " gnss . +.BR mux ", " ext ", " synce-eth-port ", " int-oscillator ", " gnss ", " int-nco . .TP .BI direction " DIR" @@ -288,7 +288,7 @@ Panel label .IP \[bu] Package label .IP \[bu] -Pin type (mux, ext, synce-eth-port, int-oscillator, gnss) +Pin type (mux, ext, synce-eth-port, int-oscillator, gnss, int-nco) .IP \[bu] Configured frequency and supported frequency ranges .IP \[bu] @@ -384,7 +384,7 @@ Filter by package label. .TP .BI type " TYPE" Filter by pin type: -.BR mux ", " ext ", " synce-eth-port ", " int-oscillator ", " gnss . +.BR mux ", " ext ", " synce-eth-port ", " int-oscillator ", " gnss ", " int-nco . .SH MONITOR COMMAND -- 2.56.1