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);
439 cbphy->iphy[0].app_rst = devm_reset_control_get_optional(dev, "iphy0");
440 if (IS_ERR(cbphy->iphy[0].app_rst)) {
441 ret = PTR_ERR(cbphy->iphy[0].app_rst);
447 cbphy->iphy[1].app_rst = devm_reset_control_get_optional(dev, "iphy1");
448 if (IS_ERR(cbphy->iphy[1].app_rst)) {
449 ret = PTR_ERR(cbphy->iphy[1].app_rst);
547 return cbphy->iphy[iphy_id].phy;
554 struct intel_cbphy_iphy *iphy;
558 iphy = &cbphy->iphy[i];
559 iphy->parent = cbphy;
560 iphy->id = i;
563 if (cbphy->aggr_mode == PHY_DL_MODE && iphy->id == PHY_1)
566 iphy->phy = devm_phy_create(dev, NULL, &intel_cbphy_ops);
567 if (IS_ERR(iphy->phy)) {
569 COMBO_PHY_ID(iphy), PHY_ID(iphy));
571 return PTR_ERR(iphy->phy);
574 phy_set_drvdata(iphy->phy, iphy);