Lines Matching +full:r8a77980 +full:- +full:pcie +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0
3 * Renesas R-Car Gen3 PCIe PHY driver
12 #include <linux/phy/phy.h>
16 #define PHY_CTRL 0x4000 /* R8A77980 only */
18 /* PHY control register (PHY_CTRL) */
22 struct phy *phy; member
27 static void rcar_gen3_phy_pcie_modify_reg(struct phy *p, unsigned int reg, in rcar_gen3_phy_pcie_modify_reg()
30 struct rcar_gen3_phy *phy = phy_get_drvdata(p); in rcar_gen3_phy_pcie_modify_reg() local
31 void __iomem *base = phy->base; in rcar_gen3_phy_pcie_modify_reg()
35 spin_lock_irqsave(&phy->lock, flags); in rcar_gen3_phy_pcie_modify_reg()
42 spin_unlock_irqrestore(&phy->lock, flags); in rcar_gen3_phy_pcie_modify_reg()
45 static int r8a77980_phy_pcie_power_on(struct phy *p) in r8a77980_phy_pcie_power_on()
47 /* Power on the PCIe PHY */ in r8a77980_phy_pcie_power_on()
53 static int r8a77980_phy_pcie_power_off(struct phy *p) in r8a77980_phy_pcie_power_off()
55 /* Power off the PCIe PHY */ in r8a77980_phy_pcie_power_off()
68 { .compatible = "renesas,r8a77980-pcie-phy" },
75 struct device *dev = &pdev->dev; in rcar_gen3_phy_pcie_probe()
77 struct rcar_gen3_phy *phy; in rcar_gen3_phy_pcie_probe() local
81 if (!dev->of_node) { in rcar_gen3_phy_pcie_probe()
84 return -EINVAL; in rcar_gen3_phy_pcie_probe()
91 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in rcar_gen3_phy_pcie_probe()
92 if (!phy) in rcar_gen3_phy_pcie_probe()
93 return -ENOMEM; in rcar_gen3_phy_pcie_probe()
95 spin_lock_init(&phy->lock); in rcar_gen3_phy_pcie_probe()
97 phy->base = base; in rcar_gen3_phy_pcie_probe()
100 * devm_phy_create() will call pm_runtime_enable(&phy->dev); in rcar_gen3_phy_pcie_probe()
101 * And then, phy-core will manage runtime PM for this device. in rcar_gen3_phy_pcie_probe()
105 phy->phy = devm_phy_create(dev, NULL, &r8a77980_phy_pcie_ops); in rcar_gen3_phy_pcie_probe()
106 if (IS_ERR(phy->phy)) { in rcar_gen3_phy_pcie_probe()
107 dev_err(dev, "Failed to create PCIe PHY\n"); in rcar_gen3_phy_pcie_probe()
108 error = PTR_ERR(phy->phy); in rcar_gen3_phy_pcie_probe()
111 phy_set_drvdata(phy->phy, phy); in rcar_gen3_phy_pcie_probe()
115 dev_err(dev, "Failed to register PHY provider\n"); in rcar_gen3_phy_pcie_probe()
130 pm_runtime_disable(&pdev->dev); in rcar_gen3_phy_pcie_remove()
145 MODULE_DESCRIPTION("Renesas R-Car Gen3 PCIe PHY");