mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 5 May 2021 21:37:43 +0000 (23:37 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 26 May 2021 08:43:59 +0000 (10:43 +0200)
commite32df79f19c756f072bd517ece65df1efd496f95
tree8fabd205d8a89f0fe7516812cd6afe5b6ecc400b
parent09cdb237c3c8773921a7c265ce1cdd23818a3f14
mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode

Introduce a similar helper to onfi_find_closest_sdr_mode(), but for
NV-DDR timings. It just takes a timing structure as parameter and
returns the closest mode by comparing all minimum timings. This is
useful for rigid controllers on which tuning the timings is not
possible.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-16-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/internals.h
drivers/mtd/nand/raw/nand_timings.c