Lines Matching refs:pcie_phy

80 static void mtk_pcie_efuse_set_lane(struct mtk_pcie_phy *pcie_phy,
83 struct mtk_pcie_lane_efuse *data = &pcie_phy->efuse[lane];
89 addr = pcie_phy->sif_base + PEXTP_ANA_LN0_TRX_REG +
112 struct mtk_pcie_phy *pcie_phy = phy_get_drvdata(phy);
115 if (!pcie_phy->sw_efuse_en)
119 mtk_phy_update_field(pcie_phy->sif_base + PEXTP_ANA_GLB_00_REG,
120 EFUSE_GLB_INTR_SEL, pcie_phy->efuse_glb_intr);
122 for (i = 0; i < pcie_phy->data->num_lanes; i++)
123 mtk_pcie_efuse_set_lane(pcie_phy, i);
133 static int mtk_pcie_efuse_read_for_lane(struct mtk_pcie_phy *pcie_phy,
136 struct mtk_pcie_lane_efuse *efuse = &pcie_phy->efuse[lane];
137 struct device *dev = pcie_phy->dev;
166 static int mtk_pcie_read_efuse(struct mtk_pcie_phy *pcie_phy)
168 struct device *dev = pcie_phy->dev;
178 &pcie_phy->efuse_glb_intr);
182 pcie_phy->sw_efuse_en = true;
184 pcie_phy->efuse = devm_kzalloc(dev, pcie_phy->data->num_lanes *
185 sizeof(*pcie_phy->efuse), GFP_KERNEL);
186 if (!pcie_phy->efuse)
189 for (i = 0; i < pcie_phy->data->num_lanes; i++) {
190 ret = mtk_pcie_efuse_read_for_lane(pcie_phy, i);
202 struct mtk_pcie_phy *pcie_phy;
205 pcie_phy = devm_kzalloc(dev, sizeof(*pcie_phy), GFP_KERNEL);
206 if (!pcie_phy)
209 pcie_phy->sif_base = devm_platform_ioremap_resource_byname(pdev, "sif");
210 if (IS_ERR(pcie_phy->sif_base))
211 return dev_err_probe(dev, PTR_ERR(pcie_phy->sif_base),
214 pcie_phy->phy = devm_phy_create(dev, dev->of_node, &mtk_pcie_phy_ops);
215 if (IS_ERR(pcie_phy->phy))
216 return dev_err_probe(dev, PTR_ERR(pcie_phy->phy),
219 pcie_phy->dev = dev;
220 pcie_phy->data = of_device_get_match_data(dev);
221 if (!pcie_phy->data)
224 if (pcie_phy->data->sw_efuse_supported) {
229 ret = mtk_pcie_read_efuse(pcie_phy);
234 phy_set_drvdata(pcie_phy->phy, pcie_phy);