]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
phy: qcom: qmp: Use power_on/off ops for PCIe
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 6 Jan 2020 08:11:42 +0000 (00:11 -0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Fri, 20 Mar 2020 14:04:29 +0000 (19:34 +0530)
The PCIe PHY initialization requires the attached device to be present,
which is primarily achieved by the PCI controller driver.  So move the
logic from init/exit to power_on/power_off.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/qualcomm/phy-qcom-qmp.c

index e6c836b516fdbec73bdfe2ca925ca2d74068a727..c190406246ab0817d49e5ce624befa2f0e4307ec 100644 (file)
@@ -2377,7 +2377,7 @@ static const struct phy_ops qcom_qmp_phy_gen_ops = {
        .owner          = THIS_MODULE,
 };
 
-static const struct phy_ops qcom_qmp_ufs_ops = {
+static const struct phy_ops qcom_qmp_pcie_ufs_ops = {
        .power_on       = qcom_qmp_phy_enable,
        .power_off      = qcom_qmp_phy_disable,
        .set_mode       = qcom_qmp_phy_set_mode,
@@ -2477,8 +2477,8 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id)
                }
        }
 
-       if (qmp->cfg->type == PHY_TYPE_UFS)
-               ops = &qcom_qmp_ufs_ops;
+       if (qmp->cfg->type == PHY_TYPE_UFS || qmp->cfg->type == PHY_TYPE_PCIE)
+               ops = &qcom_qmp_pcie_ufs_ops;
 
        generic_phy = devm_phy_create(dev, np, ops);
        if (IS_ERR(generic_phy)) {