Commit f63acb75 authored by Shiraz Hashim's avatar Shiraz Hashim Committed by David Woodhouse

mtd: fsmc_nand: add pm callbacks to support hibernation

Signed-off-by: default avatarShiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 467e6e7b
...@@ -382,7 +382,7 @@ static void fsmc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) ...@@ -382,7 +382,7 @@ static void fsmc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
* This routine initializes timing parameters related to NAND memory access in * This routine initializes timing parameters related to NAND memory access in
* FSMC registers * FSMC registers
*/ */
static void __init fsmc_nand_setup(struct fsmc_regs *regs, uint32_t bank, static void fsmc_nand_setup(struct fsmc_regs *regs, uint32_t bank,
uint32_t busw) uint32_t busw)
{ {
uint32_t value = FSMC_DEVTYPE_NAND | FSMC_ENABLE | FSMC_WAITON; uint32_t value = FSMC_DEVTYPE_NAND | FSMC_ENABLE | FSMC_WAITON;
...@@ -976,15 +976,15 @@ static int fsmc_nand_suspend(struct device *dev) ...@@ -976,15 +976,15 @@ static int fsmc_nand_suspend(struct device *dev)
static int fsmc_nand_resume(struct device *dev) static int fsmc_nand_resume(struct device *dev)
{ {
struct fsmc_nand_data *host = dev_get_drvdata(dev); struct fsmc_nand_data *host = dev_get_drvdata(dev);
if (host) if (host) {
clk_enable(host->clk); clk_enable(host->clk);
fsmc_nand_setup(host->regs_va, host->bank,
host->nand.options & NAND_BUSWIDTH_16);
}
return 0; return 0;
} }
static const struct dev_pm_ops fsmc_nand_pm_ops = { static SIMPLE_DEV_PM_OPS(fsmc_nand_pm_ops, fsmc_nand_suspend, fsmc_nand_resume);
.suspend = fsmc_nand_suspend,
.resume = fsmc_nand_resume,
};
#endif #endif
static struct platform_driver fsmc_nand_driver = { static struct platform_driver fsmc_nand_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment