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: restore parent clock for refclk during resume

While suspend and resume, parent clock config for refclk was getting lost.
So save and restore it in suspend and resume operations.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Thomas Richard (TI.com) <thomas.richard@bootlin.com>
Link: https://patch.msgid.link/20251216-phy-cadence-torrent-resume-restore-refclk-parent-v3-1-8a7ed84b47e3@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Thomas Richard (TI.com) and committed by
Vinod Koul
434e1a0e 53f6240e

+23
+23
drivers/phy/cadence/phy-cadence-torrent.c
··· 397 397 struct clk_hw hw; 398 398 struct regmap_field *cmn_fields[REFCLK_OUT_NUM_CMN_CONFIG]; 399 399 struct clk_init_data clk_data; 400 + u8 parent_index; 400 401 }; 401 402 402 403 #define to_cdns_torrent_refclk_driver(_hw) \ ··· 3327 3326 .num_regs = ARRAY_SIZE(sgmii_qsgmii_xcvr_diag_ln_regs), 3328 3327 }; 3329 3328 3329 + static void cdns_torrent_refclk_driver_suspend(struct cdns_torrent_phy *cdns_phy) 3330 + { 3331 + struct clk_hw *hw = cdns_phy->clk_hw_data->hws[CDNS_TORRENT_REFCLK_DRIVER]; 3332 + struct cdns_torrent_refclk_driver *refclk_driver = to_cdns_torrent_refclk_driver(hw); 3333 + 3334 + refclk_driver->parent_index = cdns_torrent_refclk_driver_get_parent(hw); 3335 + } 3336 + 3337 + static int cdns_torrent_refclk_driver_resume(struct cdns_torrent_phy *cdns_phy) 3338 + { 3339 + struct clk_hw *hw = cdns_phy->clk_hw_data->hws[CDNS_TORRENT_REFCLK_DRIVER]; 3340 + struct cdns_torrent_refclk_driver *refclk_driver = to_cdns_torrent_refclk_driver(hw); 3341 + 3342 + return cdns_torrent_refclk_driver_set_parent(hw, refclk_driver->parent_index); 3343 + } 3344 + 3330 3345 static int cdns_torrent_phy_suspend_noirq(struct device *dev) 3331 3346 { 3332 3347 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(dev); 3333 3348 int i; 3349 + 3350 + cdns_torrent_refclk_driver_suspend(cdns_phy); 3334 3351 3335 3352 reset_control_assert(cdns_phy->phy_rst); 3336 3353 reset_control_assert(cdns_phy->apb_rst); ··· 3370 3351 struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(dev); 3371 3352 int node = cdns_phy->nsubnodes; 3372 3353 int ret, i; 3354 + 3355 + ret = cdns_torrent_refclk_driver_resume(cdns_phy); 3356 + if (ret) 3357 + return ret; 3373 3358 3374 3359 ret = cdns_torrent_clk(cdns_phy); 3375 3360 if (ret)