ia64/kvm: compilation fix. export account_system_vtime.
[pv_ops_mirror.git] / include / asm-arm / arch-pxa / pxafb.h
blobbbd22396841ae15d0eefcd235ffeccd9abdacb8b
1 /*
2 * linux/include/asm-arm/arch-pxa/pxafb.h
4 * Support for the xscale frame buffer.
6 * Author: Jean-Frederic Clere
7 * Created: Sep 22, 2003
8 * Copyright: jfclere@sinix.net
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/fb.h>
16 #include <asm/arch/regs-lcd.h>
19 * Supported LCD connections
21 * bits 0 - 3: for LCD panel type:
23 * STN - for passive matrix
24 * DSTN - for dual scan passive matrix
25 * TFT - for active matrix
27 * bits 4 - 9 : for bus width
28 * bits 10-17 : for AC Bias Pin Frequency
29 * bit 18 : for output enable polarity
30 * bit 19 : for pixel clock edge
32 #define LCD_CONN_TYPE(_x) ((_x) & 0x0f)
33 #define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f)
35 #define LCD_TYPE_UNKNOWN 0
36 #define LCD_TYPE_MONO_STN 1
37 #define LCD_TYPE_MONO_DSTN 2
38 #define LCD_TYPE_COLOR_STN 3
39 #define LCD_TYPE_COLOR_DSTN 4
40 #define LCD_TYPE_COLOR_TFT 5
41 #define LCD_TYPE_SMART_PANEL 6
42 #define LCD_TYPE_MAX 7
44 #define LCD_MONO_STN_4BPP ((4 << 4) | LCD_TYPE_MONO_STN)
45 #define LCD_MONO_STN_8BPP ((8 << 4) | LCD_TYPE_MONO_STN)
46 #define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN)
47 #define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN)
48 #define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN)
49 #define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT)
50 #define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT)
51 #define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL)
52 #define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL)
53 #define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL)
55 #define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10)
56 #define LCD_BIAS_ACTIVE_HIGH (0 << 17)
57 #define LCD_BIAS_ACTIVE_LOW (1 << 17)
58 #define LCD_PCLK_EDGE_RISE (0 << 18)
59 #define LCD_PCLK_EDGE_FALL (1 << 18)
62 * This structure describes the machine which we are running on.
63 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine
64 * of linux/drivers/video/pxafb.c
66 struct pxafb_mode_info {
67 u_long pixclock;
69 u_short xres;
70 u_short yres;
72 u_char bpp;
73 u_int cmap_greyscale:1,
74 unused:31;
76 /* Parallel Mode Timing */
77 u_char hsync_len;
78 u_char left_margin;
79 u_char right_margin;
81 u_char vsync_len;
82 u_char upper_margin;
83 u_char lower_margin;
84 u_char sync;
86 /* Smart Panel Mode Timing - see PXA27x DM 7.4.15.0.3 for details
87 * Note:
88 * 1. all parameters in nanosecond (ns)
89 * 2. a0cs{rd,wr}_set_hld are controlled by the same register bits
90 * in pxa27x and pxa3xx, initialize them to the same value or
91 * the larger one will be used
92 * 3. same to {rd,wr}_pulse_width
94 unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */
95 unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */
96 unsigned wr_pulse_width; /* L_PCLK_WR pulse width */
97 unsigned rd_pulse_width; /* L_FCLK_RD pulse width */
98 unsigned cmd_inh_time; /* Command Inhibit time between two writes */
99 unsigned op_hold_time; /* Output Hold time from L_FCLK_RD negation */
102 struct pxafb_mach_info {
103 struct pxafb_mode_info *modes;
104 unsigned int num_modes;
106 unsigned int lcd_conn;
108 u_int fixed_modes:1,
109 cmap_inverse:1,
110 cmap_static:1,
111 unused:29;
113 /* The following should be defined in LCCR0
114 * LCCR0_Act or LCCR0_Pas Active or Passive
115 * LCCR0_Sngl or LCCR0_Dual Single/Dual panel
116 * LCCR0_Mono or LCCR0_Color Mono/Color
117 * LCCR0_4PixMono or LCCR0_8PixMono (in mono single mode)
118 * LCCR0_DMADel(Tcpu) (optional) DMA request delay
120 * The following should not be defined in LCCR0:
121 * LCCR0_OUM, LCCR0_BM, LCCR0_QDM, LCCR0_DIS, LCCR0_EFM
122 * LCCR0_IUM, LCCR0_SFM, LCCR0_LDM, LCCR0_ENB
124 u_int lccr0;
125 /* The following should be defined in LCCR3
126 * LCCR3_OutEnH or LCCR3_OutEnL Output enable polarity
127 * LCCR3_PixRsEdg or LCCR3_PixFlEdg Pixel clock edge type
128 * LCCR3_Acb(X) AB Bias pin frequency
129 * LCCR3_DPC (optional) Double Pixel Clock mode (untested)
131 * The following should not be defined in LCCR3
132 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp
134 u_int lccr3;
135 /* The following should be defined in LCCR4
136 * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2
138 * All other bits in LCCR4 should be left alone.
140 u_int lccr4;
141 void (*pxafb_backlight_power)(int);
142 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
143 void (*smart_update)(struct fb_info *);
145 void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
146 void set_pxa_fb_parent(struct device *parent_dev);
147 unsigned long pxafb_get_hsync_time(struct device *dev);
149 extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int);
150 extern int pxafb_smart_flush(struct fb_info *info);