Skip to content

Commit 9d867d5

Browse files
Hien Dangr-kataok
authored andcommitted
dmaengine: rcar-dmac: Support S2RAM
It is not necessary to backup/restore module registers. They will be set when a new transaction starts. Signed-off-by: Hien Dang <[email protected]>
1 parent 79c4433 commit 9d867d5

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

drivers/dma/sh/rcar-dmac.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,16 +1638,26 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec,
16381638
#ifdef CONFIG_PM_SLEEP
16391639
static int rcar_dmac_sleep_suspend(struct device *dev)
16401640
{
1641-
/*
1642-
* TODO: Wait for the current transfer to complete and stop the device.
1643-
*/
1641+
struct rcar_dmac *dmac = dev_get_drvdata(dev);
1642+
int i;
1643+
1644+
for (i = 0; i < dmac->n_channels; ++i) {
1645+
if (!dmac->channels[i].iomem)
1646+
break;
1647+
1648+
spin_lock(&dmac->channels[i].lock);
1649+
rcar_dmac_chan_halt(&dmac->channels[i]);
1650+
spin_unlock(&dmac->channels[i].lock);
1651+
}
1652+
16441653
return 0;
16451654
}
16461655

16471656
static int rcar_dmac_sleep_resume(struct device *dev)
16481657
{
1649-
/* TODO: Resume transfers, if any. */
1650-
return 0;
1658+
struct rcar_dmac *dmac = dev_get_drvdata(dev);
1659+
1660+
return rcar_dmac_init(dmac);
16511661
}
16521662
#endif
16531663

0 commit comments

Comments
 (0)