Skip to content

Commit 9496cba

Browse files
committed
dpll: zl3073x: Implement input pin state setting in automatic mode
jira KERNEL-318 Rebuild_History Non-Buildable kernel-6.12.0-124.20.1.el10_1 commit-author Ivan Vecera <ivecera@redhat.com> commit bf33c93 Implement input pin state setting when the DPLL is running in automatic mode. Unlike manual mode, the DPLL mode switching is not used here and the implementation uses special priority value (15) to make the given pin non-selectable. When the user sets state of the pin as disconnected the driver internally sets its priority in HW to 15 that prevents the DPLL to choose this input pin. Conversely, if the pin status is set to selectable, the driver sets the pin priority in HW to the original saved value. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20250704182202.1641943-12-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit bf33c93) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent cfe209c commit 9496cba

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/dpll/zl3073x/dpll.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,38 @@ zl3073x_dpll_input_pin_state_on_dpll_set(const struct dpll_pin *dpll_pin,
439439

440440
rc = zl3073x_dpll_selected_ref_set(zldpll, new_ref);
441441
break;
442+
443+
case ZL_DPLL_MODE_REFSEL_MODE_AUTO:
444+
if (state == DPLL_PIN_STATE_SELECTABLE) {
445+
if (pin->selectable)
446+
return 0; /* Pin is already selectable */
447+
448+
/* Restore pin priority in HW */
449+
rc = zl3073x_dpll_ref_prio_set(pin, pin->prio);
450+
if (rc)
451+
return rc;
452+
453+
/* Mark pin as selectable */
454+
pin->selectable = true;
455+
} else if (state == DPLL_PIN_STATE_DISCONNECTED) {
456+
if (!pin->selectable)
457+
return 0; /* Pin is already disconnected */
458+
459+
/* Set pin priority to none in HW */
460+
rc = zl3073x_dpll_ref_prio_set(pin,
461+
ZL_DPLL_REF_PRIO_NONE);
462+
if (rc)
463+
return rc;
464+
465+
/* Mark pin as non-selectable */
466+
pin->selectable = false;
467+
} else {
468+
NL_SET_ERR_MSG(extack,
469+
"Invalid pin state for automatic mode");
470+
return -EINVAL;
471+
}
472+
break;
473+
442474
default:
443475
/* In other modes we cannot change input reference */
444476
NL_SET_ERR_MSG(extack,

0 commit comments

Comments
 (0)