Skip to content

Commit 83c411c

Browse files
committed
mtd: rawnand: timings: Add mode information to the timings structure
Convert the timings union into a structure containing the mode and the actual values. The values are still a union in prevision of the addition of the NVDDR modes. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-2-miquel.raynal@bootlin.com
1 parent 1617942 commit 83c411c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎drivers/mtd/nand/raw/nand_timings.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
1616
/* Mode 0 */
1717
{
1818
.type = NAND_SDR_IFACE,
19+
.timings.mode = 0,
1920
.timings.sdr = {
2021
.tCCS_min = 500000,
2122
.tR_max = 200000000,
@@ -58,6 +59,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
5859
/* Mode 1 */
5960
{
6061
.type = NAND_SDR_IFACE,
62+
.timings.mode = 1,
6163
.timings.sdr = {
6264
.tCCS_min = 500000,
6365
.tR_max = 200000000,
@@ -100,6 +102,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
100102
/* Mode 2 */
101103
{
102104
.type = NAND_SDR_IFACE,
105+
.timings.mode = 2,
103106
.timings.sdr = {
104107
.tCCS_min = 500000,
105108
.tR_max = 200000000,
@@ -142,6 +145,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
142145
/* Mode 3 */
143146
{
144147
.type = NAND_SDR_IFACE,
148+
.timings.mode = 3,
145149
.timings.sdr = {
146150
.tCCS_min = 500000,
147151
.tR_max = 200000000,
@@ -184,6 +188,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
184188
/* Mode 4 */
185189
{
186190
.type = NAND_SDR_IFACE,
191+
.timings.mode = 4,
187192
.timings.sdr = {
188193
.tCCS_min = 500000,
189194
.tR_max = 200000000,
@@ -226,6 +231,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
226231
/* Mode 5 */
227232
{
228233
.type = NAND_SDR_IFACE,
234+
.timings.mode = 5,
229235
.timings.sdr = {
230236
.tCCS_min = 500000,
231237
.tR_max = 200000000,

‎include/linux/mtd/rawnand.h‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,17 @@ enum nand_data_interface_type {
491491
/**
492492
* struct nand_data_interface - NAND interface timing
493493
* @type: type of the timing
494-
* @timings: The timing, type according to @type
494+
* @timings: The timing information
495+
* @timings.mode: Timing mode as defined in the specification
495496
* @timings.sdr: Use it when @type is %NAND_SDR_IFACE.
496497
*/
497498
struct nand_data_interface {
498499
enum nand_data_interface_type type;
499-
union {
500-
struct nand_sdr_timings sdr;
500+
struct nand_timings {
501+
unsigned int mode;
502+
union {
503+
struct nand_sdr_timings sdr;
504+
};
501505
} timings;
502506
};
503507

0 commit comments

Comments
 (0)