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
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/uio.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
#include <linux/mtd/compatmac.h>
|
||||
#include <mtd/mtd-abi.h>
|
||||
@@ -162,6 +163,20 @@ struct mtd_info {
|
||||
/* We probably shouldn't allow XIP if the unpoint isn't a NULL */
|
||||
void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
|
||||
|
||||
/* Allow NOMMU mmap() to directly map the device (if not NULL)
|
||||
* - return the address to which the offset maps
|
||||
* - return -ENOSYS to indicate refusal to do the mapping
|
||||
*/
|
||||
unsigned long (*get_unmapped_area) (struct mtd_info *mtd,
|
||||
unsigned long len,
|
||||
unsigned long offset,
|
||||
unsigned long flags);
|
||||
|
||||
/* Backing device capabilities for this device
|
||||
* - provides mmap capabilities
|
||||
*/
|
||||
struct backing_dev_info *backing_dev_info;
|
||||
|
||||
|
||||
int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
|
||||
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 {
|
||||
void *priv;
|
||||
|
||||
struct module *owner;
|
||||
struct device dev;
|
||||
int usecount;
|
||||
|
||||
/* If the driver is something smart, like UBI, it may need to maintain
|
||||
@@ -233,6 +249,11 @@ struct mtd_info {
|
||||
void (*put_device) (struct mtd_info *mtd);
|
||||
};
|
||||
|
||||
static inline struct mtd_info *dev_to_mtd(struct device *dev)
|
||||
{
|
||||
return dev ? container_of(dev, struct mtd_info, dev) : NULL;
|
||||
}
|
||||
|
||||
static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd)
|
||||
{
|
||||
if (mtd->erasesize_shift)
|
||||
|
@@ -43,8 +43,8 @@ extern void nand_wait_ready(struct mtd_info *mtd);
|
||||
* is supported now. If you add a chip with bigger oobsize/page
|
||||
* adjust this accordingly.
|
||||
*/
|
||||
#define NAND_MAX_OOBSIZE 64
|
||||
#define NAND_MAX_PAGESIZE 2048
|
||||
#define NAND_MAX_OOBSIZE 128
|
||||
#define NAND_MAX_PAGESIZE 4096
|
||||
|
||||
/*
|
||||
* Constants for hardware specific CLE/ALE/NCE function
|
||||
|
@@ -76,4 +76,16 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct mtd_partition **pparts);
|
||||
|
||||
#ifdef CONFIG_MTD_PARTITIONS
|
||||
static inline int mtd_has_partitions(void) { return 1; }
|
||||
#else
|
||||
static inline int mtd_has_partitions(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MTD_CMDLINE_PARTS
|
||||
static inline int mtd_has_cmdlinepart(void) { return 1; }
|
||||
#else
|
||||
static inline int mtd_has_cmdlinepart(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user