Commit 2c723044 authored by Arun Parameswaran's avatar Arun Parameswaran Committed by David S. Miller

net: phy: Add pm support to Broadcom iProc mdio mux driver

Add support for suspend and resume to the Broadcom iProc mdio
mux driver.
Signed-off-by: default avatarArun Parameswaran <arun.parameswaran@broadcom.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56aea577
...@@ -286,6 +286,32 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev) ...@@ -286,6 +286,32 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int mdio_mux_iproc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
clk_disable_unprepare(md->core_clk);
return 0;
}
static int mdio_mux_iproc_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
clk_prepare_enable(md->core_clk);
mdio_mux_iproc_config(md);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(mdio_mux_iproc_pm_ops,
mdio_mux_iproc_suspend, mdio_mux_iproc_resume);
static const struct of_device_id mdio_mux_iproc_match[] = { static const struct of_device_id mdio_mux_iproc_match[] = {
{ {
.compatible = "brcm,mdio-mux-iproc", .compatible = "brcm,mdio-mux-iproc",
...@@ -298,6 +324,7 @@ static struct platform_driver mdiomux_iproc_driver = { ...@@ -298,6 +324,7 @@ static struct platform_driver mdiomux_iproc_driver = {
.driver = { .driver = {
.name = "mdio-mux-iproc", .name = "mdio-mux-iproc",
.of_match_table = mdio_mux_iproc_match, .of_match_table = mdio_mux_iproc_match,
.pm = &mdio_mux_iproc_pm_ops,
}, },
.probe = mdio_mux_iproc_probe, .probe = mdio_mux_iproc_probe,
.remove = mdio_mux_iproc_remove, .remove = mdio_mux_iproc_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