35 #define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg)
36 #define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg)
37 #define print_info(f, arg...) printk(KERN_INFO DRIVER_NAME ": " f "\n", ## arg)
40 #define print_dbg(f, arg...) printk(__FILE__ ": " f "\n", ## arg)
42 #define print_dbg(f, arg...) do {} while (0)
45 #if defined(__BIG_ENDIAN)
46 #define LCD_CONTROL_DEFAULT_PO LCD_CONTROL_PO_11
48 #define LCD_CONTROL_DEFAULT_PO LCD_CONTROL_PO_00
50 #define LCD_CONTROL_DEFAULT_SBPPF LCD_CONTROL_SBPPF_565
55 #define AU1100_LCD_MAX_XRES 800
56 #define AU1100_LCD_MAX_YRES 600
57 #define AU1100_LCD_MAX_BPP 16
58 #define AU1100_LCD_MAX_CLK 48000000
59 #define AU1100_LCD_NBR_PALETTE_ENTRIES 256
62 #define AU1100FB_NBR_VIDEO_BUFFERS 4
116 #define LCD_CONTROL (AU1100_LCD_BASE + 0x0)
117 #define LCD_CONTROL_SBB_BIT 21
118 #define LCD_CONTROL_SBB_MASK (0x3 << LCD_CONTROL_SBB_BIT)
119 #define LCD_CONTROL_SBB_1 (0 << LCD_CONTROL_SBB_BIT)
120 #define LCD_CONTROL_SBB_2 (1 << LCD_CONTROL_SBB_BIT)
121 #define LCD_CONTROL_SBB_3 (2 << LCD_CONTROL_SBB_BIT)
122 #define LCD_CONTROL_SBB_4 (3 << LCD_CONTROL_SBB_BIT)
123 #define LCD_CONTROL_SBPPF_BIT 18
124 #define LCD_CONTROL_SBPPF_MASK (0x7 << LCD_CONTROL_SBPPF_BIT)
125 #define LCD_CONTROL_SBPPF_655 (0 << LCD_CONTROL_SBPPF_BIT)
126 #define LCD_CONTROL_SBPPF_565 (1 << LCD_CONTROL_SBPPF_BIT)
127 #define LCD_CONTROL_SBPPF_556 (2 << LCD_CONTROL_SBPPF_BIT)
128 #define LCD_CONTROL_SBPPF_1555 (3 << LCD_CONTROL_SBPPF_BIT)
129 #define LCD_CONTROL_SBPPF_5551 (4 << LCD_CONTROL_SBPPF_BIT)
130 #define LCD_CONTROL_WP (1<<17)
131 #define LCD_CONTROL_WD (1<<16)
132 #define LCD_CONTROL_C (1<<15)
133 #define LCD_CONTROL_SM_BIT 13
134 #define LCD_CONTROL_SM_MASK (0x3 << LCD_CONTROL_SM_BIT)
135 #define LCD_CONTROL_SM_0 (0 << LCD_CONTROL_SM_BIT)
136 #define LCD_CONTROL_SM_90 (1 << LCD_CONTROL_SM_BIT)
137 #define LCD_CONTROL_SM_180 (2 << LCD_CONTROL_SM_BIT)
138 #define LCD_CONTROL_SM_270 (3 << LCD_CONTROL_SM_BIT)
139 #define LCD_CONTROL_DB (1<<12)
140 #define LCD_CONTROL_CCO (1<<11)
141 #define LCD_CONTROL_DP (1<<10)
142 #define LCD_CONTROL_PO_BIT 8
143 #define LCD_CONTROL_PO_MASK (0x3 << LCD_CONTROL_PO_BIT)
144 #define LCD_CONTROL_PO_00 (0 << LCD_CONTROL_PO_BIT)
145 #define LCD_CONTROL_PO_01 (1 << LCD_CONTROL_PO_BIT)
146 #define LCD_CONTROL_PO_10 (2 << LCD_CONTROL_PO_BIT)
147 #define LCD_CONTROL_PO_11 (3 << LCD_CONTROL_PO_BIT)
148 #define LCD_CONTROL_MPI (1<<7)
149 #define LCD_CONTROL_PT (1<<6)
150 #define LCD_CONTROL_PC (1<<5)
151 #define LCD_CONTROL_BPP_BIT 1
152 #define LCD_CONTROL_BPP_MASK (0x7 << LCD_CONTROL_BPP_BIT)
153 #define LCD_CONTROL_BPP_1 (0 << LCD_CONTROL_BPP_BIT)
154 #define LCD_CONTROL_BPP_2 (1 << LCD_CONTROL_BPP_BIT)
155 #define LCD_CONTROL_BPP_4 (2 << LCD_CONTROL_BPP_BIT)
156 #define LCD_CONTROL_BPP_8 (3 << LCD_CONTROL_BPP_BIT)
157 #define LCD_CONTROL_BPP_12 (4 << LCD_CONTROL_BPP_BIT)
158 #define LCD_CONTROL_BPP_16 (5 << LCD_CONTROL_BPP_BIT)
159 #define LCD_CONTROL_GO (1<<0)
161 #define LCD_INTSTATUS (AU1100_LCD_BASE + 0x4)
162 #define LCD_INTENABLE (AU1100_LCD_BASE + 0x8)
163 #define LCD_INT_SD (1<<7)
164 #define LCD_INT_OF (1<<6)
165 #define LCD_INT_UF (1<<5)
166 #define LCD_INT_SA (1<<3)
167 #define LCD_INT_SS (1<<2)
168 #define LCD_INT_S1 (1<<1)
169 #define LCD_INT_S0 (1<<0)
171 #define LCD_HORZTIMING (AU1100_LCD_BASE + 0xC)
172 #define LCD_HORZTIMING_HN2_BIT 24
173 #define LCD_HORZTIMING_HN2_MASK (0xFF << LCD_HORZTIMING_HN2_BIT)
174 #define LCD_HORZTIMING_HN2_N(N) ((((N)-1) << LCD_HORZTIMING_HN2_BIT) & LCD_HORZTIMING_HN2_MASK)
175 #define LCD_HORZTIMING_HN1_BIT 16
176 #define LCD_HORZTIMING_HN1_MASK (0xFF << LCD_HORZTIMING_HN1_BIT)
177 #define LCD_HORZTIMING_HN1_N(N) ((((N)-1) << LCD_HORZTIMING_HN1_BIT) & LCD_HORZTIMING_HN1_MASK)
178 #define LCD_HORZTIMING_HPW_BIT 10
179 #define LCD_HORZTIMING_HPW_MASK (0x3F << LCD_HORZTIMING_HPW_BIT)
180 #define LCD_HORZTIMING_HPW_N(N) ((((N)-1) << LCD_HORZTIMING_HPW_BIT) & LCD_HORZTIMING_HPW_MASK)
181 #define LCD_HORZTIMING_PPL_BIT 0
182 #define LCD_HORZTIMING_PPL_MASK (0x3FF << LCD_HORZTIMING_PPL_BIT)
183 #define LCD_HORZTIMING_PPL_N(N) ((((N)-1) << LCD_HORZTIMING_PPL_BIT) & LCD_HORZTIMING_PPL_MASK)
185 #define LCD_VERTTIMING (AU1100_LCD_BASE + 0x10)
186 #define LCD_VERTTIMING_VN2_BIT 24
187 #define LCD_VERTTIMING_VN2_MASK (0xFF << LCD_VERTTIMING_VN2_BIT)
188 #define LCD_VERTTIMING_VN2_N(N) ((((N)-1) << LCD_VERTTIMING_VN2_BIT) & LCD_VERTTIMING_VN2_MASK)
189 #define LCD_VERTTIMING_VN1_BIT 16
190 #define LCD_VERTTIMING_VN1_MASK (0xFF << LCD_VERTTIMING_VN1_BIT)
191 #define LCD_VERTTIMING_VN1_N(N) ((((N)-1) << LCD_VERTTIMING_VN1_BIT) & LCD_VERTTIMING_VN1_MASK)
192 #define LCD_VERTTIMING_VPW_BIT 10
193 #define LCD_VERTTIMING_VPW_MASK (0x3F << LCD_VERTTIMING_VPW_BIT)
194 #define LCD_VERTTIMING_VPW_N(N) ((((N)-1) << LCD_VERTTIMING_VPW_BIT) & LCD_VERTTIMING_VPW_MASK)
195 #define LCD_VERTTIMING_LPP_BIT 0
196 #define LCD_VERTTIMING_LPP_MASK (0x3FF << LCD_VERTTIMING_LPP_BIT)
197 #define LCD_VERTTIMING_LPP_N(N) ((((N)-1) << LCD_VERTTIMING_LPP_BIT) & LCD_VERTTIMING_LPP_MASK)
199 #define LCD_CLKCONTROL (AU1100_LCD_BASE + 0x14)
200 #define LCD_CLKCONTROL_IB (1<<18)
201 #define LCD_CLKCONTROL_IC (1<<17)
202 #define LCD_CLKCONTROL_IH (1<<16)
203 #define LCD_CLKCONTROL_IV (1<<15)
204 #define LCD_CLKCONTROL_BF_BIT 10
205 #define LCD_CLKCONTROL_BF_MASK (0x1F << LCD_CLKCONTROL_BF_BIT)
206 #define LCD_CLKCONTROL_BF_N(N) ((((N)-1) << LCD_CLKCONTROL_BF_BIT) & LCD_CLKCONTROL_BF_MASK)
207 #define LCD_CLKCONTROL_PCD_BIT 0
208 #define LCD_CLKCONTROL_PCD_MASK (0x3FF << LCD_CLKCONTROL_PCD_BIT)
209 #define LCD_CLKCONTROL_PCD_N(N) (((N) << LCD_CLKCONTROL_PCD_BIT) & LCD_CLKCONTROL_PCD_MASK)
211 #define LCD_DMAADDR0 (AU1100_LCD_BASE + 0x18)
212 #define LCD_DMAADDR1 (AU1100_LCD_BASE + 0x1C)
213 #define LCD_DMA_SA_BIT 5
214 #define LCD_DMA_SA_MASK (0x7FFFFFF << LCD_DMA_SA_BIT)
215 #define LCD_DMA_SA_N(N) ((N) & LCD_DMA_SA_MASK)
217 #define LCD_WORDS (AU1100_LCD_BASE + 0x20)
218 #define LCD_WRD_WRDS_BIT 0
219 #define LCD_WRD_WRDS_MASK (0xFFFFFFFF << LCD_WRD_WRDS_BIT)
220 #define LCD_WRD_WRDS_N(N) ((((N)-1) << LCD_WRD_WRDS_BIT) & LCD_WRD_WRDS_MASK)
222 #define LCD_PWMDIV (AU1100_LCD_BASE + 0x24)
223 #define LCD_PWMDIV_EN (1<<12)
224 #define LCD_PWMDIV_PWMDIV_BIT 0
225 #define LCD_PWMDIV_PWMDIV_MASK (0xFFF << LCD_PWMDIV_PWMDIV_BIT)
226 #define LCD_PWMDIV_PWMDIV_N(N) ((((N)-1) << LCD_PWMDIV_PWMDIV_BIT) & LCD_PWMDIV_PWMDIV_MASK)
228 #define LCD_PWMHI (AU1100_LCD_BASE + 0x28)
229 #define LCD_PWMHI_PWMHI1_BIT 12
230 #define LCD_PWMHI_PWMHI1_MASK (0xFFF << LCD_PWMHI_PWMHI1_BIT)
231 #define LCD_PWMHI_PWMHI1_N(N) (((N) << LCD_PWMHI_PWMHI1_BIT) & LCD_PWMHI_PWMHI1_MASK)
232 #define LCD_PWMHI_PWMHI0_BIT 0
233 #define LCD_PWMHI_PWMHI0_MASK (0xFFF << LCD_PWMHI_PWMHI0_BIT)
234 #define LCD_PWMHI_PWMHI0_N(N) (((N) << LCD_PWMHI_PWMHI0_BIT) & LCD_PWMHI_PWMHI0_MASK)
236 #define LCD_PALLETTEBASE (AU1100_LCD_BASE + 0x400)
237 #define LCD_PALLETTE_MONO_MI_BIT 0
238 #define LCD_PALLETTE_MONO_MI_MASK (0xF << LCD_PALLETTE_MONO_MI_BIT)
239 #define LCD_PALLETTE_MONO_MI_N(N) (((N)<< LCD_PALLETTE_MONO_MI_BIT) & LCD_PALLETTE_MONO_MI_MASK)
241 #define LCD_PALLETTE_COLOR_RI_BIT 8
242 #define LCD_PALLETTE_COLOR_RI_MASK (0xF << LCD_PALLETTE_COLOR_RI_BIT)
243 #define LCD_PALLETTE_COLOR_RI_N(N) (((N)<< LCD_PALLETTE_COLOR_RI_BIT) & LCD_PALLETTE_COLOR_RI_MASK)
244 #define LCD_PALLETTE_COLOR_GI_BIT 4
245 #define LCD_PALLETTE_COLOR_GI_MASK (0xF << LCD_PALLETTE_COLOR_GI_BIT)
246 #define LCD_PALLETTE_COLOR_GI_N(N) (((N)<< LCD_PALLETTE_COLOR_GI_BIT) & LCD_PALLETTE_COLOR_GI_MASK)
247 #define LCD_PALLETTE_COLOR_BI_BIT 0
248 #define LCD_PALLETTE_COLOR_BI_MASK (0xF << LCD_PALLETTE_COLOR_BI_BIT)
249 #define LCD_PALLETTE_COLOR_BI_N(N) (((N)<< LCD_PALLETTE_COLOR_BI_BIT) & LCD_PALLETTE_COLOR_BI_MASK)
251 #define LCD_PALLETTE_TFT_DC_BIT 0
252 #define LCD_PALLETTE_TFT_DC_MASK (0xFFFF << LCD_PALLETTE_TFT_DC_BIT)
253 #define LCD_PALLETTE_TFT_DC_N(N) (((N)<< LCD_PALLETTE_TFT_DC_BIT) & LCD_PALLETTE_TFT_DC_MASK)
272 .name =
"CRT_800x600_16",
276 .control_base = 0x0004886A |
279 .clkcontrol_base = 0x00020000,
280 .horztiming = 0x005aff1f,
281 .verttiming = 0x16000e57,
289 .control_base = 0x0006806A,
290 .horztiming = 0x0A1010EF,
291 .verttiming = 0x0301013F,
292 .clkcontrol_base = 0x00018001,
296 .name =
"Sharp_LQ038Q5DR01",
323 .name =
"Hitachi_SP14Qxxx",
345 .name =
"TFT_640x480_16",
350 .horztiming = 0x3434d67f,
351 .verttiming = 0x0e0e39df,
357 .name =
"PrimeView_640x480_16",
362 .horztiming = 0x0e4bfe7f,
363 .verttiming = 0x210805df,
364 .clkcontrol_base = 0x00038001,
372 #define panel_is_dual(panel) (panel->control_base & LCD_CONTROL_DP)
373 #define panel_is_active(panel)(panel->control_base & LCD_CONTROL_PT)
374 #define panel_is_color(panel) (panel->control_base & LCD_CONTROL_PC)
375 #define panel_swap_rgb(panel) (panel->control_base & LCD_CONTROL_CCO)