Re: [PATCH 6/7] net: phy: Add pm support to Broadcom iProc mdio mux driver
From: Andrew Lunn
Date: Thu Jul 26 2018 - 15:16:47 EST
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