1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5 * * Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of Code Aurora nor
11 * the names of its contributors may be used to endorse or promote
12 * products derived from this software without specific prior written
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include <linux/module.h>
33 #include <linux/moduleparam.h>
34 #include <linux/kernel.h>
35 #include <linux/slab.h>
36 #include <linux/delay.h>
40 #include <linux/init.h>
41 #include <linux/ioport.h>
42 #include <linux/device.h>
43 #include <linux/dma-mapping.h>
44 #include <linux/uaccess.h>
45 #include <linux/workqueue.h>
46 #include <linux/string.h>
47 #include <linux/version.h>
48 #include <linux/proc_fs.h>
49 #include <linux/vmalloc.h>
50 #include <linux/debugfs.h>
51 #include <linux/console.h>
53 #include <linux/kernel.h>
54 #include <linux/sched.h>
55 #include <linux/time.h>
56 #include <linux/init.h>
57 #include <linux/interrupt.h>
58 #include "linux/proc_fs.h"
59 #include <mach/hardware.h>
62 #include <asm/system.h>
63 #include <asm/mach-types.h>
64 #include <linux/platform_device.h>
88 typedef unsigned int boolean;
98 #define MSM_FB_ENABLE_DBGFS
101 #define outp32(addr, val) writel(val, addr)
102 #define outp16(addr, val) writew(val, addr)
103 #define outp8(addr, val) writeb(val, addr)
104 #define outp(addr, val) outp32(addr, val)
107 #define MAX( x, y ) (((x) > (y)) ? (x) : (y))
111 #define MIN( x, y ) (((x) < (y)) ? (x) : (y))
114 /*--------------------------------------------------------------------------*/
116 #define inp32(addr) readl(addr)
117 #define inp16(addr) readw(addr)
118 #define inp8(addr) readb(addr)
119 #define inp(addr) inp32(addr)
121 #define inpw(port) readw(port)
122 #define outpw(port, val) writew(val, port)
123 #define inpdw(port) readl(port)
124 #define outpdw(port, val) writel(val, port)
127 #define clk_busy_wait(x) msleep_interruptible((x)/1000)
129 #define memory_barrier()
131 #define assert(expr) \
133 printk(KERN_ERR "msm_fb: assertion failed! %s,%s,%s,line=%d\n",\
134 #expr, __FILE__, __func__, __LINE__); \
137 #define ASSERT(x) assert(x)
139 #define DISP_EBI2_LOCAL_DEFINE
140 #ifdef DISP_EBI2_LOCAL_DEFINE
141 #define LCD_PRIM_BASE_PHYS 0x98000000
142 #define LCD_SECD_BASE_PHYS 0x9c000000
143 #define EBI2_PRIM_LCD_RS_PIN 0x20000
144 #define EBI2_SECD_LCD_RS_PIN 0x20000
146 #define EBI2_PRIM_LCD_CLR 0xC0
147 #define EBI2_PRIM_LCD_SEL 0x40
149 #define EBI2_SECD_LCD_CLR 0x300
150 #define EBI2_SECD_LCD_SEL 0x100
153 extern u32 msm_fb_msg_level;
156 * Message printing priorities:
157 * LEVEL 0 KERN_EMERG (highest priority)
161 * LEVEL 4 KERN_WARNING
162 * LEVEL 5 KERN_NOTICE
164 * LEVEL 7 KERN_DEBUG (Lowest priority)
166 #define MSM_FB_EMERG(msg, ...) \
167 if (msm_fb_msg_level > 0) \
168 printk(KERN_EMERG msg, ## __VA_ARGS__);
169 #define MSM_FB_ALERT(msg, ...) \
170 if (msm_fb_msg_level > 1) \
171 printk(KERN_ALERT msg, ## __VA_ARGS__);
172 #define MSM_FB_CRIT(msg, ...) \
173 if (msm_fb_msg_level > 2) \
174 printk(KERN_CRIT msg, ## __VA_ARGS__);
175 #define MSM_FB_ERR(msg, ...) \
176 if (msm_fb_msg_level > 3) \
177 printk(KERN_ERR msg, ## __VA_ARGS__);
178 #define MSM_FB_WARNING(msg, ...) \
179 if (msm_fb_msg_level > 4) \
180 printk(KERN_WARNING msg, ## __VA_ARGS__);
181 #define MSM_FB_NOTICE(msg, ...) \
182 if (msm_fb_msg_level > 5) \
183 printk(KERN_NOTICE msg, ## __VA_ARGS__);
184 #define MSM_FB_INFO(msg, ...) \
185 if (msm_fb_msg_level > 6) \
186 printk(KERN_INFO msg, ## __VA_ARGS__);
187 #define MSM_FB_DEBUG(msg, ...) \
188 if (msm_fb_msg_level > 7) \
189 printk(KERN_DEBUG msg, ## __VA_ARGS__);
192 unsigned char *msm_mdp_base;
193 unsigned char *msm_pmdh_base;
194 unsigned char *msm_emdh_base;
196 extern unsigned char *msm_mdp_base;
197 extern unsigned char *msm_pmdh_base;
198 extern unsigned char *msm_emdh_base;
201 #endif /* MSM_FB_DEF_H */