summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-29 13:04:07 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-29 13:04:07 -0800
commit4168f7a31801bba6acc18662978d24ec850bbbd0 (patch)
tree7949f782d118bb72024de37d2cc7bb06cc74e045 /include
parent238f9b063dcc9f23493a0d3fecca29fe332d4905 (diff)
parent2b9175c174b83b8d97db9398efe948fa9092938f (diff)
downloadlinux-4168f7a31801bba6acc18662978d24ec850bbbd0.tar.gz
linux-4168f7a31801bba6acc18662978d24ec850bbbd0.tar.bz2
linux-4168f7a31801bba6acc18662978d24ec850bbbd0.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/cfi.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 3c9ea4b7adda..23a568910341 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -1,7 +1,7 @@
/* 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__
@@ -426,6 +426,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) {