mtd: rawnand: timings: Add a helper to find the closest ONFI mode
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 29 May 2020 11:13:09 +0000 (13:13 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 26 Jun 2020 06:35:06 +0000 (08:35 +0200)
commit98d6979aa898239ec2faa10467c338a808e1287e
treec7e638d98c3d96d02e02e6cba79157f597f5d48a
parentfcaab3b26d2534ec9f227810975ad220823ac578
mtd: rawnand: timings: Add a helper to find the closest ONFI mode

Vendors are allowed to provide their own set of timings. In this case,
we provide a way to derive the "closest" timing mode so that, if the
NAND controller does not support tweaking these parameters, it will be
able to configure itself anyway.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-16-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/internals.h
drivers/mtd/nand/raw/nand_timings.c