mtd: nand: atmel: Add PM ops
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Jul 13 10:59:14 PDT 2017
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6e532afaca8ed41107fa0a551d7b2db99a869540
Commit: 6e532afaca8ed41107fa0a551d7b2db99a869540
Parent: f9ce2eddf1769a2cf93e87332c55063537e69119
Author: Boris Brezillon <boris.brezillon at free-electrons.com>
AuthorDate: Thu Mar 16 09:36:00 2017 +0100
Committer: Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Thu Jun 1 10:09:29 2017 +0200
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 at free-electrons.com>
---
drivers/mtd/nand/atmel/nand-controller.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index ee32909..846c555 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",
More information about the linux-mtd-cvs
mailing list