Skip to content

Commit b2acc92

Browse files
shiraz-zzDavid Woodhouse
authored andcommitted
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: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent e29ee57 commit b2acc92

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎drivers/mtd/nand/fsmc_nand.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,27 +729,28 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
729729
goto err_probe1;
730730
}
731731

732-
host->resaddr = request_mem_region(res->start + PLAT_NAND_ALE,
732+
host->resaddr = request_mem_region(res->start + pdata->ale_off,
733733
resource_size(res), pdev->name);
734734
if (!host->resaddr) {
735735
ret = -EIO;
736736
goto err_probe1;
737737
}
738738

739-
host->addr_va = ioremap(res->start + PLAT_NAND_ALE, resource_size(res));
739+
host->addr_va = ioremap(res->start + pdata->ale_off,
740+
resource_size(res));
740741
if (!host->addr_va) {
741742
ret = -EIO;
742743
goto err_probe1;
743744
}
744745

745-
host->rescmd = request_mem_region(res->start + PLAT_NAND_CLE,
746+
host->rescmd = request_mem_region(res->start + pdata->cle_off,
746747
resource_size(res), pdev->name);
747748
if (!host->rescmd) {
748749
ret = -EIO;
749750
goto err_probe1;
750751
}
751752

752-
host->cmd_va = ioremap(res->start + PLAT_NAND_CLE, resource_size(res));
753+
host->cmd_va = ioremap(res->start + pdata->cle_off, resource_size(res));
753754
if (!host->cmd_va) {
754755
ret = -EIO;
755756
goto err_probe1;

‎include/linux/mtd/fsmc.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ struct fsmc_nand_platform_data {
151151
unsigned int options;
152152
unsigned int width;
153153
unsigned int bank;
154+
155+
/* CLE, ALE offsets */
156+
unsigned long cle_off;
157+
unsigned long ale_off;
158+
154159
void (*select_bank)(uint32_t bank, uint32_t busw);
155160
};
156161

0 commit comments

Comments
 (0)