Skip to content

Commit

Permalink
[MTD] [NAND] S3C2410 Fix previous nFCE suspend save patch
Browse files Browse the repository at this point in the history
Commit 03680b1 incorrectly
was assuming S3C2410_NFCONF was being used to select the
NAND chip. Fix this error by ising the sel_reg.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Ben Dooks authored and David Woodhouse committed Apr 22, 2008
1 parent 67e5a28 commit 0916083
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/mtd/nand/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ struct s3c2410_nand_info {
void __iomem *sel_reg;
int sel_bit;
int mtd_count;

unsigned long save_nfconf;
unsigned long save_sel;

enum s3c_cpu_type cpu_type;
};
Expand Down Expand Up @@ -810,15 +809,14 @@ static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
struct s3c2410_nand_info *info = platform_get_drvdata(dev);

if (info) {
info->save_nfconf = readl(info->regs + S3C2410_NFCONF);
info->save_sel = readl(info->sel_reg);

/* For the moment, we must ensure nFCE is high during
* the time we are suspended. This really should be
* handled by suspending the MTDs we are using, but
* that is currently not the case. */

writel(info->save_nfconf | info->sel_bit,
info->regs + S3C2410_NFCONF);
writel(info->save_sel | info->sel_bit, info->sel_reg);

if (!allow_clk_stop(info))
clk_disable(info->clk);
Expand All @@ -830,18 +828,18 @@ static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
static int s3c24xx_nand_resume(struct platform_device *dev)
{
struct s3c2410_nand_info *info = platform_get_drvdata(dev);
unsigned long nfconf;
unsigned long sel;

if (info) {
clk_enable(info->clk);
s3c2410_nand_inithw(info, dev);

/* Restore the state of the nFCE line. */

nfconf = readl(info->regs + S3C2410_NFCONF);
nfconf &= ~info->sel_bit;
nfconf |= info->save_nfconf & info->sel_bit;
writel(nfconf, info->regs + S3C2410_NFCONF);
sel = readl(info->sel_reg);
sel &= ~info->sel_bit;
sel |= info->save_sel & info->sel_bit;
writel(sel, info->sel_reg);

if (allow_clk_stop(info))
clk_disable(info->clk);
Expand Down

0 comments on commit 0916083

Please sign in to comment.