[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251110-phy-ti-phy-j721e-wiz-resume-restore-mux-sel-v1-1-b1cbde0b8367@bootlin.com>
Date: Mon, 10 Nov 2025 15:04:33 +0100
From: "Thomas Richard (TI.com)" <thomas.richard@...tlin.com>
To: Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Gregory CLEMENT <gregory.clement@...tlin.com>, Udit Kumar <u-kumar1@...com>,
Prasanth Mantena <p-mantena@...com>, Abhash Kumar <a-kumar2@...com>,
linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org,
"Thomas Richard (TI.com)" <thomas.richard@...tlin.com>
Subject: [PATCH] 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@...tlin.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@...tlin.com>
Powered by blists - more mailing lists