diff options
author | Ben Dooks <ben-linux@fluff.org> | 2007-11-19 18:28:07 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-11-28 06:57:45 -0500 |
commit | 03680b1e00d146df718c8a4eac34438566b70c85 (patch) | |
tree | 8d2c0b8c218e759ecd2d26fefc9913ab50bac50d | |
parent | 73061e4c2dcfba17c6a0137a1199d3e00d03b14c (diff) |
[MTD] [NAND] S3C2410 correctly set nFCE over resume
Ensure the nFCE line is de-asserted over suspend and
then re-initialised when the system resumes. This is
to ensure that the NAND is kept in lowest power mode
over suspend (power settings are only specified for
nFCE inactive) as well as fixing the Simtec Osiris
which relies on nFCE being inactive.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 20 |
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) | |||
820 | static int s3c24xx_nand_resume(struct platform_device *dev) | 832 | static 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 | } |