Commit 53f6240e authored by Thomas Richard (TI.com)'s avatar Thomas Richard (TI.com) Committed by Vinod Koul
Browse files

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: default avatarThomas 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: default avatarVinod Koul <vkoul@kernel.org>
parent 5442f9fd
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -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,