musb_core: don't prevent disabling clock on driver unload
[safe/jmp/linux-2.6] / include / linux / mtd / map.h
index dbd7b9b..b981b87 100644 (file)
@@ -1,18 +1,18 @@
 
 /* Overhauled routines for dealing with different mmap regions of flash */
-/* $Id: map.h,v 1.51 2005/05/25 10:15:29 gleixner Exp $ */
 
 #ifndef __LINUX_MTD_MAP_H__
 #define __LINUX_MTD_MAP_H__
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/string.h>
+
 #include <linux/mtd/compatmac.h>
+
 #include <asm/unaligned.h>
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/bug.h>
 
 #ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
 #define map_bankwidth(map) 1
 #endif
 
 #ifndef map_bankwidth
-#error "No bus width supported. What's the point?"
+#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
+static inline int map_bankwidth(void *map)
+{
+       BUG();
+       return 0;
+}
+#define map_bankwidth_is_large(map) (0)
+#define map_words(map) (0)
+#define MAX_MAP_BANKWIDTH 1
 #endif
 
 static inline int map_bankwidth_supported(int w)
@@ -167,22 +175,22 @@ typedef union {
    to a chip probe routine -- either JEDEC or CFI probe or both -- via
    do_map_probe(). If a chip is recognised, the probe code will invoke the
    appropriate chip driver (if present) and return a struct mtd_info.
-   At which point, you fill in the mtd->module with your own module 
+   At which point, you fill in the mtd->module with your own module
    address, and register it with the MTD core code. Or you could partition
    it and register the partitions instead, or keep it for your own private
    use; whatever.
-   
+
    The mtd->priv field will point to the struct map_info, and any further
-   private data required by the chip driver is linked from the 
-   mtd->priv->fldrv_priv field. This allows the map driver to get at 
+   private data required by the chip driver is linked from the
+   mtd->priv->fldrv_priv field. This allows the map driver to get at
    the destructor function map->fldrv_destroy() when it's tired
    of living.
 */
 
 struct map_info {
-       char *name;
+       const char *name;
        unsigned long size;
-       unsigned long phys;
+       resource_size_t phys;
 #define NO_XIP (-1UL)
 
        void __iomem *virt;
@@ -211,10 +219,11 @@ struct map_info {
           If there is no cache to care about this can be set to NULL. */
        void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
 
-       /* set_vpp() must handle being reentered -- enable, enable, disable 
+       /* set_vpp() must handle being reentered -- enable, enable, disable
           must leave it enabled. */
        void (*set_vpp)(struct map_info *, int);
 
+       unsigned long pfow_base;
        unsigned long map_priv_1;
        unsigned long map_priv_2;
        void *fldrv_priv;
@@ -350,9 +359,9 @@ static inline map_word map_word_ff(struct map_info *map)
 {
        map_word r;
        int i;
-       
+
        if (map_bankwidth(map) < MAP_FF_LIMIT) {
-               int bw = 8 * map_bankwidth;
+               int bw = 8 * map_bankwidth(map);
                r.x[0] = (1 << bw) - 1;
        } else {
                for (i=0; i<map_words(map); i++)