Commit 67c46316 authored by Arun Parameswaran's avatar Arun Parameswaran Committed by Kelsey Skunberg

net: phy: restore mdio regs in the iproc mdio driver

BugLink: https://bugs.launchpad.net/bugs/1868628

commit 6f08e98d upstream.

The mii management register in iproc mdio block
does not have a retention register so it is lost on suspend.
Save and restore value of register while resuming from suspend.

Fixes: bb1a6197 ("net: phy: Initialize mdio clock at probe function")
Signed-off-by: default avatarArun Parameswaran <arun.parameswaran@broadcom.com>
Signed-off-by: default avatarScott Branden <scott.branden@broadcom.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent e935cc6f
......@@ -188,6 +188,23 @@ static int iproc_mdio_remove(struct platform_device *pdev)
return 0;
}
#ifdef CONFIG_PM_SLEEP
int iproc_mdio_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct iproc_mdio_priv *priv = platform_get_drvdata(pdev);
/* restore the mii clock configuration */
iproc_mdio_config_clk(priv->base);
return 0;
}
static const struct dev_pm_ops iproc_mdio_pm_ops = {
.resume = iproc_mdio_resume
};
#endif /* CONFIG_PM_SLEEP */
static const struct of_device_id iproc_mdio_of_match[] = {
{ .compatible = "brcm,iproc-mdio", },
{ /* sentinel */ },
......@@ -198,6 +215,9 @@ static struct platform_driver iproc_mdio_driver = {
.driver = {
.name = "iproc-mdio",
.of_match_table = iproc_mdio_of_match,
#ifdef CONFIG_PM_SLEEP
.pm = &iproc_mdio_pm_ops,
#endif
},
.probe = iproc_mdio_probe,
.remove = iproc_mdio_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment