From nobody Sat Oct 11 00:22:27 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88F612E62AE for ; Thu, 12 Jun 2025 20:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749758610; cv=none; b=oiZSiZ2waVanJYuAMCoYzZV01J+J3eotDGA75UTEFyewEXeAVvdrBSNu9CBEsCOq62OEpIOI0bKlRGAL+cjbxzJ5JZU5NMFsg3Xh044mPw0YvH7CXfKuIZGPN0sH8o23zMDbJfVaYDG9BhQww2c+fJdDrzFsDtlvCBHPRZH7pYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749758610; c=relaxed/simple; bh=cuMx/DF85Bb+I9H2yyQxON+JwPq0JyH02ly4MFSCS5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ryXhFLC9fSd186VpfDpY5RE/ZBLM/DoDP43gBmIQPmku+1KomVMQ3+fWuvDmUHfdhzm+spzdvxzQXm1ayQQEiGB3ocWZ8PXR+zyFmxIICluw6mSevOSVqGWXs9wgct/zjiECjxWIgWi0Nj5gPTfbFhLNvTOcHkrhL9twZbuQFSc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=biosMTja; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="biosMTja" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749758607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6wjTCorTURANLUWK2Ee4slBE9h5sdN9cJoapu/KqJjo=; b=biosMTjaXkni9AgMr8d3bfDA2WDIPOgzPeycboeno9UMKzZyxSscUBl+Ii4lkmMi6wrYhR 4Qu9aYZIYZhHcEpjGSDGzzp7qsuVhcufwIFuMkWTRoiV5f72iRY9Ou2FhK9DUv/L+lKqdH SNcfuSaWkEFFhaRd5e7fcui+l2ga4Z0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-IagqBWZTN32S_8K87Gr_gg-1; Thu, 12 Jun 2025 16:03:24 -0400 X-MC-Unique: IagqBWZTN32S_8K87Gr_gg-1 X-Mimecast-MFC-AGG-ID: IagqBWZTN32S_8K87Gr_gg_1749758601 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A534D19560B1; Thu, 12 Jun 2025 20:03:21 +0000 (UTC) Received: from p16v.redhat.com (unknown [10.45.224.169]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 499FB18003FC; Thu, 12 Jun 2025 20:03:15 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Prathosh Satish , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Jason Gunthorpe , Shannon Nelson , Dave Jiang , Jonathan Cameron , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Michal Schmidt , Petr Oros Subject: [PATCH net-next v9 12/14] dpll: zl3073x: Implement input pin state setting in automatic mode Date: Thu, 12 Jun 2025 22:01:43 +0200 Message-ID: <20250612200145.774195-13-ivecera@redhat.com> In-Reply-To: <20250612200145.774195-1-ivecera@redhat.com> References: <20250612200145.774195-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" 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 --- drivers/dpll/zl3073x/dpll.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c index e731b17c69394..1f44910958781 100644 --- a/drivers/dpll/zl3073x/dpll.c +++ b/drivers/dpll/zl3073x/dpll.c @@ -439,6 +439,38 @@ zl3073x_dpll_input_pin_state_on_dpll_set(const struct = dpll_pin *dpll_pin, =20 rc =3D zl3073x_dpll_selected_ref_set(zldpll, new_ref); break; + + case ZL_DPLL_MODE_REFSEL_MODE_AUTO: + if (state =3D=3D DPLL_PIN_STATE_SELECTABLE) { + if (pin->selectable) + return 0; /* Pin is already selectable */ + + /* Restore pin priority in HW */ + rc =3D zl3073x_dpll_ref_prio_set(pin, pin->prio); + if (rc) + return rc; + + /* Mark pin as selectable */ + pin->selectable =3D true; + } else if (state =3D=3D DPLL_PIN_STATE_DISCONNECTED) { + if (!pin->selectable) + return 0; /* Pin is already disconnected */ + + /* Set pin priority to none in HW */ + rc =3D zl3073x_dpll_ref_prio_set(pin, + ZL_DPLL_REF_PRIO_NONE); + if (rc) + return rc; + + /* Mark pin as non-selectable */ + pin->selectable =3D false; + } else { + NL_SET_ERR_MSG(extack, + "Invalid pin state for automatic mode"); + return -EINVAL; + } + break; + default: /* In other modes we cannot change input reference */ NL_SET_ERR_MSG(extack, --=20 2.49.0