sa1100fb.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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. /*
  13.  * These are the bitfields for each
  14.  * display depth that we support.
  15.  */
  16. struct sa1100fb_rgb {
  17. struct fb_bitfield red;
  18. struct fb_bitfield green;
  19. struct fb_bitfield blue;
  20. struct fb_bitfield transp;
  21. };
  22. /*
  23.  * This structure describes the machine which we are running on.
  24.  */
  25. struct sa1100fb_mach_info {
  26. u_long pixclock;
  27. u_short xres;
  28. u_short yres;
  29. u_char bpp;
  30. u_char hsync_len;
  31. u_char left_margin;
  32. u_char right_margin;
  33. u_char vsync_len;
  34. u_char upper_margin;
  35. u_char lower_margin;
  36. u_char sync;
  37. u_int cmap_greyscale:1,
  38. cmap_inverse:1,
  39. cmap_static:1,
  40. unused:29;
  41. u_int lccr0;
  42. u_int lccr3;
  43. };
  44. /* Shadows for LCD controller registers */
  45. struct sa1100fb_lcd_reg {
  46. unsigned long lccr0;
  47. unsigned long lccr1;
  48. unsigned long lccr2;
  49. unsigned long lccr3;
  50. };
  51. #define RGB_8 (0)
  52. #define RGB_16 (1)
  53. #define NR_RGB 2
  54. struct sa1100fb_info {
  55. struct fb_info fb;
  56. signed int currcon;
  57. struct sa1100fb_rgb *rgb[NR_RGB];
  58. u_int max_bpp;
  59. u_int max_xres;
  60. u_int max_yres;
  61. /*
  62.  * These are the addresses we mapped
  63.  * the framebuffer memory region to.
  64.  */
  65. dma_addr_t map_dma;
  66. u_char * map_cpu;
  67. u_int map_size;
  68. u_char * screen_cpu;
  69. dma_addr_t screen_dma;
  70. u16 * palette_cpu;
  71. dma_addr_t palette_dma;
  72. u_int palette_size;
  73. dma_addr_t dbar1;
  74. dma_addr_t dbar2;
  75. u_int lccr0;
  76. u_int lccr3;
  77. u_int cmap_inverse:1,
  78. cmap_static:1,
  79. unused:30;
  80. u_int reg_lccr0;
  81. u_int reg_lccr1;
  82. u_int reg_lccr2;
  83. u_int reg_lccr3;
  84. volatile u_char state;
  85. volatile u_char task_state;
  86. struct semaphore ctrlr_sem;
  87. wait_queue_head_t ctrlr_wait;
  88. struct tq_struct task;
  89. #ifdef CONFIG_PM
  90. struct pm_dev *pm;
  91. #endif
  92. #ifdef CONFIG_CPU_FREQ
  93. struct notifier_block clockchg;
  94. #endif
  95. };
  96. #define __type_entry(ptr,type,member) ((type *)((char *)(ptr)-offsetof(type,member)))
  97. #define TO_INF(ptr,member) __type_entry(ptr,struct sa1100fb_info,member)
  98. #define SA1100_PALETTE_MODE_VAL(bpp)    (((bpp) & 0x018) << 9)
  99. /*
  100.  * These are the actions for set_ctrlr_state
  101.  */
  102. #define C_DISABLE (0)
  103. #define C_ENABLE (1)
  104. #define C_DISABLE_CLKCHANGE (2)
  105. #define C_ENABLE_CLKCHANGE (3)
  106. #define C_REENABLE (4)
  107. #define C_DISABLE_PM (5)
  108. #define C_ENABLE_PM (6)
  109. #define SA1100_NAME "SA1100"
  110. /*
  111.  *  Debug macros 
  112.  */
  113. #if DEBUG
  114. #  define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
  115. #else
  116. #  define DPRINTK(fmt, args...)
  117. #endif
  118. /*
  119.  * Minimum X and Y resolutions
  120.  */
  121. #define MIN_XRES 64
  122. #define MIN_YRES 64