MLK-15141-1: PCI: imx: Add epdev_on regulator for 8QM WiFi
authorTiberiu Breana <andrei-tiberiu.breana@nxp.com>
Thu, 6 Jul 2017 15:28:11 +0000 (18:28 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:54 +0000 (15:33 -0500)
Add the epdev_on regulator to power up the WiFi module
on the iMX8QM board.
This regulator needs to be powered up before the pcie
link, in order for the WiFi module to work.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
drivers/pci/host/pci-imx6.c

index aac0909..936ec78 100644 (file)
@@ -88,6 +88,7 @@ struct imx6_pcie {
        void __iomem            *phy_base;
        struct regulator        *pcie_phy_regulator;
        struct regulator        *pcie_bus_regulator;
+       struct regulator        *epdev_on;
 };
 
 /* PCIe Root Complex registers (memory-mapped) */
@@ -1886,6 +1887,16 @@ static int imx6_pcie_probe(struct platform_device *pdev)
                                "pcie clock source missing or invalid\n");
                        return PTR_ERR(imx6_pcie->pcie_inbound_axi);
                }
+
+               imx6_pcie->epdev_on = devm_regulator_get(&pdev->dev,
+                                                        "epdev_on");
+               if (IS_ERR(imx6_pcie->epdev_on))
+                       return -EPROBE_DEFER;
+
+               ret = regulator_enable(imx6_pcie->epdev_on);
+               if (ret)
+                       dev_err(imx6_pcie->pp.dev,
+                               "failed to enable the epdev_on regulator\n");
        } else {
                imx6_pcie->iomuxc_gpr =
                 syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");