summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/atmel
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2017-03-16 11:36:00 +0300
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-06-01 11:09:29 +0300
commit6e532afaca8ed41107fa0a551d7b2db99a869540 (patch)
tree538afe663a1a4ab3ea4cd68d58c41252ef1f085d /drivers/mtd/nand/atmel
parentf9ce2eddf1769a2cf93e87332c55063537e69119 (diff)
downloadlinux-6e532afaca8ed41107fa0a551d7b2db99a869540.tar.xz
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/mtd/nand/atmel')
-rw-r--r--drivers/mtd/nand/atmel/nand-controller.c18
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",