aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@unipv.it>2009-09-20 17:28:14 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-09-24 15:55:07 -0400
commit30631cb82d5c6c662d5ec682beaa834c1f9f0987 (patch)
tree9c329ebf759cdbc4be4cc488ae448bbb6ef73c11 /include
parentc62d81bcfe82526cc3da10cf4fc63faad368bc60 (diff)
mtd: unify status enum from three headers
nand.h, onenand.h and flashchip.h defined enumeration types for chip status using the same symbolic names. This prevented a board file to include more than one of them. In particular, no nand and onenand platform devices could live in the same file. This patch augments flashchip.h with a few status values in order to cover all cases, so nand.h and onenand.h can use flstate_t without declaring their own status enum. Signed-off-by: Alessandro Rubini <rubini@unipv.it> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/flashchip.h7
-rw-r--r--include/linux/mtd/nand.h17
-rw-r--r--include/linux/mtd/onenand.h19
3 files changed, 11 insertions, 32 deletions
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index d4f38c5fd44e..f350a4879f75 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -38,6 +38,13 @@ typedef enum {
38 FL_XIP_WHILE_ERASING, 38 FL_XIP_WHILE_ERASING,
39 FL_XIP_WHILE_WRITING, 39 FL_XIP_WHILE_WRITING,
40 FL_SHUTDOWN, 40 FL_SHUTDOWN,
41 /* These 2 come from nand_state_t, which has been unified here */
42 FL_READING,
43 FL_CACHEDPRG,
44 /* These 2 come from onenand_state_t, which has been unified here */
45 FL_RESETING,
46 FL_OTPING,
47
41 FL_UNKNOWN 48 FL_UNKNOWN
42} flstate_t; 49} flstate_t;
43 50
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index d87ada538d17..2476078a032f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -21,6 +21,7 @@
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/flashchip.h>
24#include <linux/mtd/bbm.h> 25#include <linux/mtd/bbm.h>
25 26
26struct mtd_info; 27struct mtd_info;
@@ -203,20 +204,6 @@ typedef enum {
203#define NAND_CI_CHIPNR_MSK 0x03 204#define NAND_CI_CHIPNR_MSK 0x03
204#define NAND_CI_CELLTYPE_MSK 0x0C 205#define NAND_CI_CELLTYPE_MSK 0x0C
205 206
206/*
207 * nand_state_t - chip states
208 * Enumeration for NAND flash chip state
209 */
210typedef enum {
211 FL_READY,
212 FL_READING,
213 FL_WRITING,
214 FL_ERASING,
215 FL_SYNCING,
216 FL_CACHEDPRG,
217 FL_PM_SUSPENDED,
218} nand_state_t;
219
220/* Keep gcc happy */ 207/* Keep gcc happy */
221struct nand_chip; 208struct nand_chip;
222 209
@@ -403,7 +390,7 @@ struct nand_chip {
403 uint8_t cellinfo; 390 uint8_t cellinfo;
404 int badblockpos; 391 int badblockpos;
405 392
406 nand_state_t state; 393 flstate_t state;
407 394
408 uint8_t *oob_poi; 395 uint8_t *oob_poi;
409 struct nand_hw_control *controller; 396 struct nand_hw_control *controller;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 4e49f3350678..f57e29e17bb0 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -14,6 +14,7 @@
14 14
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/completion.h> 16#include <linux/completion.h>
17#include <linux/mtd/flashchip.h>
17#include <linux/mtd/onenand_regs.h> 18#include <linux/mtd/onenand_regs.h>
18#include <linux/mtd/bbm.h> 19#include <linux/mtd/bbm.h>
19 20
@@ -25,22 +26,6 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips);
25/* Free resources held by the OneNAND device */ 26/* Free resources held by the OneNAND device */
26extern void onenand_release(struct mtd_info *mtd); 27extern void onenand_release(struct mtd_info *mtd);
27 28
28/*
29 * onenand_state_t - chip states
30 * Enumeration for OneNAND flash chip state
31 */
32typedef enum {
33 FL_READY,
34 FL_READING,
35 FL_WRITING,
36 FL_ERASING,
37 FL_SYNCING,
38 FL_LOCKING,
39 FL_RESETING,
40 FL_OTPING,
41 FL_PM_SUSPENDED,
42} onenand_state_t;
43
44/** 29/**
45 * struct onenand_bufferram - OneNAND BufferRAM Data 30 * struct onenand_bufferram - OneNAND BufferRAM Data
46 * @blockpage: block & page address in BufferRAM 31 * @blockpage: block & page address in BufferRAM
@@ -137,7 +122,7 @@ struct onenand_chip {
137 122
138 spinlock_t chip_lock; 123 spinlock_t chip_lock;
139 wait_queue_head_t wq; 124 wait_queue_head_t wq;
140 onenand_state_t state; 125 flstate_t state;
141 unsigned char *page_buf; 126 unsigned char *page_buf;
142 unsigned char *oob_buf; 127 unsigned char *oob_buf;
143 128