Skip to content

Commit 2c72304

Browse files
Arun Parameswarandavem330
authored andcommitted
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: Arun Parameswaran <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 56aea57 commit 2c72304

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

drivers/net/phy/mdio-mux-bcm-iproc.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,32 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev)
286286
return 0;
287287
}
288288

289+
#ifdef CONFIG_PM_SLEEP
290+
static int mdio_mux_iproc_suspend(struct device *dev)
291+
{
292+
struct platform_device *pdev = to_platform_device(dev);
293+
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
294+
295+
clk_disable_unprepare(md->core_clk);
296+
297+
return 0;
298+
}
299+
300+
static int mdio_mux_iproc_resume(struct device *dev)
301+
{
302+
struct platform_device *pdev = to_platform_device(dev);
303+
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
304+
305+
clk_prepare_enable(md->core_clk);
306+
mdio_mux_iproc_config(md);
307+
308+
return 0;
309+
}
310+
#endif
311+
312+
static SIMPLE_DEV_PM_OPS(mdio_mux_iproc_pm_ops,
313+
mdio_mux_iproc_suspend, mdio_mux_iproc_resume);
314+
289315
static const struct of_device_id mdio_mux_iproc_match[] = {
290316
{
291317
.compatible = "brcm,mdio-mux-iproc",
@@ -298,6 +324,7 @@ static struct platform_driver mdiomux_iproc_driver = {
298324
.driver = {
299325
.name = "mdio-mux-iproc",
300326
.of_match_table = mdio_mux_iproc_match,
327+
.pm = &mdio_mux_iproc_pm_ops,
301328
},
302329
.probe = mdio_mux_iproc_probe,
303330
.remove = mdio_mux_iproc_remove,

0 commit comments

Comments
 (0)