Skip to content

Commit aee2ae1

Browse files
lategoodbyestorulf
authored andcommitted
mmc: bcm2835: add suspend/resume pm support
Add a minimalistic suspend/resume PM support. Signed-off-by: Stefan Wahren <[email protected]> Message-ID: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 634717a commit aee2ae1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/mmc/host/bcm2835.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,25 @@ static int bcm2835_add_host(struct bcm2835_host *host)
13431343
return 0;
13441344
}
13451345

1346+
static int bcm2835_suspend(struct device *dev)
1347+
{
1348+
struct bcm2835_host *host = dev_get_drvdata(dev);
1349+
1350+
clk_disable_unprepare(host->clk);
1351+
1352+
return 0;
1353+
}
1354+
1355+
static int bcm2835_resume(struct device *dev)
1356+
{
1357+
struct bcm2835_host *host = dev_get_drvdata(dev);
1358+
1359+
return clk_prepare_enable(host->clk);
1360+
}
1361+
1362+
static DEFINE_SIMPLE_DEV_PM_OPS(bcm2835_pm_ops, bcm2835_suspend,
1363+
bcm2835_resume);
1364+
13461365
static int bcm2835_probe(struct platform_device *pdev)
13471366
{
13481367
struct device *dev = &pdev->dev;
@@ -1471,6 +1490,7 @@ static struct platform_driver bcm2835_driver = {
14711490
.name = "sdhost-bcm2835",
14721491
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
14731492
.of_match_table = bcm2835_match,
1493+
.pm = pm_ptr(&bcm2835_pm_ops),
14741494
},
14751495
};
14761496
module_platform_driver(bcm2835_driver);

0 commit comments

Comments
 (0)