From d55d31a6b8f65bb13e1912043a66295cc928967c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ezequiel=20Garc=C3=ADa?= Date: Wed, 4 Nov 2015 13:13:46 -0300 Subject: [PATCH] mtd: pxa3xx_nand: Gate/ungate the NAND clock in suspend/resume paths The NAND clock can be disabled on suspend and enabled on resume. Signed-off-by: Ezequiel Garcia Acked-by: Robert Jarzmik Signed-off-by: Brian Norris --- drivers/mtd/nand/pxa3xx_nand.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 2f337eaef155..2bb9732a42f8 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1936,12 +1936,18 @@ static int pxa3xx_nand_suspend(struct device *dev) return -EAGAIN; } + clk_disable(info->clk); return 0; } static int pxa3xx_nand_resume(struct device *dev) { struct pxa3xx_nand_info *info = dev_get_drvdata(dev); + int ret; + + ret = clk_enable(info->clk); + if (ret < 0) + return ret; /* We don't want to handle interrupt without calling mtd routine */ disable_int(info, NDCR_INT_MASK); -- 2.20.1