diff options
Diffstat (limited to 'include/linux/mtd/onenand.h')
-rw-r--r-- | include/linux/mtd/onenand.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 4e49f3350678..5509eb06b326 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Samsung Electronics | 4 | * Copyright © 2005-2009 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -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 */ |
26 | extern void onenand_release(struct mtd_info *mtd); | 27 | extern void onenand_release(struct mtd_info *mtd); |
27 | 28 | ||
28 | /* | ||
29 | * onenand_state_t - chip states | ||
30 | * Enumeration for OneNAND flash chip state | ||
31 | */ | ||
32 | typedef 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 | ||
@@ -152,6 +137,8 @@ struct onenand_chip { | |||
152 | /* | 137 | /* |
153 | * Helper macros | 138 | * Helper macros |
154 | */ | 139 | */ |
140 | #define ONENAND_PAGES_PER_BLOCK (1<<6) | ||
141 | |||
155 | #define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) | 142 | #define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) |
156 | #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) | 143 | #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) |
157 | #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) | 144 | #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) |