mtd: nand: fsmc: update of OF support
Add nand bank selection and timings to the device tree bindings. Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> [Added some documentation] Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:

committed by
David Woodhouse

parent
52778b2e9f
commit
64ddba4d8a
@@ -889,6 +889,24 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
|
||||
if (of_get_property(np, "nand-skip-bbtscan", NULL))
|
||||
pdata->options = NAND_SKIP_BBTSCAN;
|
||||
|
||||
pdata->nand_timings = devm_kzalloc(&pdev->dev,
|
||||
sizeof(*pdata->nand_timings), GFP_KERNEL);
|
||||
if (!pdata->nand_timings) {
|
||||
dev_err(&pdev->dev, "no memory for nand_timing\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
of_property_read_u8_array(np, "timings", (u8 *)pdata->nand_timings,
|
||||
sizeof(*pdata->nand_timings));
|
||||
|
||||
/* Set default NAND bank to 0 */
|
||||
pdata->bank = 0;
|
||||
if (!of_property_read_u32(np, "bank", &val)) {
|
||||
if (val > 3) {
|
||||
dev_err(&pdev->dev, "invalid bank %u\n", val);
|
||||
return -EINVAL;
|
||||
}
|
||||
pdata->bank = val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
Reference in New Issue
Block a user