Dmitry Baryshkov | f024ff1 | 2008-06-27 10:37:57 +0100 | [diff] [blame] | 1 | #ifndef MFD_TMIO_H |
| 2 | #define MFD_TMIO_H |
| 3 | |
Dmitry Baryshkov | b53cde3 | 2008-10-15 22:03:55 -0700 | [diff] [blame^] | 4 | #include <linux/fb.h> |
| 5 | |
Ian Molton | d3a2f71 | 2008-07-31 20:44:28 +0200 | [diff] [blame] | 6 | #define tmio_ioread8(addr) readb(addr) |
| 7 | #define tmio_ioread16(addr) readw(addr) |
| 8 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) |
| 9 | #define tmio_ioread32(addr) \ |
| 10 | (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16)) |
| 11 | |
| 12 | #define tmio_iowrite8(val, addr) writeb((val), (addr)) |
| 13 | #define tmio_iowrite16(val, addr) writew((val), (addr)) |
| 14 | #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l) |
| 15 | #define tmio_iowrite32(val, addr) \ |
| 16 | do { \ |
| 17 | writew((val), (addr)); \ |
| 18 | writew((val) >> 16, (addr) + 2); \ |
| 19 | } while (0) |
| 20 | |
Dmitry Baryshkov | f024ff1 | 2008-06-27 10:37:57 +0100 | [diff] [blame] | 21 | /* |
| 22 | * data for the NAND controller |
| 23 | */ |
| 24 | struct tmio_nand_data { |
| 25 | struct nand_bbt_descr *badblock_pattern; |
| 26 | struct mtd_partition *partition; |
| 27 | unsigned int num_partitions; |
| 28 | }; |
| 29 | |
Dmitry Baryshkov | b53cde3 | 2008-10-15 22:03:55 -0700 | [diff] [blame^] | 30 | #define FBIO_TMIO_ACC_WRITE 0x7C639300 |
| 31 | #define FBIO_TMIO_ACC_SYNC 0x7C639301 |
| 32 | |
| 33 | struct tmio_fb_data { |
| 34 | int (*lcd_set_power)(struct platform_device *fb_dev, |
| 35 | bool on); |
| 36 | int (*lcd_mode)(struct platform_device *fb_dev, |
| 37 | const struct fb_videomode *mode); |
| 38 | int num_modes; |
| 39 | struct fb_videomode *modes; |
| 40 | |
| 41 | /* in mm: size of screen */ |
| 42 | int height; |
| 43 | int width; |
| 44 | }; |
| 45 | |
| 46 | |
Dmitry Baryshkov | f024ff1 | 2008-06-27 10:37:57 +0100 | [diff] [blame] | 47 | #endif |