phy: cadence-torrent: add already_configured to struct cdns_torrent_phy

Add already_configured to struct cdns_torrent_phy, so it can be used at
differents stages.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20240412-j7200-phy-s2r-v1-6-f15815833974@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Thomas Richard 2024-04-16 14:52:35 +02:00 committed by Vinod Koul
parent 8512b68734
commit d4f24d14f3

View File

@ -360,6 +360,7 @@ struct cdns_torrent_phy {
enum cdns_torrent_ref_clk ref_clk1_rate; enum cdns_torrent_ref_clk ref_clk1_rate;
struct cdns_torrent_inst phys[MAX_NUM_LANES]; struct cdns_torrent_inst phys[MAX_NUM_LANES];
int nsubnodes; int nsubnodes;
int already_configured;
const struct cdns_torrent_data *init_data; const struct cdns_torrent_data *init_data;
struct regmap *regmap_common_cdb; struct regmap *regmap_common_cdb;
struct regmap *regmap_phy_pcs_common_cdb; struct regmap *regmap_phy_pcs_common_cdb;
@ -2808,7 +2809,6 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
struct device_node *child; struct device_node *child;
int ret, subnodes, node = 0, i; int ret, subnodes, node = 0, i;
u32 total_num_lanes = 0; u32 total_num_lanes = 0;
int already_configured;
u8 init_dp_regmap = 0; u8 init_dp_regmap = 0;
u32 phy_type; u32 phy_type;
@ -2855,9 +2855,9 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
if (ret) if (ret)
goto clk_cleanup; goto clk_cleanup;
regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &already_configured); regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &cdns_phy->already_configured);
if (!already_configured) { if (!cdns_phy->already_configured) {
ret = cdns_torrent_clk(cdns_phy); ret = cdns_torrent_clk(cdns_phy);
if (ret) if (ret)
goto clk_cleanup; goto clk_cleanup;
@ -2937,7 +2937,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
of_property_read_u32(child, "cdns,ssc-mode", of_property_read_u32(child, "cdns,ssc-mode",
&cdns_phy->phys[node].ssc_mode); &cdns_phy->phys[node].ssc_mode);
if (!already_configured) if (!cdns_phy->already_configured)
gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops);
else else
gphy = devm_phy_create(dev, child, &noop_ops); gphy = devm_phy_create(dev, child, &noop_ops);
@ -3023,7 +3023,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
goto put_lnk_rst; goto put_lnk_rst;
} }
if (cdns_phy->nsubnodes > 1 && !already_configured) { if (cdns_phy->nsubnodes > 1 && !cdns_phy->already_configured) {
ret = cdns_torrent_phy_configure_multilink(cdns_phy); ret = cdns_torrent_phy_configure_multilink(cdns_phy);
if (ret) if (ret)
goto put_lnk_rst; goto put_lnk_rst;