[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fa9f9e4-b7fa-42fd-b367-9d52e0f1f184@oss.qualcomm.com>
Date: Fri, 12 Sep 2025 20:01:30 +0800
From: Xiangxu Yin <xiangxu.yin@....qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@....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 9/12/2025 6:31 PM, Dmitry Baryshkov wrote:
> 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).
Ack. will update.
>> + }
>> +
>> + 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
>>
Powered by blists - more mailing lists