From nobody Tue Dec 16 08:52:18 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CACFF27CB0A; Mon, 15 Dec 2025 12:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765802545; cv=none; b=NOCbk/epeeHY2jCAUJvi6Q5y/D1zXuF2Hd6rG90GsAyZhAzzTxijdZN3Ih1vcSpTMmNbU2IWzrZ2wV7SKzWUZIQAi/HdO/3cydioNP03DMZQpbQS33J+7etyGET/odvyAHuknzDrM0cBBtiC47cokNsXOXfB+HW5Th2lQiGgWUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765802545; c=relaxed/simple; bh=tC2OfjhLcsHW0/XyjowfnWXGrGHu+eRPyFtvxhW+q9w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SteGfNInIuidbPbY1e5hHalgijdCu0kuYuXb0/Ec8AYWYUqwLpszFvVwGsskxk3P4dR/HtXy/wNnaDFgTAZq+7fFZ6EKT5Lr/TfLqC3MfafSTPc1s32pQ26FTFEv68579hnzjBPb7Dl8bWih1y+wvyjp5vxEqgC1rH0MCZ5vB8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rRgQ0B6w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rRgQ0B6w" Received: by smtp.kernel.org (Postfix) with ESMTPS id 72427C19424; Mon, 15 Dec 2025 12:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765802545; bh=tC2OfjhLcsHW0/XyjowfnWXGrGHu+eRPyFtvxhW+q9w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rRgQ0B6wAEGzqKZQRZqeFeudUzsY+TxfTq1k1y03Es3LJCxmUow+Sc6Sz8oaJYWdE +DZOCzvbS/abLGxXCJ0YtbHKHx3bbLiMChmQTluDXz2sFzWXlRLs6atuspV/plr5yr UW4rQ9y6WmyjLC5dv1KAvILD3DltK44br/6IDnucgkW/KHukQoB7UKY8nxBKbHUq5E 9WqjVPd9X/j+MW5AYl3V3VNdFHfB7Ux/2p8wmIslD6EBy14KGtox7io94aADQkG26o K/OllPhCO/ZrDMReXOd7YhFbkGpLaAZJxircWJSyQnDSXhOgWqc7WZ0YpIFvvzIJF2 JaGA6E5PI3iwg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59DFCD5B172; Mon, 15 Dec 2025 12:42:25 +0000 (UTC) From: Xiangxu Yin via B4 Relay Date: Mon, 15 Dec 2025 20:41:58 +0800 Subject: [PATCH v8 02/12] phy: qcom: qmp-usbc: Rename USB-specific ops to prepare for DP support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251215-add-displayport-support-for-qcs615-platform-v8-2-cbc72c88a44e@oss.qualcomm.com> References: <20251215-add-displayport-support-for-qcs615-platform-v8-0-cbc72c88a44e@oss.qualcomm.com> In-Reply-To: <20251215-add-displayport-support-for-qcs615-platform-v8-0-cbc72c88a44e@oss.qualcomm.com> To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, fange.zhang@oss.qualcomm.com, yongxing.mou@oss.qualcomm.com, li.liu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com, Dmitry Baryshkov , Bjorn Andersson , Konrad Dybcio , Xiangxu Yin X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765802541; l=5474; i=xiangxu.yin@oss.qualcomm.com; s=20241125; h=from:subject:message-id; bh=hWsloaRwrzvYLVXHhqIa36lAtKjRZLnAji6YlOB1WIM=; b=8CWEjQg8nJTQaGyO9eKmfx8k4D5j0gJek69BATqCaRoZo6Xb/Ca+W2ejdNc1QBijCuG9/faJR bmGe9FpKfcCCdxsQuqHNlTCzdtX31pUqlizCA8yyFde41tXfUdi0RIM X-Developer-Key: i=xiangxu.yin@oss.qualcomm.com; a=ed25519; pk=F1TwipJzpywfbt3n/RPi4l/A4AVF+QC89XzCHgZYaOc= X-Endpoint-Received: by B4 Relay for xiangxu.yin@oss.qualcomm.com/20241125 with auth_id=542 X-Original-From: Xiangxu Yin Reply-To: xiangxu.yin@oss.qualcomm.com From: Xiangxu Yin To support following DisplayPort (DP) mode over the Type-C PHY, rename USB-specific functions and ops to clearly separate them from common or DP-related logic. This is a preparatory cleanup to enable USB + DP dual mode. Reviewed-by: Dmitry Baryshkov Signed-off-by: Xiangxu Yin --- drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 55 ++++++++++++++++------------= ---- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c b/drivers/phy/qualcom= m/phy-qcom-qmp-usbc.c index 5e7fcb26744a..62920dd2aed3 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c @@ -342,11 +342,10 @@ struct qmp_usbc { =20 struct mutex phy_mutex; =20 + struct phy *usb_phy; enum phy_mode mode; unsigned int usb_init_count; =20 - struct phy *phy; - struct clk_fixed_rate pipe_clk_fixed; =20 struct typec_switch_dev *sw; @@ -454,7 +453,7 @@ static const struct qmp_phy_cfg sdm660_usb3phy_cfg =3D { .regs =3D qmp_v3_usb3phy_regs_layout_qcm2290, }; =20 -static int qmp_usbc_init(struct phy *phy) +static int qmp_usbc_com_init(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); const struct qmp_phy_cfg *cfg =3D qmp->cfg; @@ -504,7 +503,7 @@ static int qmp_usbc_init(struct phy *phy) return ret; } =20 -static int qmp_usbc_exit(struct phy *phy) +static int qmp_usbc_com_exit(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); const struct qmp_phy_cfg *cfg =3D qmp->cfg; @@ -518,7 +517,7 @@ static int qmp_usbc_exit(struct phy *phy) return 0; } =20 -static int qmp_usbc_power_on(struct phy *phy) +static int qmp_usbc_usb_power_on(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); const struct qmp_phy_cfg *cfg =3D qmp->cfg; @@ -566,7 +565,7 @@ static int qmp_usbc_power_on(struct phy *phy) return ret; } =20 -static int qmp_usbc_power_off(struct phy *phy) +static int qmp_usbc_usb_power_off(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); const struct qmp_phy_cfg *cfg =3D qmp->cfg; @@ -587,20 +586,20 @@ static int qmp_usbc_power_off(struct phy *phy) return 0; } =20 -static int qmp_usbc_enable(struct phy *phy) +static int qmp_usbc_usb_enable(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); int ret; =20 mutex_lock(&qmp->phy_mutex); =20 - ret =3D qmp_usbc_init(phy); + ret =3D qmp_usbc_com_init(phy); if (ret) goto out_unlock; =20 - ret =3D qmp_usbc_power_on(phy); + ret =3D qmp_usbc_usb_power_on(phy); if (ret) { - qmp_usbc_exit(phy); + qmp_usbc_com_exit(phy); goto out_unlock; } =20 @@ -611,19 +610,19 @@ static int qmp_usbc_enable(struct phy *phy) return ret; } =20 -static int qmp_usbc_disable(struct phy *phy) +static int qmp_usbc_usb_disable(struct phy *phy) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); int ret; =20 qmp->usb_init_count--; - ret =3D qmp_usbc_power_off(phy); + ret =3D qmp_usbc_usb_power_off(phy); if (ret) return ret; - return qmp_usbc_exit(phy); + return qmp_usbc_com_exit(phy); } =20 -static int qmp_usbc_set_mode(struct phy *phy, enum phy_mode mode, int subm= ode) +static int qmp_usbc_usb_set_mode(struct phy *phy, enum phy_mode mode, int = submode) { struct qmp_usbc *qmp =3D phy_get_drvdata(phy); =20 @@ -632,10 +631,10 @@ static int qmp_usbc_set_mode(struct phy *phy, enum ph= y_mode mode, int submode) return 0; } =20 -static const struct phy_ops qmp_usbc_phy_ops =3D { - .init =3D qmp_usbc_enable, - .exit =3D qmp_usbc_disable, - .set_mode =3D qmp_usbc_set_mode, +static const struct phy_ops qmp_usbc_usb_phy_ops =3D { + .init =3D qmp_usbc_usb_enable, + .exit =3D qmp_usbc_usb_disable, + .set_mode =3D qmp_usbc_usb_set_mode, .owner =3D THIS_MODULE, }; =20 @@ -690,7 +689,7 @@ static int __maybe_unused qmp_usbc_runtime_suspend(stru= ct device *dev) =20 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode); =20 - if (!qmp->phy->init_count) { + if (!qmp->usb_init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; } @@ -710,7 +709,7 @@ static int __maybe_unused qmp_usbc_runtime_resume(struc= t device *dev) =20 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode); =20 - if (!qmp->phy->init_count) { + if (!qmp->usb_init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; } @@ -865,11 +864,11 @@ static int qmp_usbc_typec_switch_set(struct typec_swi= tch_dev *sw, qmp->orientation =3D orientation; =20 if (qmp->usb_init_count) { - qmp_usbc_power_off(qmp->phy); - qmp_usbc_exit(qmp->phy); + qmp_usbc_usb_power_off(qmp->usb_phy); + qmp_usbc_com_exit(qmp->usb_phy); =20 - qmp_usbc_init(qmp->phy); - qmp_usbc_power_on(qmp->phy); + qmp_usbc_com_init(qmp->usb_phy); + qmp_usbc_usb_power_on(qmp->usb_phy); } =20 mutex_unlock(&qmp->phy_mutex); @@ -1097,14 +1096,14 @@ static int qmp_usbc_probe(struct platform_device *p= dev) if (ret) goto err_node_put; =20 - qmp->phy =3D devm_phy_create(dev, np, &qmp_usbc_phy_ops); - if (IS_ERR(qmp->phy)) { - ret =3D PTR_ERR(qmp->phy); + qmp->usb_phy =3D devm_phy_create(dev, np, &qmp_usbc_usb_phy_ops); + if (IS_ERR(qmp->usb_phy)) { + ret =3D PTR_ERR(qmp->usb_phy); dev_err(dev, "failed to create PHY: %d\n", ret); goto err_node_put; } =20 - phy_set_drvdata(qmp->phy, qmp); + phy_set_drvdata(qmp->usb_phy, qmp); =20 of_node_put(np); =20 --=20 2.34.1