Lines Matching defs:cdns_phy
711 void cdns_torrent_dp_enable_ssc_19_2mhz(struct cdns_torrent_phy *cdns_phy,
714 struct regmap *regmap = cdns_phy->regmap_common_cdb;
727 void cdns_torrent_dp_pma_cmn_vco_cfg_19_2mhz(struct cdns_torrent_phy *cdns_phy,
730 struct regmap *regmap = cdns_phy->regmap_common_cdb;
748 cdns_torrent_dp_enable_ssc_19_2mhz(cdns_phy, 0x033A, 0x006A);
765 cdns_torrent_dp_enable_ssc_19_2mhz(cdns_phy, 0x05DD, 0x0069);
781 cdns_torrent_dp_enable_ssc_19_2mhz(cdns_phy, 0x0536, 0x0069);
796 cdns_torrent_dp_enable_ssc_19_2mhz(cdns_phy, 0x04D7, 0x006A);
831 static void cdns_torrent_dp_enable_ssc_25mhz(struct cdns_torrent_phy *cdns_phy,
834 struct regmap *regmap = cdns_phy->regmap_common_cdb;
847 void cdns_torrent_dp_pma_cmn_vco_cfg_25mhz(struct cdns_torrent_phy *cdns_phy,
850 struct regmap *regmap = cdns_phy->regmap_common_cdb;
866 cdns_torrent_dp_enable_ssc_25mhz(cdns_phy, 0x0423);
881 cdns_torrent_dp_enable_ssc_25mhz(cdns_phy, 0x03B9);
895 cdns_torrent_dp_enable_ssc_25mhz(cdns_phy, 0x034F);
908 cdns_torrent_dp_enable_ssc_25mhz(cdns_phy, 0x031A);
951 void cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(struct cdns_torrent_phy *cdns_phy,
954 struct regmap *regmap = cdns_phy->regmap_common_cdb;
961 if (cdns_phy->dp_pll & DP_PLL0)
964 if (cdns_phy->dp_pll & DP_PLL1) {
974 if (cdns_phy->dp_pll & DP_PLL0) {
985 if (cdns_phy->dp_pll & DP_PLL1) {
1000 if (cdns_phy->dp_pll & DP_PLL0) {
1011 if (cdns_phy->dp_pll & DP_PLL1) {
1025 if (cdns_phy->dp_pll & DP_PLL0) {
1035 if (cdns_phy->dp_pll & DP_PLL1) {
1050 static int cdns_torrent_dp_get_pll(struct cdns_torrent_phy *cdns_phy,
1056 cdns_phy->dp_pll = DP_PLL1;
1060 cdns_phy->dp_pll = DP_PLL0;
1063 cdns_phy->dp_pll = DP_PLL0 | DP_PLL1;
1066 dev_err(cdns_phy->dev, "Unsupported PHY configuration\n");
1076 static int cdns_torrent_dp_set_pll_en(struct cdns_torrent_phy *cdns_phy,
1081 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1118 static int cdns_torrent_dp_set_power_state(struct cdns_torrent_phy *cdns_phy,
1129 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1163 static int cdns_torrent_dp_run(struct cdns_torrent_phy *cdns_phy,
1168 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1178 dev_err(cdns_phy->dev,
1185 ret = cdns_torrent_dp_set_power_state(cdns_phy, inst, num_lanes,
1190 ret = cdns_torrent_dp_set_power_state(cdns_phy, inst, num_lanes,
1196 static int cdns_torrent_dp_wait_pma_cmn_ready(struct cdns_torrent_phy *cdns_phy)
1200 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1205 dev_err(cdns_phy->dev,
1213 static void cdns_torrent_dp_pma_cmn_rate(struct cdns_torrent_phy *cdns_phy,
1247 if (cdns_phy->dp_pll & DP_PLL0)
1248 cdns_torrent_phy_write(cdns_phy->regmap_common_cdb,
1251 if (cdns_phy->dp_pll & DP_PLL1)
1252 cdns_torrent_phy_write(cdns_phy->regmap_common_cdb,
1257 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + i],
1265 static int cdns_torrent_dp_configure_rate(struct cdns_torrent_phy *cdns_phy,
1276 ret = regmap_field_read(cdns_phy->phy_pma_pll_raw_ctrl, &field_val);
1279 field_val &= ~(cdns_phy->dp_pll);
1280 regmap_field_write(cdns_phy->phy_pma_pll_raw_ctrl, field_val);
1287 if (cdns_phy->dp_pll & DP_PLL0) {
1288 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pma_cmn_ctrl_2,
1296 if ((cdns_phy->dp_pll & DP_PLL1) && cdns_phy->nsubnodes != 1) {
1297 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pma_cmn_ctrl_2,
1307 if (cdns_phy->ref_clk_rate == CLK_19_2_MHZ)
1309 cdns_torrent_dp_pma_cmn_vco_cfg_19_2mhz(cdns_phy, dp->link_rate, dp->ssc);
1310 else if (cdns_phy->ref_clk_rate == CLK_25_MHZ)
1312 cdns_torrent_dp_pma_cmn_vco_cfg_25mhz(cdns_phy, dp->link_rate, dp->ssc);
1313 else if (cdns_phy->ref_clk_rate == CLK_100_MHZ)
1315 cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(cdns_phy, dp->link_rate, dp->ssc);
1317 cdns_torrent_dp_pma_cmn_rate(cdns_phy, inst, dp->link_rate, dp->lanes);
1320 ret = regmap_field_read(cdns_phy->phy_pma_pll_raw_ctrl, &field_val);
1323 field_val |= cdns_phy->dp_pll;
1324 regmap_field_write(cdns_phy->phy_pma_pll_raw_ctrl, field_val);
1331 if (cdns_phy->dp_pll & DP_PLL0) {
1332 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pma_cmn_ctrl_2,
1340 if ((cdns_phy->dp_pll & DP_PLL1) && cdns_phy->nsubnodes != 1)
1341 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pma_cmn_ctrl_2,
1412 static void cdns_torrent_dp_set_a0_pll(struct cdns_torrent_phy *cdns_phy,
1416 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1435 static int cdns_torrent_dp_set_lanes(struct cdns_torrent_phy *cdns_phy,
1441 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1478 cdns_torrent_dp_set_a0_pll(cdns_phy, inst, dp->lanes);
1490 ret = cdns_torrent_dp_wait_pma_cmn_ready(cdns_phy);
1501 ret = cdns_torrent_dp_run(cdns_phy, inst, dp->lanes);
1507 static int cdns_torrent_dp_set_rate(struct cdns_torrent_phy *cdns_phy,
1513 ret = cdns_torrent_dp_set_power_state(cdns_phy, inst, dp->lanes,
1517 ret = cdns_torrent_dp_set_pll_en(cdns_phy, inst, dp, false);
1522 ret = cdns_torrent_dp_configure_rate(cdns_phy, inst, dp);
1527 ret = cdns_torrent_dp_set_pll_en(cdns_phy, inst, dp, true);
1530 ret = cdns_torrent_dp_set_power_state(cdns_phy, inst, dp->lanes,
1534 ret = cdns_torrent_dp_set_power_state(cdns_phy, inst, dp->lanes,
1544 static void cdns_torrent_dp_set_voltages(struct cdns_torrent_phy *cdns_phy,
1552 val = cdns_torrent_phy_read(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1559 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1562 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1565 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1568 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1572 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1576 val = cdns_torrent_phy_read(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1583 cdns_torrent_phy_write(cdns_phy->regmap_tx_lane_cdb[inst->mlane + lane],
1592 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent);
1602 ret = cdns_torrent_dp_set_lanes(cdns_phy, inst, &opts->dp);
1610 ret = cdns_torrent_dp_set_rate(cdns_phy, inst, &opts->dp);
1618 cdns_torrent_dp_set_voltages(cdns_phy, inst, &opts->dp);
1626 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent);
1630 if (cdns_phy->nsubnodes == 1) {
1635 ret = reset_control_deassert(cdns_phy->phy_rst);
1644 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pma_cmn_ctrl_1,
1648 dev_err(cdns_phy->dev, "Timeout waiting for CMN ready\n");
1653 ret = regmap_field_read_poll_timeout(cdns_phy->phy_pcs_iso_link_ctrl_1[inst->mlane],
1657 dev_err(cdns_phy->dev, "Timeout waiting for PHY status ready\n");
1668 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent);
1671 if (cdns_phy->nsubnodes != 1)
1674 ret = reset_control_assert(cdns_phy->phy_rst);
1681 static void cdns_torrent_dp_common_init(struct cdns_torrent_phy *cdns_phy,
1684 struct regmap *regmap = cdns_phy->regmap_dptx_phy_reg;
1694 cdns_torrent_dp_set_a0_pll(cdns_phy, inst, inst->num_lanes);
1716 if (cdns_phy->ref_clk_rate == CLK_19_2_MHZ)
1717 cdns_torrent_dp_pma_cmn_vco_cfg_19_2mhz(cdns_phy,
1718 cdns_phy->max_bit_rate,
1720 else if (cdns_phy->ref_clk_rate == CLK_25_MHZ)
1721 cdns_torrent_dp_pma_cmn_vco_cfg_25mhz(cdns_phy,
1722 cdns_phy->max_bit_rate,
1724 else if (cdns_phy->ref_clk_rate == CLK_100_MHZ)
1725 cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(cdns_phy,
1726 cdns_phy->max_bit_rate,
1729 cdns_torrent_dp_pma_cmn_rate(cdns_phy, inst, cdns_phy->max_bit_rate,
1733 regmap_field_write(cdns_phy->phy_reset_ctrl, 0x1);
1736 static int cdns_torrent_dp_start(struct cdns_torrent_phy *cdns_phy,
1746 ret = cdns_torrent_dp_wait_pma_cmn_ready(cdns_phy);
1750 ret = cdns_torrent_dp_run(cdns_phy, inst, inst->num_lanes);
1758 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent);
1761 switch (cdns_phy->ref_clk_rate) {
1768 dev_err(cdns_phy->dev, "Unsupported Ref Clock Rate\n");
1772 ret = cdns_torrent_dp_get_pll(cdns_phy, TYPE_NONE);
1776 cdns_torrent_dp_common_init(cdns_phy, inst);
1778 return cdns_torrent_dp_start(cdns_phy, inst, phy);
1781 static int cdns_torrent_dp_multilink_init(struct cdns_torrent_phy *cdns_phy,
1785 if (cdns_phy->ref_clk_rate != CLK_100_MHZ) {
1786 dev_err(cdns_phy->dev, "Unsupported Ref Clock Rate\n");
1790 cdns_torrent_dp_common_init(cdns_phy, inst);
1792 return cdns_torrent_dp_start(cdns_phy, inst, phy);
1829 static int cdns_torrent_derived_refclk_register(struct cdns_torrent_phy *cdns_phy)
1832 struct device *dev = cdns_phy->dev;
1864 derived_refclk->phy_pipe_cmn_ctrl1_0 = cdns_phy->phy_pipe_cmn_ctrl1_0;
1865 derived_refclk->cmn_cdiag_refclk_ovrd_4 = cdns_phy->cmn_cdiag_refclk_ovrd_4;
1874 cdns_phy->clk_hw_data->hws[CDNS_TORRENT_DERIVED_REFCLK] = hw;
1912 static int cdns_torrent_received_refclk_register(struct cdns_torrent_phy *cdns_phy)
1915 struct device *dev = cdns_phy->dev;
1947 received_refclk->phy_pipe_cmn_ctrl1_0 = cdns_phy->phy_pipe_cmn_ctrl1_0;
1948 received_refclk->cmn_cdiag_refclk_ovrd_4 = cdns_phy->cmn_cdiag_refclk_ovrd_4;
1957 cdns_phy->clk_hw_data->hws[CDNS_TORRENT_RECEIVED_REFCLK] = hw;
2017 static int cdns_torrent_refclk_driver_register(struct cdns_torrent_phy *cdns_phy)
2020 struct device *dev = cdns_phy->dev;
2040 hw = cdns_phy->clk_hw_data->hws[refclk_driver_parent_index[i]];
2059 regmap = cdns_phy->regmap_common_cdb;
2080 cdns_phy->clk_hw_data->hws[CDNS_TORRENT_REFCLK_DRIVER] = hw;
2103 static int cdns_torrent_dp_regfield_init(struct cdns_torrent_phy *cdns_phy)
2105 struct device *dev = cdns_phy->dev;
2109 regmap = cdns_phy->regmap_dptx_phy_reg;
2115 cdns_phy->phy_reset_ctrl = field;
2120 static int cdns_torrent_regfield_init(struct cdns_torrent_phy *cdns_phy)
2122 struct device *dev = cdns_phy->dev;
2127 regmap = cdns_phy->regmap_phy_pcs_common_cdb;
2133 cdns_phy->phy_pll_cfg = field;
2135 regmap = cdns_phy->regmap_phy_pcs_common_cdb;
2141 cdns_phy->phy_pipe_cmn_ctrl1_0 = field;
2143 regmap = cdns_phy->regmap_common_cdb;
2149 cdns_phy->cmn_cdiag_refclk_ovrd_4 = field;
2151 regmap = cdns_phy->regmap_phy_pma_common_cdb;
2157 cdns_phy->phy_pma_cmn_ctrl_1 = field;
2159 regmap = cdns_phy->regmap_phy_pma_common_cdb;
2165 cdns_phy->phy_pma_cmn_ctrl_2 = field;
2167 regmap = cdns_phy->regmap_phy_pma_common_cdb;
2173 cdns_phy->phy_pma_pll_raw_ctrl = field;
2176 regmap = cdns_phy->regmap_phy_pcs_lane_cdb[i];
2182 cdns_phy->phy_pcs_iso_link_ctrl_1[i] = field;
2188 static int cdns_torrent_dp_regmap_init(struct cdns_torrent_phy *cdns_phy)
2190 void __iomem *base = cdns_phy->base;
2191 struct device *dev = cdns_phy->dev;
2196 reg_offset_shift = cdns_phy->init_data->reg_offset_shift;
2206 cdns_phy->regmap_dptx_phy_reg = regmap;
2211 static int cdns_torrent_regmap_init(struct cdns_torrent_phy *cdns_phy)
2213 void __iomem *sd_base = cdns_phy->sd_base;
2215 struct device *dev = cdns_phy->dev;
2220 block_offset_shift = cdns_phy->init_data->block_offset_shift;
2221 reg_offset_shift = cdns_phy->init_data->reg_offset_shift;
2233 cdns_phy->regmap_tx_lane_cdb[i] = regmap;
2244 cdns_phy->regmap_rx_lane_cdb[i] = regmap;
2255 cdns_phy->regmap_phy_pcs_lane_cdb[i] = regmap;
2266 cdns_phy->regmap_common_cdb = regmap;
2276 cdns_phy->regmap_phy_pcs_common_cdb = regmap;
2286 cdns_phy->regmap_phy_pma_common_cdb = regmap;
2293 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent);
2294 const struct cdns_torrent_data *init_data = cdns_phy->init_data;
2296 enum cdns_torrent_ref_clk ref_clk = cdns_phy->ref_clk_rate;
2308 if (cdns_phy->nsubnodes > 1) {
2310 return cdns_torrent_dp_multilink_init(cdns_phy, inst, phy);
2329 regmap = cdns_phy->regmap_common_cdb;
2335 regmap_field_write(cdns_phy->phy_pll_cfg, reg_pairs[0].val);
2350 regmap = cdns_phy->regmap_tx_lane_cdb[i + inst->mlane];
2365 regmap = cdns_phy->regmap_phy_pcs_common_cdb;
2379 regmap = cdns_phy->regmap_phy_pma_common_cdb;
2393 regmap = cdns_phy->regmap_common_cdb;
2408 regmap = cdns_phy->regmap_tx_lane_cdb[i + inst->mlane];
2424 regmap = cdns_phy->regmap_rx_lane_cdb[i + inst->mlane];
2459 int cdns_torrent_phy_configure_multilink(struct cdns_torrent_phy *cdns_phy)
2461 const struct cdns_torrent_data *init_data = cdns_phy->init_data;
2463 enum cdns_torrent_ref_clk ref_clk = cdns_phy->ref_clk_rate;
2474 if (cdns_phy->nsubnodes != 2)
2477 phy_t1 = cdns_phy->phys[0].phy_type;
2478 phy_t2 = cdns_phy->phys[1].phy_type;
2484 for (node = 0; node < cdns_phy->nsubnodes; node++) {
2494 mlane = cdns_phy->phys[node].mlane;
2495 ssc = cdns_phy->phys[node].ssc_mode;
2496 num_lanes = cdns_phy->phys[node].num_lanes;
2514 regmap = cdns_phy->regmap_common_cdb;
2520 regmap_field_write(cdns_phy->phy_pll_cfg,
2535 regmap = cdns_phy->regmap_tx_lane_cdb[i + mlane];
2549 regmap = cdns_phy->regmap_phy_pcs_common_cdb;
2562 regmap = cdns_phy->regmap_common_cdb;
2576 regmap = cdns_phy->regmap_tx_lane_cdb[i + mlane];
2591 regmap = cdns_phy->regmap_rx_lane_cdb[i + mlane];
2599 ret = cdns_torrent_dp_get_pll(cdns_phy, phy_t2);
2604 reset_control_deassert(cdns_phy->phys[node].lnk_rst);
2608 ret = reset_control_deassert(cdns_phy->phy_rst);
2615 static void cdns_torrent_clk_cleanup(struct cdns_torrent_phy *cdns_phy)
2617 struct device *dev = cdns_phy->dev;
2622 static int cdns_torrent_clk_register(struct cdns_torrent_phy *cdns_phy)
2624 struct device *dev = cdns_phy->dev;
2634 cdns_phy->clk_hw_data = data;
2636 ret = cdns_torrent_derived_refclk_register(cdns_phy);
2642 ret = cdns_torrent_received_refclk_register(cdns_phy);
2648 ret = cdns_torrent_refclk_driver_register(cdns_phy);
2663 static int cdns_torrent_reset(struct cdns_torrent_phy *cdns_phy)
2665 struct device *dev = cdns_phy->dev;
2667 cdns_phy->phy_rst = devm_reset_control_get_exclusive_by_index(dev, 0);
2668 if (IS_ERR(cdns_phy->phy_rst)) {
2671 return PTR_ERR(cdns_phy->phy_rst);
2674 cdns_phy->apb_rst = devm_reset_control_get_optional_exclusive(dev, "torrent_apb");
2675 if (IS_ERR(cdns_phy->apb_rst)) {
2678 return PTR_ERR(cdns_phy->apb_rst);
2684 static int cdns_torrent_clk(struct cdns_torrent_phy *cdns_phy)
2686 struct device *dev = cdns_phy->dev;
2690 cdns_phy->clk = devm_clk_get(dev, "refclk");
2691 if (IS_ERR(cdns_phy->clk)) {
2693 return PTR_ERR(cdns_phy->clk);
2696 ret = clk_prepare_enable(cdns_phy->clk);
2698 dev_err(cdns_phy->dev, "Failed to prepare ref clock\n");
2702 ref_clk_rate = clk_get_rate(cdns_phy->clk);
2704 dev_err(cdns_phy->dev, "Failed to get ref clock rate\n");
2705 clk_disable_unprepare(cdns_phy->clk);
2711 cdns_phy->ref_clk_rate = CLK_19_2_MHZ;
2714 cdns_phy->ref_clk_rate = CLK_25_MHZ;
2717 cdns_phy->ref_clk_rate = CLK_100_MHZ;
2720 cdns_phy->ref_clk_rate = CLK_156_25_MHZ;
2723 dev_err(cdns_phy->dev, "Invalid Ref Clock Rate\n");
2724 clk_disable_unprepare(cdns_phy->clk);
2733 struct cdns_torrent_phy *cdns_phy;
2749 cdns_phy = devm_kzalloc(dev, sizeof(*cdns_phy), GFP_KERNEL);
2750 if (!cdns_phy)
2753 dev_set_drvdata(dev, cdns_phy);
2754 cdns_phy->dev = dev;
2755 cdns_phy->init_data = data;
2757 cdns_phy->sd_base = devm_platform_ioremap_resource(pdev, 0);
2758 if (IS_ERR(cdns_phy->sd_base))
2759 return PTR_ERR(cdns_phy->sd_base);
2767 ret = cdns_torrent_regmap_init(cdns_phy);
2771 ret = cdns_torrent_regfield_init(cdns_phy);
2775 ret = cdns_torrent_clk_register(cdns_phy);
2779 regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &already_configured);
2782 ret = cdns_torrent_reset(cdns_phy);
2786 ret = cdns_torrent_clk(cdns_phy);
2791 reset_control_deassert(cdns_phy->apb_rst);
2801 cdns_phy->phys[node].lnk_rst =
2803 if (IS_ERR(cdns_phy->phys[node].lnk_rst)) {
2806 ret = PTR_ERR(cdns_phy->phys[node].lnk_rst);
2811 &cdns_phy->phys[node].mlane)) {
2827 cdns_phy->phys[node].phy_type = TYPE_PCIE;
2830 cdns_phy->phys[node].phy_type = TYPE_DP;
2833 cdns_phy->phys[node].phy_type = TYPE_SGMII;
2836 cdns_phy->phys[node].phy_type = TYPE_QSGMII;
2839 cdns_phy->phys[node].phy_type = TYPE_USB;
2842 cdns_phy->phys[node].phy_type = TYPE_USXGMII;
2851 &cdns_phy->phys[node].num_lanes)) {
2858 total_num_lanes += cdns_phy->phys[node].num_lanes;
2861 cdns_phy->phys[node].ssc_mode = NO_SSC;
2863 &cdns_phy->phys[node].ssc_mode);
2874 if (cdns_phy->phys[node].phy_type == TYPE_DP) {
2875 switch (cdns_phy->phys[node].num_lanes) {
2883 cdns_phy->phys[node].num_lanes);
2888 cdns_phy->max_bit_rate = DEFAULT_MAX_BIT_RATE;
2890 &cdns_phy->max_bit_rate);
2892 switch (cdns_phy->max_bit_rate) {
2905 cdns_phy->max_bit_rate);
2911 cdns_phy->base = devm_platform_ioremap_resource(pdev, 1);
2912 if (IS_ERR(cdns_phy->base)) {
2913 ret = PTR_ERR(cdns_phy->base);
2918 ret = cdns_torrent_dp_regmap_init(cdns_phy);
2922 ret = cdns_torrent_dp_regfield_init(cdns_phy);
2930 cdns_phy->max_bit_rate / 1000,
2931 cdns_phy->max_bit_rate % 1000);
2933 gphy->attrs.bus_width = cdns_phy->phys[node].num_lanes;
2934 gphy->attrs.max_link_rate = cdns_phy->max_bit_rate;
2938 cdns_phy->phys[node].phy = gphy;
2939 phy_set_drvdata(gphy, &cdns_phy->phys[node]);
2943 cdns_phy->nsubnodes = node;
2951 if (cdns_phy->nsubnodes > 1 && !already_configured) {
2952 ret = cdns_torrent_phy_configure_multilink(cdns_phy);
2963 if (cdns_phy->nsubnodes > 1)
2965 cdns_torrent_get_phy_type(cdns_phy->phys[0].phy_type),
2966 cdns_phy->phys[0].num_lanes,
2967 cdns_torrent_get_phy_type(cdns_phy->phys[1].phy_type),
2968 cdns_phy->phys[1].num_lanes);
2971 cdns_torrent_get_phy_type(cdns_phy->phys[0].phy_type),
2972 cdns_phy->phys[0].num_lanes);
2980 reset_control_put(cdns_phy->phys[i].lnk_rst);
2982 reset_control_assert(cdns_phy->apb_rst);
2983 clk_disable_unprepare(cdns_phy->clk);
2985 cdns_torrent_clk_cleanup(cdns_phy);
2991 struct cdns_torrent_phy *cdns_phy = platform_get_drvdata(pdev);
2994 reset_control_assert(cdns_phy->phy_rst);
2995 reset_control_assert(cdns_phy->apb_rst);
2996 for (i = 0; i < cdns_phy->nsubnodes; i++) {
2997 reset_control_assert(cdns_phy->phys[i].lnk_rst);
2998 reset_control_put(cdns_phy->phys[i].lnk_rst);
3001 clk_disable_unprepare(cdns_phy->clk);
3002 cdns_torrent_clk_cleanup(cdns_phy);