mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mtd: nand: pxa3xx: Use ECC strength and step size devicetree binding
This commit adds support for the user to specify the ECC strength and step size through the devicetree. We keep the previous behavior, when there is no DT parameter provided. Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Brian Norris <[email protected]>
This commit is contained in:
parent
eee0166d8e
commit
5b3e507820
2 changed files with 18 additions and 2 deletions
|
|
@ -1519,8 +1519,13 @@ KEEP_CONFIG:
|
|||
}
|
||||
}
|
||||
|
||||
ecc_strength = chip->ecc_strength_ds;
|
||||
ecc_step = chip->ecc_step_ds;
|
||||
if (pdata->ecc_strength && pdata->ecc_step_size) {
|
||||
ecc_strength = pdata->ecc_strength;
|
||||
ecc_step = pdata->ecc_step_size;
|
||||
} else {
|
||||
ecc_strength = chip->ecc_strength_ds;
|
||||
ecc_step = chip->ecc_step_ds;
|
||||
}
|
||||
|
||||
/* Set default ECC strength requirements on non-ONFI devices */
|
||||
if (ecc_strength < 1 && ecc_step < 1) {
|
||||
|
|
@ -1729,6 +1734,14 @@ static int pxa3xx_nand_probe_dt(struct platform_device *pdev)
|
|||
of_property_read_u32(np, "num-cs", &pdata->num_cs);
|
||||
pdata->flash_bbt = of_get_nand_on_flash_bbt(np);
|
||||
|
||||
pdata->ecc_strength = of_get_nand_ecc_strength(np);
|
||||
if (pdata->ecc_strength < 0)
|
||||
pdata->ecc_strength = 0;
|
||||
|
||||
pdata->ecc_step_size = of_get_nand_ecc_step_size(np);
|
||||
if (pdata->ecc_step_size < 0)
|
||||
pdata->ecc_step_size = 0;
|
||||
|
||||
pdev->dev.platform_data = pdata;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue