[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <buob3axokndjfuwvv5j5zee4e66tf7t4ficz6fend5yadw4j6e@czus6n6zfor7>
Date: Fri, 12 Sep 2025 13:31:11 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Xiangxu Yin <xiangxu.yin@....qualcomm.com>
Cc: Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Rob Clark <robin.clark@....qualcomm.com>,
Dmitry Baryshkov <lumag@...nel.org>,
Abhinav Kumar <abhinav.kumar@...ux.dev>,
Jessica Zhang <jessica.zhang@....qualcomm.com>,
Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
linux-arm-msm@...r.kernel.org, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
fange.zhang@....qualcomm.com, yongxing.mou@....qualcomm.com,
li.liu@....qualcomm.com, tingwei.zhang@....qualcomm.com,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>
Subject: Re: [PATCH v4 10/13] phy: qcom: qmp-usbc: Add DP PHY ops for USB/DP
switchable Type-C PHYs
On Thu, Sep 11, 2025 at 10:55:07PM +0800, Xiangxu Yin wrote:
> Define qmp_usbc_dp_phy_ops struct to support DP mode on USB/DP
> switchable PHYs.
>
> Signed-off-by: Xiangxu Yin <xiangxu.yin@....qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 192 ++++++++++++++++++++++++++++++-
> 1 file changed, 191 insertions(+), 1 deletion(-)
>
> @@ -1669,6 +1832,23 @@ static int qmp_usbc_parse_tcsr(struct qmp_usbc *qmp)
> return 0;
> }
>
> +static struct phy *qmp_usbc_phy_xlate(struct device *dev, const struct of_phandle_args *args)
> +{
> + struct qmp_usbc *qmp = dev_get_drvdata(dev);
> +
> + if (args->args_count == 0)
> + return qmp->usb_phy;
> +
> + switch (args->args[0]) {
> + case QMP_USB43DP_USB3_PHY:
> + return qmp->usb_phy;
> + case QMP_USB43DP_DP_PHY:
> + return qmp->dp_phy;
return qmp->dp_phy ?: ERR_PTR(-ENODEV);
We are not expected to return NULL here (and dp_phy can be NULL).
> + }
> +
> + return ERR_PTR(-EINVAL);
> +}
> +
> static int qmp_usbc_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -1743,9 +1923,19 @@ static int qmp_usbc_probe(struct platform_device *pdev)
>
> phy_set_drvdata(qmp->usb_phy, qmp);
>
> + if (qmp->dp_serdes != 0) {
> + qmp->dp_phy = devm_phy_create(dev, np, &qmp_usbc_dp_phy_ops);
> + if (IS_ERR(qmp->dp_phy)) {
> + ret = PTR_ERR(qmp->dp_phy);
> + dev_err(dev, "failed to create PHY: %d\n", ret);
> + goto err_node_put;
> + }
> + phy_set_drvdata(qmp->dp_phy, qmp);
> + }
> +
> of_node_put(np);
>
> - phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> + phy_provider = devm_of_phy_provider_register(dev, qmp_usbc_phy_xlate);
>
> return PTR_ERR_OR_ZERO(phy_provider);
>
>
> --
> 2.34.1
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists