sa1100fb.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * linux/drivers/video/sa1100fb.h
  3. * -- StrongARM 1100 LCD Controller Frame Buffer Device
  4. *
  5. * Copyright (C) 1999 Eric A. Thomas
  6. * Based on acornfb.c Copyright (C) Russell King.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file COPYING in the main directory of this archive
  10. * for more details.
  11. */
  12. #define RGB_4 0
  13. #define RGB_8 1
  14. #define RGB_16 2
  15. #define NR_RGB 3
  16. /* These are the bitfields for each display depth that we support. */
  17. struct sa1100fb_rgb {
  18. struct fb_bitfield red;
  19. struct fb_bitfield green;
  20. struct fb_bitfield blue;
  21. struct fb_bitfield transp;
  22. };
  23. /* This structure describes the machine which we are running on. */
  24. struct sa1100fb_mach_info {
  25. u_long pixclock;
  26. u_short xres;
  27. u_short yres;
  28. u_char bpp;
  29. u_char hsync_len;
  30. u_char left_margin;
  31. u_char right_margin;
  32. u_char vsync_len;
  33. u_char upper_margin;
  34. u_char lower_margin;
  35. u_char sync;
  36. u_int cmap_greyscale:1,
  37. cmap_inverse:1,
  38. cmap_static:1,
  39. unused:29;
  40. u_int lccr0;
  41. u_int lccr3;
  42. /* Overrides for the default RGB maps */
  43. const struct sa1100fb_rgb *rgb[NR_RGB];
  44. };
  45. /* Shadows for LCD controller registers */
  46. struct sa1100fb_lcd_reg {
  47. unsigned long lccr0;
  48. unsigned long lccr1;
  49. unsigned long lccr2;
  50. unsigned long lccr3;
  51. };
  52. struct sa1100fb_info {
  53. struct fb_info fb;
  54. struct device *dev;
  55. const struct sa1100fb_rgb *rgb[NR_RGB];
  56. u_int max_bpp;
  57. u_int max_xres;
  58. u_int max_yres;
  59. /*
  60. * These are the addresses we mapped
  61. * the framebuffer memory region to.
  62. */
  63. dma_addr_t map_dma;
  64. u_char * map_cpu;
  65. u_int map_size;
  66. u_char * screen_cpu;
  67. dma_addr_t screen_dma;
  68. u16 * palette_cpu;
  69. dma_addr_t palette_dma;
  70. u_int palette_size;
  71. dma_addr_t dbar1;
  72. dma_addr_t dbar2;
  73. u_int lccr0;
  74. u_int lccr3;
  75. u_int cmap_inverse:1,
  76. cmap_static:1,
  77. unused:30;
  78. u_int reg_lccr0;
  79. u_int reg_lccr1;
  80. u_int reg_lccr2;
  81. u_int reg_lccr3;
  82. volatile u_char state;
  83. volatile u_char task_state;
  84. struct mutex ctrlr_lock;
  85. wait_queue_head_t ctrlr_wait;
  86. struct work_struct task;
  87. #ifdef CONFIG_CPU_FREQ
  88. struct notifier_block freq_transition;
  89. struct notifier_block freq_policy;
  90. #endif
  91. };
  92. #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
  93. #define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9)
  94. /*
  95. * These are the actions for set_ctrlr_state
  96. */
  97. #define C_DISABLE (0)
  98. #define C_ENABLE (1)
  99. #define C_DISABLE_CLKCHANGE (2)
  100. #define C_ENABLE_CLKCHANGE (3)
  101. #define C_REENABLE (4)
  102. #define C_DISABLE_PM (5)
  103. #define C_ENABLE_PM (6)
  104. #define C_STARTUP (7)
  105. #define SA1100_NAME "SA1100"
  106. /*
  107. * Minimum X and Y resolutions
  108. */
  109. #define MIN_XRES 64
  110. #define MIN_YRES 64