]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dpll: allow fwnode pins to attempt state change without capability bit
authorGrzegorz Nitka <grzegorz.nitka@intel.com>
Sun, 7 Jun 2026 18:30:41 +0000 (20:30 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 20:24:34 +0000 (13:24 -0700)
Pins registered with an fwnode may have .state_on_dpll_set implemented
without advertising DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE upfront.
Requiring the bit for fwnode pins ties firmware description to driver
implementation details unnecessarily.

Relax the capability check in dpll_pin_state_set() and
dpll_pin_on_pin_state_set(): when a pin has an associated fwnode, bypass
the capability gate and let the ops layer decide, returning -EOPNOTSUPP
if .state_on_dpll_set is absent. Non-fwnode pins retain the original
strict behavior.

This is used later in the series by the SyncE_Ref output pin, which
relies on the fwnode path for state control.

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Link: https://patch.msgid.link/20260607183045.1213735-10-grzegorz.nitka@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/dpll_netlink.c

index 8232d4543c7d2bcda59fcaaeac2b055af3b09b2f..bf729cde796a77a35a5da50d977174662a0046ef 100644 (file)
@@ -1325,8 +1325,11 @@ dpll_pin_on_pin_state_set(struct dpll_pin *pin, u32 parent_idx,
        unsigned long i;
        int ret;
 
+       /* fwnode pins may not set the capability bit upfront; let the ops
+        * layer return -EOPNOTSUPP if the operation is unsupported.
+        */
        if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
-             pin->prop.capabilities)) {
+             pin->prop.capabilities) && !pin->fwnode) {
                NL_SET_ERR_MSG(extack, "state changing is not allowed");
                return -EOPNOTSUPP;
        }
@@ -1361,8 +1364,11 @@ dpll_pin_state_set(struct dpll_device *dpll, struct dpll_pin *pin,
        struct dpll_pin_ref *ref;
        int ret;
 
+       /* fwnode pins may not set the capability bit upfront; let the ops
+        * layer return -EOPNOTSUPP if the operation is unsupported.
+        */
        if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
-             pin->prop.capabilities)) {
+             pin->prop.capabilities) && !pin->fwnode) {
                NL_SET_ERR_MSG(extack, "state changing is not allowed");
                return -EOPNOTSUPP;
        }