fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / mtd / onenand.h
index 1f49721..f775a7a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  linux/include/linux/mtd/onenand.h
  *
- *  Copyright (C) 2005 Samsung Electronics
+ *  Copyright (C) 2005-2006 Samsung Electronics
  *  Kyungmin Park <kyungmin.park@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -13,6 +13,7 @@
 #define __LINUX_MTD_ONENAND_H
 
 #include <linux/spinlock.h>
+#include <linux/completion.h>
 #include <linux/mtd/onenand_regs.h>
 #include <linux/mtd/bbm.h>
 
@@ -33,7 +34,6 @@ typedef enum {
        FL_WRITING,
        FL_ERASING,
        FL_SYNCING,
-       FL_UNLOCKING,
        FL_LOCKING,
        FL_RESETING,
        FL_OTPING,
@@ -88,6 +88,7 @@ struct onenand_bufferram {
  *                     operation is in progress
  * @state:             [INTERN] the current state of the OneNAND device
  * @page_buf:          data buffer
+ * @subpagesize:       [INTERN] holds the subpagesize
  * @ecclayout:         [REPLACEABLE] the default ecc placement scheme
  * @bbm:               [REPLACEABLE] pointer to Bad Block Management
  * @priv:              [OPTIONAL] pointer to private chip date
@@ -96,6 +97,7 @@ struct onenand_chip {
        void __iomem            *base;
        unsigned int            chipsize;
        unsigned int            device_id;
+       unsigned int            version_id;
        unsigned int            density_mask;
        unsigned int            options;
 
@@ -119,11 +121,15 @@ struct onenand_chip {
        int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
        int (*scan_bbt)(struct mtd_info *mtd);
 
+       struct completion       complete;
+       int                     irq;
+
        spinlock_t              chip_lock;
        wait_queue_head_t       wq;
        onenand_state_t         state;
        unsigned char           *page_buf;
 
+       int                     subpagesize;
        struct nand_ecclayout   *ecclayout;
 
        void                    *bbm;
@@ -137,6 +143,7 @@ struct onenand_chip {
 #define ONENAND_CURRENT_BUFFERRAM(this)                (this->bufferram_index)
 #define ONENAND_NEXT_BUFFERRAM(this)           (this->bufferram_index ^ 1)
 #define ONENAND_SET_NEXT_BUFFERRAM(this)       (this->bufferram_index ^= 1)
+#define ONENAND_SET_PREV_BUFFERRAM(this)       (this->bufferram_index ^= 1)
 
 #define ONENAND_GET_SYS_CFG1(this)                                     \
        (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
@@ -149,7 +156,8 @@ struct onenand_chip {
 /*
  * Options bits
  */
-#define ONENAND_CONT_LOCK              (0x0001)
+#define ONENAND_HAS_CONT_LOCK          (0x0001)
+#define ONENAND_HAS_UNLOCK_ALL         (0x0002)
 #define ONENAND_PAGEBUF_ALLOC          (0x1000)
 
 /*