tmio.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 MMC controller
  19. */
  20. struct tmio_mmc_data {
  21. unsigned int hclk;
  22. };
  23. /*
  24. * data for the NAND controller
  25. */
  26. struct tmio_nand_data {
  27. struct nand_bbt_descr *badblock_pattern;
  28. struct mtd_partition *partition;
  29. unsigned int num_partitions;
  30. };
  31. #define FBIO_TMIO_ACC_WRITE 0x7C639300
  32. #define FBIO_TMIO_ACC_SYNC 0x7C639301
  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. /* in mm: size of screen */
  41. int height;
  42. int width;
  43. };
  44. #endif