mtd: pxa3xx_nand: Gate/ungate the NAND clock in suspend/resume paths
authorEzequiel García <ezequiel@vanguardiasur.com.ar>
Wed, 4 Nov 2015 16:13:46 +0000 (13:13 -0300)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 16 Nov 2015 23:03:32 +0000 (15:03 -0800)
The NAND clock can be disabled on suspend and enabled on resume.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/pxa3xx_nand.c

index 2f337eaef155cb1bf100904135977b9f67472233..2bb9732a42f8fe6e8341504ac880932f561f9967 100644 (file)
@@ -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);