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.

Signed-off-by: Xiangxu Yin <xiangxu....@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 50 ++++++++++++++++----------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c 
b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
index 
5e7fcb26744a4401c3076960df9c0dcbec7fdef7..e484caec2be20121cfe287c507b17af28fb9f211
 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
@@ -454,7 +454,7 @@ static const struct qmp_phy_cfg sdm660_usb3phy_cfg = {
        .regs                   = qmp_v3_usb3phy_regs_layout_qcm2290,
 };
 
-static int qmp_usbc_init(struct phy *phy)
+static int qmp_usbc_com_init(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -504,7 +504,7 @@ static int qmp_usbc_init(struct phy *phy)
        return ret;
 }
 
-static int qmp_usbc_exit(struct phy *phy)
+static int qmp_usbc_com_exit(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -518,7 +518,7 @@ static int qmp_usbc_exit(struct phy *phy)
        return 0;
 }
 
-static int qmp_usbc_power_on(struct phy *phy)
+static int qmp_usbc_usb_power_on(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -566,7 +566,7 @@ static int qmp_usbc_power_on(struct phy *phy)
        return ret;
 }
 
-static int qmp_usbc_power_off(struct phy *phy)
+static int qmp_usbc_usb_power_off(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -587,20 +587,20 @@ static int qmp_usbc_power_off(struct phy *phy)
        return 0;
 }
 
-static int qmp_usbc_enable(struct phy *phy)
+static int qmp_usbc_usb_enable(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        int ret;
 
        mutex_lock(&qmp->phy_mutex);
 
-       ret = qmp_usbc_init(phy);
+       ret = qmp_usbc_com_init(phy);
        if (ret)
                goto out_unlock;
 
-       ret = qmp_usbc_power_on(phy);
+       ret = qmp_usbc_usb_power_on(phy);
        if (ret) {
-               qmp_usbc_exit(phy);
+               qmp_usbc_com_exit(phy);
                goto out_unlock;
        }
 
@@ -611,19 +611,19 @@ static int qmp_usbc_enable(struct phy *phy)
        return ret;
 }
 
-static int qmp_usbc_disable(struct phy *phy)
+static int qmp_usbc_usb_disable(struct phy *phy)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
        int ret;
 
        qmp->usb_init_count--;
-       ret = qmp_usbc_power_off(phy);
+       ret = qmp_usbc_usb_power_off(phy);
        if (ret)
                return ret;
-       return qmp_usbc_exit(phy);
+       return qmp_usbc_com_exit(phy);
 }
 
-static int qmp_usbc_set_mode(struct phy *phy, enum phy_mode mode, int submode)
+static int qmp_usbc_usb_set_mode(struct phy *phy, enum phy_mode mode, int 
submode)
 {
        struct qmp_usbc *qmp = phy_get_drvdata(phy);
 
@@ -632,10 +632,10 @@ static int qmp_usbc_set_mode(struct phy *phy, enum 
phy_mode mode, int submode)
        return 0;
 }
 
-static const struct phy_ops qmp_usbc_phy_ops = {
-       .init           = qmp_usbc_enable,
-       .exit           = qmp_usbc_disable,
-       .set_mode       = qmp_usbc_set_mode,
+static const struct phy_ops qmp_usbc_usb_phy_ops = {
+       .init           = qmp_usbc_usb_enable,
+       .exit           = qmp_usbc_usb_disable,
+       .set_mode       = qmp_usbc_usb_set_mode,
        .owner          = THIS_MODULE,
 };
 
@@ -865,11 +865,11 @@ static int qmp_usbc_typec_switch_set(struct 
typec_switch_dev *sw,
        qmp->orientation = orientation;
 
        if (qmp->usb_init_count) {
-               qmp_usbc_power_off(qmp->phy);
-               qmp_usbc_exit(qmp->phy);
+               qmp_usbc_usb_power_off(qmp->phy);
+               qmp_usbc_com_exit(qmp->phy);
 
-               qmp_usbc_init(qmp->phy);
-               qmp_usbc_power_on(qmp->phy);
+               qmp_usbc_com_init(qmp->phy);
+               qmp_usbc_usb_power_on(qmp->phy);
        }
 
        mutex_unlock(&qmp->phy_mutex);
@@ -907,7 +907,7 @@ static int qmp_usbc_typec_switch_register(struct qmp_usbc 
*qmp)
 }
 #endif
 
-static int qmp_usbc_parse_dt_legacy(struct qmp_usbc *qmp, struct device_node 
*np)
+static int qmp_usbc_parse_usb_dt_legacy(struct qmp_usbc *qmp, struct 
device_node *np)
 {
        struct platform_device *pdev = to_platform_device(qmp->dev);
        struct device *dev = qmp->dev;
@@ -969,7 +969,7 @@ static int qmp_usbc_parse_dt_legacy(struct qmp_usbc *qmp, 
struct device_node *np
        return 0;
 }
 
-static int qmp_usbc_parse_dt(struct qmp_usbc *qmp)
+static int qmp_usbc_parse_usb_dt(struct qmp_usbc *qmp)
 {
        struct platform_device *pdev = to_platform_device(qmp->dev);
        const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -1075,10 +1075,10 @@ static int qmp_usbc_probe(struct platform_device *pdev)
        /* Check for legacy binding with child node. */
        np = of_get_child_by_name(dev->of_node, "phy");
        if (np) {
-               ret = qmp_usbc_parse_dt_legacy(qmp, np);
+               ret = qmp_usbc_parse_usb_dt_legacy(qmp, np);
        } else {
                np = of_node_get(dev->of_node);
-               ret = qmp_usbc_parse_dt(qmp);
+               ret = qmp_usbc_parse_usb_dt(qmp);
        }
        if (ret)
                goto err_node_put;
@@ -1097,7 +1097,7 @@ static int qmp_usbc_probe(struct platform_device *pdev)
        if (ret)
                goto err_node_put;
 
-       qmp->phy = devm_phy_create(dev, np, &qmp_usbc_phy_ops);
+       qmp->phy = devm_phy_create(dev, np, &qmp_usbc_usb_phy_ops);
        if (IS_ERR(qmp->phy)) {
                ret = PTR_ERR(qmp->phy);
                dev_err(dev, "failed to create PHY: %d\n", ret);

-- 
2.34.1

Reply via email to