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: ti: phy-j721e-wiz: restore mux selection during resume

While suspend and resume mux selection was getting lost. So save and
restore these values in suspend and resume operations.

Signed-off-by: Thomas Richard (TI.com) <thomas.richard@bootlin.com>
Link: https://patch.msgid.link/20251216-phy-ti-phy-j721e-wiz-resume-restore-mux-sel-v1-1-771d564db966@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Thomas Richard (TI.com) and committed by
Vinod Koul
53f6240e 5442f9fd

+17 -2
+17 -2
drivers/phy/ti/phy-j721e-wiz.c
··· 393 393 struct clk *output_clks[WIZ_MAX_OUTPUT_CLOCKS]; 394 394 struct clk_onecell_data clk_data; 395 395 const struct wiz_data *data; 396 + int mux_sel_status[WIZ_MUX_NUM_CLOCKS]; 396 397 }; 397 398 398 399 static int wiz_reset(struct wiz *wiz) ··· 1655 1654 pm_runtime_disable(dev); 1656 1655 } 1657 1656 1657 + static int wiz_suspend_noirq(struct device *dev) 1658 + { 1659 + struct wiz *wiz = dev_get_drvdata(dev); 1660 + int i; 1661 + 1662 + for (i = 0; i < WIZ_MUX_NUM_CLOCKS; i++) 1663 + regmap_field_read(wiz->mux_sel_field[i], &wiz->mux_sel_status[i]); 1664 + 1665 + return 0; 1666 + } 1667 + 1658 1668 static int wiz_resume_noirq(struct device *dev) 1659 1669 { 1660 1670 struct device_node *node = dev->of_node; 1661 1671 struct wiz *wiz = dev_get_drvdata(dev); 1662 - int ret; 1672 + int ret, i; 1673 + 1674 + for (i = 0; i < WIZ_MUX_NUM_CLOCKS; i++) 1675 + regmap_field_write(wiz->mux_sel_field[i], wiz->mux_sel_status[i]); 1663 1676 1664 1677 /* Enable supplemental Control override if available */ 1665 1678 if (wiz->sup_legacy_clk_override) ··· 1695 1680 return ret; 1696 1681 } 1697 1682 1698 - static DEFINE_NOIRQ_DEV_PM_OPS(wiz_pm_ops, NULL, wiz_resume_noirq); 1683 + static DEFINE_NOIRQ_DEV_PM_OPS(wiz_pm_ops, wiz_suspend_noirq, wiz_resume_noirq); 1699 1684 1700 1685 static struct platform_driver wiz_driver = { 1701 1686 .probe = wiz_probe,