Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: cadence-torrent: remove noop_ops phy operations

Even if a PHY is already configured, the PHY operations are needed during
resume stage, as the PHY is in reset state.
The noop_ops PHY operations is removed to always have PHY operations.
The already_configured flag is checked at the begening of init, configure
and poweron operations to keep the already_configured behaviour.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20240412-j7200-phy-s2r-v1-7-f15815833974@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Thomas Richard and committed by
Vinod Koul
81472a55 d4f24d14

+13 -17
+13 -17
drivers/phy/cadence/phy-cadence-torrent.c
··· 1595 1595 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent); 1596 1596 int ret; 1597 1597 1598 + if (cdns_phy->already_configured) 1599 + return 0; 1600 + 1598 1601 ret = cdns_torrent_dp_verify_config(inst, &opts->dp); 1599 1602 if (ret) { 1600 1603 dev_err(&phy->dev, "invalid params for phy configure\n"); ··· 1632 1629 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent); 1633 1630 u32 read_val; 1634 1631 int ret; 1632 + 1633 + if (cdns_phy->already_configured) { 1634 + /* Give 5ms to 10ms delay for the PIPE clock to be stable */ 1635 + usleep_range(5000, 10000); 1636 + return 0; 1637 + } 1635 1638 1636 1639 if (cdns_phy->nsubnodes == 1) { 1637 1640 /* Take the PHY lane group out of reset */ ··· 2317 2308 u32 num_regs; 2318 2309 int i, j; 2319 2310 2311 + if (cdns_phy->already_configured) 2312 + return 0; 2313 + 2320 2314 if (cdns_phy->nsubnodes > 1) { 2321 2315 if (phy_type == TYPE_DP) 2322 2316 return cdns_torrent_dp_multilink_init(cdns_phy, inst, phy); ··· 2454 2442 .configure = cdns_torrent_dp_configure, 2455 2443 .power_on = cdns_torrent_phy_on, 2456 2444 .power_off = cdns_torrent_phy_off, 2457 - .owner = THIS_MODULE, 2458 - }; 2459 - 2460 - static int cdns_torrent_noop_phy_on(struct phy *phy) 2461 - { 2462 - /* Give 5ms to 10ms delay for the PIPE clock to be stable */ 2463 - usleep_range(5000, 10000); 2464 - 2465 - return 0; 2466 - } 2467 - 2468 - static const struct phy_ops noop_ops = { 2469 - .power_on = cdns_torrent_noop_phy_on, 2470 2445 .owner = THIS_MODULE, 2471 2446 }; 2472 2447 ··· 2936 2937 of_property_read_u32(child, "cdns,ssc-mode", 2937 2938 &cdns_phy->phys[node].ssc_mode); 2938 2939 2939 - if (!cdns_phy->already_configured) 2940 - gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); 2941 - else 2942 - gphy = devm_phy_create(dev, child, &noop_ops); 2940 + gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); 2943 2941 if (IS_ERR(gphy)) { 2944 2942 ret = PTR_ERR(gphy); 2945 2943 goto put_child;