Lines Matching refs:iphy
98 struct intel_cbphy_iphy iphy[PHY_MAX_NUM];
105 static int intel_cbphy_iphy_enable(struct intel_cbphy_iphy *iphy, bool set)
107 struct intel_combo_phy *cbphy = iphy->parent;
108 u32 mask = BIT(cbphy->phy_mode * 2 + iphy->id);
118 static int intel_cbphy_pcie_refclk_cfg(struct intel_cbphy_iphy *iphy, bool set)
120 struct intel_combo_phy *cbphy = iphy->parent;
121 u32 mask = BIT(cbphy->id * 2 + iphy->id);
141 static int intel_cbphy_iphy_cfg(struct intel_cbphy_iphy *iphy,
144 struct intel_combo_phy *cbphy = iphy->parent;
147 ret = phy_cfg(iphy);
154 return phy_cfg(&cbphy->iphy[PHY_1]);
157 static int intel_cbphy_pcie_en_pad_refclk(struct intel_cbphy_iphy *iphy)
159 struct intel_combo_phy *cbphy = iphy->parent;
162 ret = intel_cbphy_pcie_refclk_cfg(iphy, true);
180 static int intel_cbphy_pcie_dis_pad_refclk(struct intel_cbphy_iphy *iphy)
182 struct intel_combo_phy *cbphy = iphy->parent;
185 ret = intel_cbphy_pcie_refclk_cfg(iphy, false);
252 static int intel_cbphy_iphy_power_on(struct intel_cbphy_iphy *iphy)
254 struct intel_combo_phy *cbphy = iphy->parent;
278 ret = intel_cbphy_iphy_enable(iphy, true);
284 ret = reset_control_deassert(iphy->app_rst);
287 COMBO_PHY_ID(iphy), PHY_ID(iphy));
302 static int intel_cbphy_iphy_power_off(struct intel_cbphy_iphy *iphy)
304 struct intel_combo_phy *cbphy = iphy->parent;
307 ret = reset_control_assert(iphy->app_rst);
310 COMBO_PHY_ID(iphy), PHY_ID(iphy));
314 ret = intel_cbphy_iphy_enable(iphy, false);
331 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy);
332 struct intel_combo_phy *cbphy = iphy->parent;
336 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_iphy_power_on);
341 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_pcie_en_pad_refclk);
356 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy);
357 struct intel_combo_phy *cbphy = iphy->parent;
363 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_pcie_dis_pad_refclk);
368 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_iphy_power_off);
378 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy);
379 struct intel_combo_phy *cbphy = iphy->parent;
386 id = PHY_ID(iphy);
430 cbphy->iphy[0].app_rst = devm_reset_control_get_optional(dev, "iphy0");
431 if (IS_ERR(cbphy->iphy[0].app_rst))
432 return dev_err_probe(dev, PTR_ERR(cbphy->iphy[0].app_rst),
435 cbphy->iphy[1].app_rst = devm_reset_control_get_optional(dev, "iphy1");
436 if (IS_ERR(cbphy->iphy[1].app_rst))
437 return dev_err_probe(dev, PTR_ERR(cbphy->iphy[1].app_rst),
532 return cbphy->iphy[iphy_id].phy;
539 struct intel_cbphy_iphy *iphy;
543 iphy = &cbphy->iphy[i];
544 iphy->parent = cbphy;
545 iphy->id = i;
548 if (cbphy->aggr_mode == PHY_DL_MODE && iphy->id == PHY_1)
551 iphy->phy = devm_phy_create(dev, NULL, &intel_cbphy_ops);
552 if (IS_ERR(iphy->phy)) {
554 COMBO_PHY_ID(iphy), PHY_ID(iphy));
556 return PTR_ERR(iphy->phy);
559 phy_set_drvdata(iphy->phy, iphy);