diff options
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r-- | include/linux/mtd/mtd.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 0f32a9b6ff55..8485e42a9b09 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -1,7 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. | 2 | * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
3 | * | 17 | * |
4 | * Released under GPL | ||
5 | */ | 18 | */ |
6 | 19 | ||
7 | #ifndef __MTD_MTD_H__ | 20 | #ifndef __MTD_MTD_H__ |
@@ -13,14 +26,12 @@ | |||
13 | #include <linux/notifier.h> | 26 | #include <linux/notifier.h> |
14 | #include <linux/device.h> | 27 | #include <linux/device.h> |
15 | 28 | ||
16 | #include <linux/mtd/compatmac.h> | ||
17 | #include <mtd/mtd-abi.h> | 29 | #include <mtd/mtd-abi.h> |
18 | 30 | ||
19 | #include <asm/div64.h> | 31 | #include <asm/div64.h> |
20 | 32 | ||
21 | #define MTD_CHAR_MAJOR 90 | 33 | #define MTD_CHAR_MAJOR 90 |
22 | #define MTD_BLOCK_MAJOR 31 | 34 | #define MTD_BLOCK_MAJOR 31 |
23 | #define MAX_MTD_DEVICES 32 | ||
24 | 35 | ||
25 | #define MTD_ERASE_PENDING 0x01 | 36 | #define MTD_ERASE_PENDING 0x01 |
26 | #define MTD_ERASING 0x02 | 37 | #define MTD_ERASING 0x02 |
@@ -61,9 +72,7 @@ struct mtd_erase_region_info { | |||
61 | * MTD_OOB_PLACE: oob data are placed at the given offset | 72 | * MTD_OOB_PLACE: oob data are placed at the given offset |
62 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas | 73 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas |
63 | * which are defined by the ecclayout | 74 | * which are defined by the ecclayout |
64 | * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data | 75 | * MTD_OOB_RAW: mode to read oob and data without doing ECC checking |
65 | * is inserted into the data. Thats a raw image of the | ||
66 | * flash contents. | ||
67 | */ | 76 | */ |
68 | typedef enum { | 77 | typedef enum { |
69 | MTD_OOB_PLACE, | 78 | MTD_OOB_PLACE, |
@@ -219,6 +228,7 @@ struct mtd_info { | |||
219 | /* Chip-supported device locking */ | 228 | /* Chip-supported device locking */ |
220 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 229 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
221 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 230 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
231 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | ||
222 | 232 | ||
223 | /* Power Management functions */ | 233 | /* Power Management functions */ |
224 | int (*suspend) (struct mtd_info *mtd); | 234 | int (*suspend) (struct mtd_info *mtd); |
@@ -290,8 +300,9 @@ extern int add_mtd_device(struct mtd_info *mtd); | |||
290 | extern int del_mtd_device (struct mtd_info *mtd); | 300 | extern int del_mtd_device (struct mtd_info *mtd); |
291 | 301 | ||
292 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); | 302 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); |
303 | extern int __get_mtd_device(struct mtd_info *mtd); | ||
304 | extern void __put_mtd_device(struct mtd_info *mtd); | ||
293 | extern struct mtd_info *get_mtd_device_nm(const char *name); | 305 | extern struct mtd_info *get_mtd_device_nm(const char *name); |
294 | |||
295 | extern void put_mtd_device(struct mtd_info *mtd); | 306 | extern void put_mtd_device(struct mtd_info *mtd); |
296 | 307 | ||
297 | 308 | ||