]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mtd/cfi.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / include / linux / mtd / cfi.h
index 39f1430bd6d5fc2bee1702d96c6d0c11f78e8875..09bfae6938b3eb855f5a7b0b21f94eb5c4588a4a 100644 (file)
@@ -1,14 +1,12 @@
 
 /* Common Flash Interface structures
  * See http://support.intel.com/design/flash/technote/index.htm
- * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $
+ * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $
  */
 
 #ifndef __MTD_CFI_H__
 #define __MTD_CFI_H__
 
-#include <linux/config.h>
-#include <linux/version.h>
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
@@ -427,6 +425,22 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
        }
 }
 
+static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
+{
+       map_word val = map_read(map, addr);
+
+       if (map_bankwidth_is_1(map)) {
+               return val.x[0] & 0xff;
+       } else if (map_bankwidth_is_2(map)) {
+               return cfi16_to_cpu(val.x[0]);
+       } else {
+               /* No point in a 64-bit byteswap since that would just be
+                  swapping the responses from different chips, and we are
+                  only interested in one chip (a representative sample) */
+               return cfi32_to_cpu(val.x[0]);
+       }
+}
+
 static inline void cfi_udelay(int us)
 {
        if (us >= 1000) {