提交 b2acc92e 编写于 作者: S Shiraz Hashim 提交者: David Woodhouse

mtd: fsmc: use ALE and CLE offsets from platform data

ALE and CLE offsets can be different on different devices. Let devices
pass these offsets to the fsmc driver through platform data.
Signed-off-by: NShiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 e29ee57b
......@@ -729,27 +729,28 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
goto err_probe1;
}
host->resaddr = request_mem_region(res->start + PLAT_NAND_ALE,
host->resaddr = request_mem_region(res->start + pdata->ale_off,
resource_size(res), pdev->name);
if (!host->resaddr) {
ret = -EIO;
goto err_probe1;
}
host->addr_va = ioremap(res->start + PLAT_NAND_ALE, resource_size(res));
host->addr_va = ioremap(res->start + pdata->ale_off,
resource_size(res));
if (!host->addr_va) {
ret = -EIO;
goto err_probe1;
}
host->rescmd = request_mem_region(res->start + PLAT_NAND_CLE,
host->rescmd = request_mem_region(res->start + pdata->cle_off,
resource_size(res), pdev->name);
if (!host->rescmd) {
ret = -EIO;
goto err_probe1;
}
host->cmd_va = ioremap(res->start + PLAT_NAND_CLE, resource_size(res));
host->cmd_va = ioremap(res->start + pdata->cle_off, resource_size(res));
if (!host->cmd_va) {
ret = -EIO;
goto err_probe1;
......
......@@ -151,6 +151,11 @@ struct fsmc_nand_platform_data {
unsigned int options;
unsigned int width;
unsigned int bank;
/* CLE, ALE offsets */
unsigned long cle_off;
unsigned long ale_off;
void (*select_bank)(uint32_t bank, uint32_t busw);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册