Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602083

[PATCH v2 3/3] mtd: nand: atmel: Add PM ops

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] mtd: nand: atmel: Add PM ops
Date 2017-03-16 09:40 +0100
Message-ID <tlz6X-42c-45@gated-at.bofh.it> (permalink)
References <tlz6V-42c-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 f974c4e92392..b90da79317f0 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -2507,6 +2507,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",
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] mtd: nand: atmel: Add ->setup_data_interface() + PM ops Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-03-16 09:40 +0100
  [PATCH v2 1/3] mtd: nand: Pass the CS line to ->setup_data_interface() Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-03-16 09:40 +0100
  [PATCH v2 3/3] mtd: nand: atmel: Add PM ops Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-03-16 09:40 +0100
  [PATCH v2 2/3] mtd: nand: atmel: Add ->setup_data_interface() hooks Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-03-16 09:40 +0100

csiph-web