tmio.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef MFD_TMIO_H
  2. #define MFD_TMIO_H
  3. #include <linux/fb.h>
  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. #define tmio_iowrite8(val, addr) writeb((val), (addr))
  10. #define tmio_iowrite16(val, addr) writew((val), (addr))
  11. #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
  12. #define tmio_iowrite32(val, addr) \
  13. do { \
  14. writew((val), (addr)); \
  15. writew((val) >> 16, (addr) + 2); \
  16. } while (0)
  17. /*
  18. * data for the NAND controller
  19. */
  20. struct tmio_nand_data {
  21. struct nand_bbt_descr *badblock_pattern;
  22. struct mtd_partition *partition;
  23. unsigned int num_partitions;
  24. };
  25. #define FBIO_TMIO_ACC_WRITE 0x7C639300
  26. #define FBIO_TMIO_ACC_SYNC 0x7C639301
  27. struct tmio_fb_data {
  28. int (*lcd_set_power)(struct platform_device *fb_dev,
  29. bool on);
  30. int (*lcd_mode)(struct platform_device *fb_dev,
  31. const struct fb_videomode *mode);
  32. int num_modes;
  33. struct fb_videomode *modes;
  34. /* in mm: size of screen */
  35. int height;
  36. int width;
  37. };
  38. #endif