Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274905
b: refs/heads/master
c: 051fc41
h: refs/heads/master
i:
  274903: 6ce590a
v: v3
  • Loading branch information
Lei Wen authored and Artem Bityutskiy committed Sep 11, 2011
1 parent c9d307c commit e00bea3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52a474de0a830bdf4305ef19c3321064ce5da438
refs/heads/master: 051fc41c2e578e10950bf34dc84878e489e0679f
15 changes: 14 additions & 1 deletion trunk/drivers/mtd/nand/pxa3xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,23 +1158,36 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
static int pxa3xx_nand_suspend(struct platform_device *pdev, pm_message_t state)
{
struct pxa3xx_nand_info *info = platform_get_drvdata(pdev);
struct mtd_info *mtd = info->mtd;

if (info->state) {
dev_err(&pdev->dev, "driver busy, state = %d\n", info->state);
return -EAGAIN;
}

mtd->suspend(mtd);
return 0;
}

static int pxa3xx_nand_resume(struct platform_device *pdev)
{
struct pxa3xx_nand_info *info = platform_get_drvdata(pdev);
struct mtd_info *mtd = info->mtd;

/* We don't want to handle interrupt without calling mtd routine */
disable_int(info, NDCR_INT_MASK);

nand_writel(info, NDTR0CS0, info->ndtr0cs0);
nand_writel(info, NDTR1CS0, info->ndtr1cs0);
clk_enable(info->clk);

/*
* As the spec says, the NDSR would be updated to 0x1800 when
* doing the nand_clk disable/enable.
* To prevent it damaging state machine of the driver, clear
* all status before resume
*/
nand_writel(info, NDSR, NDSR_MASK);
mtd->resume(mtd);
return 0;
}
#else
Expand Down

0 comments on commit e00bea3

Please sign in to comment.