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

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
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/mtd/nand.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 */ /* Mode 0 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 20000, .tALH_min = 20000,
.tALS_min = 50000, .tALS_min = 50000,
...@@ -51,8 +53,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -51,8 +53,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 50000, .tWP_min = 50000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
/* Mode 1 */ /* Mode 1 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 10000, .tALH_min = 10000,
.tALS_min = 25000, .tALS_min = 25000,
...@@ -88,8 +93,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -88,8 +93,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 25000, .tWP_min = 25000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
/* Mode 2 */ /* Mode 2 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 10000, .tALH_min = 10000,
.tALS_min = 15000, .tALS_min = 15000,
...@@ -125,8 +133,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -125,8 +133,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 17000, .tWP_min = 17000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
/* Mode 3 */ /* Mode 3 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 5000, .tALH_min = 5000,
.tALS_min = 10000, .tALS_min = 10000,
...@@ -162,8 +173,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -162,8 +173,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 15000, .tWP_min = 15000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
/* Mode 4 */ /* Mode 4 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 5000, .tALH_min = 5000,
.tALS_min = 10000, .tALS_min = 10000,
...@@ -199,8 +213,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -199,8 +213,11 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 12000, .tWP_min = 12000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
/* Mode 5 */ /* Mode 5 */
{ {
.type = NAND_SDR_IFACE,
.timings.sdr = {
.tADL_min = 400000, .tADL_min = 400000,
.tALH_min = 5000, .tALH_min = 5000,
.tALS_min = 10000, .tALS_min = 10000,
...@@ -236,6 +253,7 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = { ...@@ -236,6 +253,7 @@ static const struct nand_sdr_timings onfi_sdr_timings[] = {
.tWP_min = 10000, .tWP_min = 10000,
.tWW_min = 100000, .tWW_min = 100000,
}, },
},
}; };
/** /**
...@@ -248,6 +266,6 @@ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode) ...@@ -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)) if (mode < 0 || mode >= ARRAY_SIZE(onfi_sdr_timings))
return ERR_PTR(-EINVAL); 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); EXPORT_SYMBOL(onfi_async_timing_mode_to_sdr_timings);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment