Thread (25 messages) 25 messages, 3 authors, 2018-07-26

Re: [PATCH 6/7] net: phy: Add pm support to Broadcom iProc mdio mux driver

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-07-26 19:16:48
Also in: linux-arm-kernel, linux-devicetree, lkml

On Thu, Jul 26, 2018 at 11:36:23AM -0700, Arun Parameswaran wrote:
Add support for suspend and resume to the Broadcom iProc mdio
mux driver.
+#ifdef CONFIG_PM_SLEEP
+static int mdio_mux_iproc_suspend(struct device *dev)
+{
+	int i;
+	struct iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+
+	for (i = 0; i < MDIO_NUM_OF_REGS_TO_RESTORE; i++)
+		md->restore_regs[i] = readl(md->base +
+					    restore_reg_offsets[i]);
+
+	return 0;
+}
+
+static int mdio_mux_iproc_resume(struct device *dev)
+{
+	int i;
+	struct iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+
+	for (i = 0; i < MDIO_NUM_OF_REGS_TO_RESTORE; i++)
+		writel(md->restore_regs[i],
+		       md->base + restore_reg_offsets[i]);
+
+	return 0;
+}
Hi Arun

Would it not be simpler to just call mdio_mux_iproc_config_clk() on
resume?

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help