新一版本的nand flash加入了电源管理功能,
我们也可以在需要的时候其他驱动模块增加如下函数的实现.
/* linux/drivers/mtd/nand/s3c2410.c
*
* Copyright (c) 2004,2005 Simtec Electronics
*
* Ben Dooks
*
* Samsung S3C2410/S3C240 NAND driver
*
* Changelog:
* 21-Sep-2004 BJD Initial version
* 23-Sep-2004 BJD Mulitple device support
* 28-Sep-2004 BJD Fixed ECC placement for Hardware mode
* 12-Oct-2004 BJD Fixed errors in use of platform data
* 18-Feb-2005 BJD Fix sparse errors
* 14-Mar-2005 BJD Applied tglx's code reduction patch
* 02-May-2005 BJD Fixed s3c2440 support
* 02-May-2005 BJD Reduced hwcontrol decode
* 20-Jun-2005 BJD Updated s3c2440 support, fixed timing bug
* 08-Jul-2005 BJD Fix OOPS when no platform data supplied
* 20-Oct-2005 BJD Fix timing calculation bug
* 14-Jan-2006 BJD Allow clock to be stopped when idle
*
* $Id: s3c2410.c,v 1.23 2006/04/01 18:06:29 bjd Exp $
/* PM Support */
#ifdef CONFIG_PM
static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
{
struct s3c2410_nand_info *info = platform_get_drvdata(dev);
if (info) {
if (!allow_clk_stop(info))
clk_disable(info->clk);
}
return 0;
}
static int s3c24xx_nand_resume(struct platform_device *dev)
{
struct s3c2410_nand_info *info = platform_get_drvdata(dev);
if (info) {
clk_enable(info->clk);
s3c2410_nand_inithw(info, dev);
if (allow_clk_stop(info))
clk_disable(info->clk);
}
return 0;
}
#else
#define s3c24xx_nand_suspend NULL
#define s3c24xx_nand_resume NULL
#endif
static struct platform_driver s3c2440_nand_driver = {
.probe = s3c2440_nand_probe,
.remove = s3c2410_nand_remove,
.suspend = s3c24xx_nand_suspend,
.resume = s3c24xx_nand_resume,
.driver = {
.name = "s3c2440-nand",
.owner = THIS_MODULE,
},
};
阅读(929) | 评论(0) | 转发(0) |