aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/s3c2410.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 66f76e9618dd..512acfc89012 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -120,6 +120,8 @@ struct s3c2410_nand_info {
120 int sel_bit; 120 int sel_bit;
121 int mtd_count; 121 int mtd_count;
122 122
123 unsigned long save_nfconf;
124
123 enum s3c_cpu_type cpu_type; 125 enum s3c_cpu_type cpu_type;
124}; 126};
125 127
@@ -810,6 +812,16 @@ static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
810 struct s3c2410_nand_info *info = platform_get_drvdata(dev); 812 struct s3c2410_nand_info *info = platform_get_drvdata(dev);
811 813
812 if (info) { 814 if (info) {
815 info->save_nfconf = readl(info->regs + S3C2410_NFCONF);
816
817 /* For the moment, we must ensure nFCE is high during
818 * the time we are suspended. This really should be
819 * handled by suspending the MTDs we are using, but
820 * that is currently not the case. */
821
822 writel(info->save_nfconf | info->sel_bit,
823 info->regs + S3C2410_NFCONF);
824
813 if (!allow_clk_stop(info)) 825 if (!allow_clk_stop(info))
814 clk_disable(info->clk); 826 clk_disable(info->clk);
815 } 827 }
@@ -820,11 +832,19 @@ static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
820static int s3c24xx_nand_resume(struct platform_device *dev) 832static int s3c24xx_nand_resume(struct platform_device *dev)
821{ 833{
822 struct s3c2410_nand_info *info = platform_get_drvdata(dev); 834 struct s3c2410_nand_info *info = platform_get_drvdata(dev);
835 unsigned long nfconf;
823 836
824 if (info) { 837 if (info) {
825 clk_enable(info->clk); 838 clk_enable(info->clk);
826 s3c2410_nand_inithw(info, dev); 839 s3c2410_nand_inithw(info, dev);
827 840
841 /* Restore the state of the nFCE line. */
842
843 nfconf = readl(info->regs + S3C2410_NFCONF);
844 nfconf &= ~info->sel_bit;
845 nfconf |= info->save_nfconf & info->sel_bit;
846 writel(nfconf, info->regs + S3C2410_NFCONF);
847
828 if (allow_clk_stop(info)) 848 if (allow_clk_stop(info))
829 clk_disable(info->clk); 849 clk_disable(info->clk);
830 } 850 }