Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1dd3ca2 authored by Sascha Hauer's avatar Sascha Hauer Committed by Boris Brezillon
Browse files

mtd: nand: convert ONFI mode into data interface



struct nand_data_interface is the designated type to pass to
the NAND drivers to configure the timing. To simplify further
patches convert the onfi_sdr_timings array from type struct
nand_sdr_timings nand_data_interface.

Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent eee64b70
Loading
Loading
Loading
Loading
+224 −206
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@
#include <linux/export.h>
#include <linux/mtd/nand.h>

static const struct nand_sdr_timings onfi_sdr_timings[] = {
static const struct nand_data_interface onfi_sdr_timings[] = {
	/* Mode 0 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 20000,
			.tALS_min = 50000,
@@ -51,8 +53,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 50000,
			.tWW_min = 100000,
		},
	},
	/* Mode 1 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 10000,
			.tALS_min = 25000,
@@ -88,8 +93,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 25000,
			.tWW_min = 100000,
		},
	},
	/* Mode 2 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 10000,
			.tALS_min = 15000,
@@ -125,8 +133,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 17000,
			.tWW_min = 100000,
		},
	},
	/* Mode 3 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 5000,
			.tALS_min = 10000,
@@ -162,8 +173,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 15000,
			.tWW_min = 100000,
		},
	},
	/* Mode 4 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 5000,
			.tALS_min = 10000,
@@ -199,8 +213,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 12000,
			.tWW_min = 100000,
		},
	},
	/* Mode 5 */
	{
		.type = NAND_SDR_IFACE,
		.timings.sdr = {
			.tADL_min = 400000,
			.tALH_min = 5000,
			.tALS_min = 10000,
@@ -236,6 +253,7 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
			.tWP_min = 10000,
			.tWW_min = 100000,
		},
	},
};

/**
@@ -248,6 +266,6 @@ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode)
	if (mode < 0 || mode >= ARRAY_SIZE(onfi_sdr_timings))
		return ERR_PTR(-EINVAL);

	return &onfi_sdr_timings[mode];
	return &onfi_sdr_timings[mode].timings.sdr;
}
EXPORT_SYMBOL(onfi_async_timing_mode_to_sdr_timings);