]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: Support dynamic pin index allocation
authorIvan Vecera <ivecera@redhat.com>
Tue, 3 Feb 2026 17:39:57 +0000 (18:39 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 5 Feb 2026 14:57:46 +0000 (15:57 +0100)
commit711696b3e168cea4165e7b7f051f3f442a347430
treebbfa476ad73ac003fcc6bf46f15ad0c0452eb214
parent2be467588d6bc6ec5988fc254e62a44b865912a0
dpll: Support dynamic pin index allocation

Allow drivers to register DPLL pins without manually specifying a pin
index.

Currently, drivers must provide a unique pin index when calling
dpll_pin_get(). This works well for hardware-mapped pins but creates
friction for drivers handling virtual pins or those without a strict
hardware indexing scheme.

Introduce DPLL_PIN_IDX_UNSPEC (U32_MAX). When a driver passes this
value as the pin index:
1. The core allocates a unique index using an IDA
2. The allocated index is mapped to a range starting above `INT_MAX`

This separation ensures that dynamically allocated indices never collide
with standard driver-provided hardware indices, which are assumed to be
within the `0` to `INT_MAX` range. The index is automatically freed when
the pin is released in dpll_pin_put().

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Link: https://patch.msgid.link/20260203174002.705176-5-ivecera@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/dpll/dpll_core.c
include/linux/dpll.h