Lines Matching refs:iphy

98 	struct intel_cbphy_iphy	iphy[PHY_MAX_NUM];  member
105 static int intel_cbphy_iphy_enable(struct intel_cbphy_iphy *iphy, bool set) in intel_cbphy_iphy_enable() argument
107 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_iphy_enable()
108 u32 mask = BIT(cbphy->phy_mode * 2 + iphy->id); in intel_cbphy_iphy_enable()
118 static int intel_cbphy_pcie_refclk_cfg(struct intel_cbphy_iphy *iphy, bool set) in intel_cbphy_pcie_refclk_cfg() argument
120 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_pcie_refclk_cfg()
121 u32 mask = BIT(cbphy->id * 2 + iphy->id); in intel_cbphy_pcie_refclk_cfg()
141 static int intel_cbphy_iphy_cfg(struct intel_cbphy_iphy *iphy, in intel_cbphy_iphy_cfg() argument
144 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_iphy_cfg()
147 ret = phy_cfg(iphy); in intel_cbphy_iphy_cfg()
154 return phy_cfg(&cbphy->iphy[PHY_1]); in intel_cbphy_iphy_cfg()
157 static int intel_cbphy_pcie_en_pad_refclk(struct intel_cbphy_iphy *iphy) in intel_cbphy_pcie_en_pad_refclk() argument
159 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_pcie_en_pad_refclk()
162 ret = intel_cbphy_pcie_refclk_cfg(iphy, true); in intel_cbphy_pcie_en_pad_refclk()
180 static int intel_cbphy_pcie_dis_pad_refclk(struct intel_cbphy_iphy *iphy) in intel_cbphy_pcie_dis_pad_refclk() argument
182 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_pcie_dis_pad_refclk()
185 ret = intel_cbphy_pcie_refclk_cfg(iphy, false); in intel_cbphy_pcie_dis_pad_refclk()
252 static int intel_cbphy_iphy_power_on(struct intel_cbphy_iphy *iphy) in intel_cbphy_iphy_power_on() argument
254 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_iphy_power_on()
278 ret = intel_cbphy_iphy_enable(iphy, true); in intel_cbphy_iphy_power_on()
284 ret = reset_control_deassert(iphy->app_rst); in intel_cbphy_iphy_power_on()
287 COMBO_PHY_ID(iphy), PHY_ID(iphy)); in intel_cbphy_iphy_power_on()
302 static int intel_cbphy_iphy_power_off(struct intel_cbphy_iphy *iphy) in intel_cbphy_iphy_power_off() argument
304 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_iphy_power_off()
307 ret = reset_control_assert(iphy->app_rst); in intel_cbphy_iphy_power_off()
310 COMBO_PHY_ID(iphy), PHY_ID(iphy)); in intel_cbphy_iphy_power_off()
314 ret = intel_cbphy_iphy_enable(iphy, false); in intel_cbphy_iphy_power_off()
331 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy); in intel_cbphy_init() local
332 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_init()
336 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_iphy_power_on); in intel_cbphy_init()
341 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_pcie_en_pad_refclk); in intel_cbphy_init()
356 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy); in intel_cbphy_exit() local
357 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_exit()
363 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_pcie_dis_pad_refclk); in intel_cbphy_exit()
368 ret = intel_cbphy_iphy_cfg(iphy, intel_cbphy_iphy_power_off); in intel_cbphy_exit()
378 struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy); in intel_cbphy_calibrate() local
379 struct intel_combo_phy *cbphy = iphy->parent; in intel_cbphy_calibrate()
386 id = PHY_ID(iphy); in intel_cbphy_calibrate()
439 cbphy->iphy[0].app_rst = devm_reset_control_get_optional(dev, "iphy0"); in intel_cbphy_fwnode_parse()
440 if (IS_ERR(cbphy->iphy[0].app_rst)) { in intel_cbphy_fwnode_parse()
441 ret = PTR_ERR(cbphy->iphy[0].app_rst); in intel_cbphy_fwnode_parse()
447 cbphy->iphy[1].app_rst = devm_reset_control_get_optional(dev, "iphy1"); in intel_cbphy_fwnode_parse()
448 if (IS_ERR(cbphy->iphy[1].app_rst)) { in intel_cbphy_fwnode_parse()
449 ret = PTR_ERR(cbphy->iphy[1].app_rst); in intel_cbphy_fwnode_parse()
547 return cbphy->iphy[iphy_id].phy; in intel_cbphy_xlate()
554 struct intel_cbphy_iphy *iphy; in intel_cbphy_create() local
558 iphy = &cbphy->iphy[i]; in intel_cbphy_create()
559 iphy->parent = cbphy; in intel_cbphy_create()
560 iphy->id = i; in intel_cbphy_create()
563 if (cbphy->aggr_mode == PHY_DL_MODE && iphy->id == PHY_1) in intel_cbphy_create()
566 iphy->phy = devm_phy_create(dev, NULL, &intel_cbphy_ops); in intel_cbphy_create()
567 if (IS_ERR(iphy->phy)) { in intel_cbphy_create()
569 COMBO_PHY_ID(iphy), PHY_ID(iphy)); in intel_cbphy_create()
571 return PTR_ERR(iphy->phy); in intel_cbphy_create()
574 phy_set_drvdata(iphy->phy, iphy); in intel_cbphy_create()