diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-03-16 09:36:00 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-06-01 10:09:29 +0200 |
commit | 6e532afaca8ed41107fa0a551d7b2db99a869540 (patch) | |
tree | 538afe663a1a4ab3ea4cd68d58c41252ef1f085d /drivers | |
parent | f9ce2eddf1769a2cf93e87332c55063537e69119 (diff) | |
download | linux-6e532afaca8ed41107fa0a551d7b2db99a869540.tar.gz linux-6e532afaca8ed41107fa0a551d7b2db99a869540.tar.bz2 linux-6e532afaca8ed41107fa0a551d7b2db99a869540.zip |
mtd: nand: atmel: Add PM ops
Provide a ->resume() hook to make sure the NAND timings are correctly
restored by resetting all chips connected to the controller.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/atmel/nand-controller.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c index ee32909f7943..846c555e470b 100644 --- a/drivers/mtd/nand/atmel/nand-controller.c +++ b/drivers/mtd/nand/atmel/nand-controller.c @@ -2506,6 +2506,24 @@ static int atmel_nand_controller_remove(struct platform_device *pdev) return nc->caps->ops->remove(nc); } +static int atmel_nand_controller_resume(struct device *dev) +{ + struct atmel_nand_controller *nc = dev_get_drvdata(dev); + struct atmel_nand *nand; + + list_for_each_entry(nand, &nc->chips, node) { + int i; + + for (i = 0; i < nand->numcs; i++) + nand_reset(&nand->base, i); + } + + return 0; +} + +static SIMPLE_DEV_PM_OPS(atmel_nand_controller_pm_ops, NULL, + atmel_nand_controller_resume); + static struct platform_driver atmel_nand_controller_driver = { .driver = { .name = "atmel-nand-controller", |