mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] phy: ti: phy-j721e-wiz: restore mux selection during resume
@ 2025-12-16 14:26 Thomas Richard (TI.com)
  2025-12-23 17:45 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richard (TI.com) @ 2025-12-16 14:26 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I
  Cc: Thomas Petazzoni, Gregory CLEMENT, Udit Kumar, Prasanth Mantena,
	Abhash Kumar, linux-phy, linux-kernel, Thomas Richard (TI.com)

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>
---
 drivers/phy/ti/phy-j721e-wiz.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
index a8b440c6c46b..ba31b0a1f7f7 100644
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -393,6 +393,7 @@ struct wiz {
 	struct clk		*output_clks[WIZ_MAX_OUTPUT_CLOCKS];
 	struct clk_onecell_data	clk_data;
 	const struct wiz_data	*data;
+	int			mux_sel_status[WIZ_MUX_NUM_CLOCKS];
 };
 
 static int wiz_reset(struct wiz *wiz)
@@ -1654,11 +1655,25 @@ static void wiz_remove(struct platform_device *pdev)
 	pm_runtime_disable(dev);
 }
 
+static int wiz_suspend_noirq(struct device *dev)
+{
+	struct wiz *wiz = dev_get_drvdata(dev);
+	int i;
+
+	for (i = 0; i < WIZ_MUX_NUM_CLOCKS; i++)
+		regmap_field_read(wiz->mux_sel_field[i], &wiz->mux_sel_status[i]);
+
+	return 0;
+}
+
 static int wiz_resume_noirq(struct device *dev)
 {
 	struct device_node *node = dev->of_node;
 	struct wiz *wiz = dev_get_drvdata(dev);
-	int ret;
+	int ret, i;
+
+	for (i = 0; i < WIZ_MUX_NUM_CLOCKS; i++)
+		regmap_field_write(wiz->mux_sel_field[i], wiz->mux_sel_status[i]);
 
 	/* Enable supplemental Control override if available */
 	if (wiz->sup_legacy_clk_override)
@@ -1680,7 +1695,7 @@ static int wiz_resume_noirq(struct device *dev)
 	return ret;
 }
 
-static DEFINE_NOIRQ_DEV_PM_OPS(wiz_pm_ops, NULL, wiz_resume_noirq);
+static DEFINE_NOIRQ_DEV_PM_OPS(wiz_pm_ops, wiz_suspend_noirq, wiz_resume_noirq);
 
 static struct platform_driver wiz_driver = {
 	.probe		= wiz_probe,

---
base-commit: a22c168bc6e1295fd878c87684a84db9e79c574f
change-id: 20251110-phy-ti-phy-j721e-wiz-resume-restore-mux-sel-453f03abce4d

Best regards,
-- 
Thomas Richard (TI.com) <thomas.richard@bootlin.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] phy: ti: phy-j721e-wiz: restore mux selection during resume
  2025-12-16 14:26 [PATCH RESEND] phy: ti: phy-j721e-wiz: restore mux selection during resume Thomas Richard (TI.com)
@ 2025-12-23 17:45 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2025-12-23 17:45 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Thomas Richard (TI.com)
  Cc: Thomas Petazzoni, Gregory CLEMENT, Udit Kumar, Prasanth Mantena,
	Abhash Kumar, linux-phy, linux-kernel


On Tue, 16 Dec 2025 15:26:20 +0100, Thomas Richard (TI.com) wrote:
> While suspend and resume mux selection was getting lost. So save and
> restore these values in suspend and resume operations.
> 
> 

Applied, thanks!

[1/1] phy: ti: phy-j721e-wiz: restore mux selection during resume
      commit: 53f6240e88c9e8715e09fc19942f13450db4cb33

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-23 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16 14:26 [PATCH RESEND] phy: ti: phy-j721e-wiz: restore mux selection during resume Thomas Richard (TI.com)
2025-12-23 17:45 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®