OSDN Git Service

PCI: qcom: Setup PHY to work in RC mode
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 27 Sep 2022 09:22:05 +0000 (12:22 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 17 Oct 2022 07:44:24 +0000 (13:14 +0530)
Call phy_set_mode_ext() to notify the PHY driver that the PHY is being
used in the RC mode.

Reviewed-by: Jingoo Han <jingoohan1@gmail.com>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Link: https://lore.kernel.org/r/20220927092207.161501-5-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/pci/controller/dwc/pcie-qcom.c

index f711aca..7db94a2 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/platform_device.h>
+#include <linux/phy/pcie.h>
 #include <linux/phy/phy.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
@@ -1497,6 +1498,10 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
        if (ret)
                return ret;
 
+       ret = phy_set_mode_ext(pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC);
+       if (ret)
+               goto err_deinit;
+
        ret = phy_power_on(pcie->phy);
        if (ret)
                goto err_deinit;