mfd: TMIO MMC structures and accessors.
[safe/jmp/linux-2.6] / include / linux / mfd / tmio.h
1 #ifndef MFD_TMIO_H
2 #define MFD_TMIO_H
3
4 #define tmio_ioread8(addr) readb(addr)
5 #define tmio_ioread16(addr) readw(addr)
6 #define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
7 #define tmio_ioread32(addr) \
8         (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
9
10 #define tmio_iowrite8(val, addr) writeb((val), (addr))
11 #define tmio_iowrite16(val, addr) writew((val), (addr))
12 #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
13 #define tmio_iowrite32(val, addr) \
14         do { \
15         writew((val),       (addr)); \
16         writew((val) >> 16, (addr) + 2); \
17         } while (0)
18
19 /*
20  * data for the NAND controller
21  */
22 struct tmio_nand_data {
23         struct nand_bbt_descr   *badblock_pattern;
24         struct mtd_partition    *partition;
25         unsigned int            num_partitions;
26 };
27
28 #endif