diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 17:56:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 17:56:26 -0400 |
commit | 22ae77bc7ac115b9d518d5cbc13d39317079b2b0 (patch) | |
tree | 574b7af678c0b1ad2c891ac5066292746788ece8 /include | |
parent | e379ec7c42343c6b6ef06a98de7c94db41c1423e (diff) | |
parent | 30bbf1406714cf464c56e96e4ad6a291907f5023 (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (53 commits)
[MTD] struct device - replace bus_id with dev_name(), dev_set_name()
[MTD] [NOR] Fixup for Numonyx M29W128 chips
[MTD] mtdpart: Make ecc_stats more realistic.
powerpc/85xx: TQM8548: Update DTS file for multi-chip support
powerpc: NAND: FSL UPM: document new bindings
[MTD] [NAND] FSL-UPM: Add wait flags to support board/chip specific delays
[MTD] [NAND] FSL-UPM: add multi chip support
[MTD] [NOR] Add device parent info to physmap_of
[MTD] [NAND] Add support for NAND on the Socrates board
[MTD] [NAND] Add support for 4KiB pages.
[MTD] sysfs support should not depend on CONFIG_PROC_FS
[MTD] [NAND] Add parent info for CAFÉ controller
[MTD] support driver model updates
[MTD] driver model updates (part 2)
[MTD] driver model updates
[MTD] [NAND] move gen_nand's probe function to .devinit.text
[MTD] [MAPS] move sa1100 flash's probe function to .devinit.text
[MTD] fix use after free in register_mtd_blktrans
[MTD] [MAPS] Drop now unused sharpsl-flash map
[MTD] ofpart: Check name property to determine partition nodes.
...
Manually fix trivial conflict in drivers/mtd/maps/Makefile
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/mtd.h | 21 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 4 | ||||
-rw-r--r-- | include/linux/mtd/partitions.h | 12 |
3 files changed, 35 insertions, 2 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 3aa5d77c2cdb..5675b63a0631 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
14 | #include <linux/device.h> | ||
14 | 15 | ||
15 | #include <linux/mtd/compatmac.h> | 16 | #include <linux/mtd/compatmac.h> |
16 | #include <mtd/mtd-abi.h> | 17 | #include <mtd/mtd-abi.h> |
@@ -162,6 +163,20 @@ struct mtd_info { | |||
162 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ | 163 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ |
163 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); | 164 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); |
164 | 165 | ||
166 | /* Allow NOMMU mmap() to directly map the device (if not NULL) | ||
167 | * - return the address to which the offset maps | ||
168 | * - return -ENOSYS to indicate refusal to do the mapping | ||
169 | */ | ||
170 | unsigned long (*get_unmapped_area) (struct mtd_info *mtd, | ||
171 | unsigned long len, | ||
172 | unsigned long offset, | ||
173 | unsigned long flags); | ||
174 | |||
175 | /* Backing device capabilities for this device | ||
176 | * - provides mmap capabilities | ||
177 | */ | ||
178 | struct backing_dev_info *backing_dev_info; | ||
179 | |||
165 | 180 | ||
166 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 181 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
167 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | 182 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
@@ -223,6 +238,7 @@ struct mtd_info { | |||
223 | void *priv; | 238 | void *priv; |
224 | 239 | ||
225 | struct module *owner; | 240 | struct module *owner; |
241 | struct device dev; | ||
226 | int usecount; | 242 | int usecount; |
227 | 243 | ||
228 | /* If the driver is something smart, like UBI, it may need to maintain | 244 | /* If the driver is something smart, like UBI, it may need to maintain |
@@ -233,6 +249,11 @@ struct mtd_info { | |||
233 | void (*put_device) (struct mtd_info *mtd); | 249 | void (*put_device) (struct mtd_info *mtd); |
234 | }; | 250 | }; |
235 | 251 | ||
252 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | ||
253 | { | ||
254 | return dev ? container_of(dev, struct mtd_info, dev) : NULL; | ||
255 | } | ||
256 | |||
236 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | 257 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) |
237 | { | 258 | { |
238 | if (mtd->erasesize_shift) | 259 | if (mtd->erasesize_shift) |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index db5b63da2a7e..7efb9be34662 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -43,8 +43,8 @@ extern void nand_wait_ready(struct mtd_info *mtd); | |||
43 | * is supported now. If you add a chip with bigger oobsize/page | 43 | * is supported now. If you add a chip with bigger oobsize/page |
44 | * adjust this accordingly. | 44 | * adjust this accordingly. |
45 | */ | 45 | */ |
46 | #define NAND_MAX_OOBSIZE 64 | 46 | #define NAND_MAX_OOBSIZE 128 |
47 | #define NAND_MAX_PAGESIZE 2048 | 47 | #define NAND_MAX_PAGESIZE 4096 |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Constants for hardware specific CLE/ALE/NCE function | 50 | * Constants for hardware specific CLE/ALE/NCE function |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index a45dd831b3f8..7535a74083b9 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -76,4 +76,16 @@ int __devinit of_mtd_parse_partitions(struct device *dev, | |||
76 | struct device_node *node, | 76 | struct device_node *node, |
77 | struct mtd_partition **pparts); | 77 | struct mtd_partition **pparts); |
78 | 78 | ||
79 | #ifdef CONFIG_MTD_PARTITIONS | ||
80 | static inline int mtd_has_partitions(void) { return 1; } | ||
81 | #else | ||
82 | static inline int mtd_has_partitions(void) { return 0; } | ||
83 | #endif | ||
84 | |||
85 | #ifdef CONFIG_MTD_CMDLINE_PARTS | ||
86 | static inline int mtd_has_cmdlinepart(void) { return 1; } | ||
87 | #else | ||
88 | static inline int mtd_has_cmdlinepart(void) { return 0; } | ||
89 | #endif | ||
90 | |||
79 | #endif | 91 | #endif |