msm_fb_def.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /* Copyright (c) 2008-2010, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef MSM_FB_DEF_H
  14. #define MSM_FB_DEF_H
  15. #include <linux/module.h>
  16. #include <linux/moduleparam.h>
  17. #include <linux/kernel.h>
  18. #include <linux/slab.h>
  19. #include <linux/delay.h>
  20. #include <linux/mm.h>
  21. #include <linux/fb.h>
  22. #include <linux/msm_mdp.h>
  23. #include <linux/init.h>
  24. #include <linux/ioport.h>
  25. #include <linux/device.h>
  26. #include <linux/dma-mapping.h>
  27. #include <linux/uaccess.h>
  28. #include <linux/workqueue.h>
  29. #include <linux/string.h>
  30. #include <linux/version.h>
  31. #include <linux/proc_fs.h>
  32. #include <linux/vmalloc.h>
  33. #include <linux/debugfs.h>
  34. #include <linux/console.h>
  35. #include <linux/kernel.h>
  36. #include <linux/sched.h>
  37. #include <linux/time.h>
  38. #include <linux/init.h>
  39. #include <linux/interrupt.h>
  40. #include "linux/proc_fs.h"
  41. #include <linux/io.h>
  42. #include <linux/fb.h>
  43. #include <linux/platform_device.h>
  44. #include <asm/system.h>
  45. #include <asm/mach-types.h>
  46. #include <mach/hardware.h>
  47. typedef s64 int64;
  48. typedef s32 int32;
  49. typedef s16 int16;
  50. typedef s8 int8;
  51. typedef u64 uint64;
  52. typedef u32 uint32;
  53. typedef u16 uint16;
  54. typedef u8 uint8;
  55. typedef s32 int4;
  56. typedef s16 int2;
  57. typedef s8 int1;
  58. typedef u32 uint4;
  59. typedef u16 uint2;
  60. typedef u8 uint1;
  61. typedef u32 dword;
  62. typedef u16 word;
  63. typedef u8 byte;
  64. typedef unsigned int boolean;
  65. #ifndef TRUE
  66. #define TRUE 1
  67. #endif
  68. #ifndef FALSE
  69. #define FALSE 0
  70. #endif
  71. #define MSM_FB_ENABLE_DBGFS
  72. #define FEATURE_MDDI
  73. #if defined(CONFIG_FB_MSM_DEFAULT_DEPTH_RGB565)
  74. #define MSMFB_DEFAULT_TYPE MDP_RGB_565
  75. #elif defined(CONFIG_FB_MSM_DEFAULT_DEPTH_ARGB8888)
  76. #define MSMFB_DEFAULT_TYPE MDP_ARGB_8888
  77. #elif defined(CONFIG_FB_MSM_DEFAULT_DEPTH_RGBA8888)
  78. #define MSMFB_DEFAULT_TYPE MDP_RGBA_8888
  79. #else
  80. #define MSMFB_DEFAULT_TYPE MDP_RGB_565
  81. #endif
  82. #define outp32(addr, val) writel(val, addr)
  83. #define outp16(addr, val) writew(val, addr)
  84. #define outp8(addr, val) writeb(val, addr)
  85. #define outp(addr, val) outp32(addr, val)
  86. #ifndef MAX
  87. #define MAX( x, y ) (((x) > (y)) ? (x) : (y))
  88. #endif
  89. #ifndef MIN
  90. #define MIN( x, y ) (((x) < (y)) ? (x) : (y))
  91. #endif
  92. /*--------------------------------------------------------------------------*/
  93. #define inp32(addr) readl(addr)
  94. #define inp16(addr) readw(addr)
  95. #define inp8(addr) readb(addr)
  96. #define inp(addr) inp32(addr)
  97. #define inpw(port) readw(port)
  98. #define outpw(port, val) writew(val, port)
  99. #define inpdw(port) readl(port)
  100. #define outpdw(port, val) writel(val, port)
  101. #define clk_busy_wait(x) msleep_interruptible((x)/1000)
  102. #define memory_barrier()
  103. #define assert(expr) \
  104. if(!(expr)) { \
  105. printk(KERN_ERR "msm_fb: assertion failed! %s,%s,%s,line=%d\n",\
  106. #expr, __FILE__, __func__, __LINE__); \
  107. }
  108. #define ASSERT(x) assert(x)
  109. #define DISP_EBI2_LOCAL_DEFINE
  110. #ifdef DISP_EBI2_LOCAL_DEFINE
  111. #define LCD_PRIM_BASE_PHYS 0x98000000
  112. #define LCD_SECD_BASE_PHYS 0x9c000000
  113. #define EBI2_PRIM_LCD_RS_PIN 0x20000
  114. #define EBI2_SECD_LCD_RS_PIN 0x20000
  115. #define EBI2_PRIM_LCD_CLR 0xC0
  116. #define EBI2_PRIM_LCD_SEL 0x40
  117. #define EBI2_SECD_LCD_CLR 0x300
  118. #define EBI2_SECD_LCD_SEL 0x100
  119. #endif
  120. extern u32 msm_fb_msg_level;
  121. /*
  122. * Message printing priorities:
  123. * LEVEL 0 KERN_EMERG (highest priority)
  124. * LEVEL 1 KERN_ALERT
  125. * LEVEL 2 KERN_CRIT
  126. * LEVEL 3 KERN_ERR
  127. * LEVEL 4 KERN_WARNING
  128. * LEVEL 5 KERN_NOTICE
  129. * LEVEL 6 KERN_INFO
  130. * LEVEL 7 KERN_DEBUG (Lowest priority)
  131. */
  132. #define MSM_FB_EMERG(msg, ...) \
  133. if (msm_fb_msg_level > 0) \
  134. printk(KERN_EMERG msg, ## __VA_ARGS__);
  135. #define MSM_FB_ALERT(msg, ...) \
  136. if (msm_fb_msg_level > 1) \
  137. printk(KERN_ALERT msg, ## __VA_ARGS__);
  138. #define MSM_FB_CRIT(msg, ...) \
  139. if (msm_fb_msg_level > 2) \
  140. printk(KERN_CRIT msg, ## __VA_ARGS__);
  141. #define MSM_FB_ERR(msg, ...) \
  142. if (msm_fb_msg_level > 3) \
  143. printk(KERN_ERR msg, ## __VA_ARGS__);
  144. #define MSM_FB_WARNING(msg, ...) \
  145. if (msm_fb_msg_level > 4) \
  146. printk(KERN_WARNING msg, ## __VA_ARGS__);
  147. #define MSM_FB_NOTICE(msg, ...) \
  148. if (msm_fb_msg_level > 5) \
  149. printk(KERN_NOTICE msg, ## __VA_ARGS__);
  150. #define MSM_FB_INFO(msg, ...) \
  151. if (msm_fb_msg_level > 6) \
  152. printk(KERN_INFO msg, ## __VA_ARGS__);
  153. #define MSM_FB_DEBUG(msg, ...) \
  154. if (msm_fb_msg_level > 7) \
  155. printk(KERN_DEBUG msg, ## __VA_ARGS__);
  156. #ifdef MSM_FB_C
  157. unsigned char *msm_mdp_base;
  158. unsigned char *msm_pmdh_base;
  159. unsigned char *msm_emdh_base;
  160. unsigned char *mipi_dsi_base;
  161. #else
  162. extern unsigned char *msm_mdp_base;
  163. extern unsigned char *msm_pmdh_base;
  164. extern unsigned char *msm_emdh_base;
  165. extern unsigned char *mipi_dsi_base;
  166. #endif
  167. #undef ENABLE_MDDI_MULTI_READ_WRITE
  168. #undef ENABLE_FWD_LINK_SKEW_CALIBRATION
  169. #endif /* MSM_FB_DEF_H */