1
2
3
4
5
6
7
8
9
10
11
12
13#include <linux/fb.h>
14#include <mach/regs-lcd.h>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31#define LCD_CONN_TYPE(_x) ((_x) & 0x0f)
32#define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f)
33
34#define LCD_TYPE_MASK 0xf
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
43
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_8BPP ((8 << 4) | LCD_TYPE_COLOR_TFT)
50#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT)
51#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT)
52#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL)
53#define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL)
54#define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL)
55
56#define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10)
57#define LCD_BIAS_ACTIVE_HIGH (0 << 18)
58#define LCD_BIAS_ACTIVE_LOW (1 << 18)
59#define LCD_PCLK_EDGE_RISE (0 << 19)
60#define LCD_PCLK_EDGE_FALL (1 << 19)
61#define LCD_ALTERNATE_MAPPING (1 << 20)
62
63
64
65
66
67
68struct pxafb_mode_info {
69 u_long pixclock;
70
71 u_short xres;
72 u_short yres;
73
74 u_char bpp;
75 u_int cmap_greyscale:1,
76 depth:8,
77 transparency:1,
78 unused:22;
79
80
81 u_char hsync_len;
82 u_char left_margin;
83 u_char right_margin;
84
85 u_char vsync_len;
86 u_char upper_margin;
87 u_char lower_margin;
88 u_char sync;
89
90
91
92
93
94
95
96
97
98
99
100
101
102 unsigned a0csrd_set_hld;
103 unsigned a0cswr_set_hld;
104 unsigned wr_pulse_width;
105 unsigned rd_pulse_width;
106 unsigned cmd_inh_time;
107 unsigned op_hold_time;
108};
109
110struct pxafb_mach_info {
111 struct pxafb_mode_info *modes;
112 unsigned int num_modes;
113
114 unsigned int lcd_conn;
115 unsigned long video_mem_size;
116
117 u_int fixed_modes:1,
118 cmap_inverse:1,
119 cmap_static:1,
120 acceleration_enabled:1,
121 unused:28;
122
123
124
125
126
127
128
129
130
131
132
133
134 u_int lccr0;
135
136
137
138
139
140
141
142
143
144 u_int lccr3;
145
146
147
148
149
150 u_int lccr4;
151 void (*pxafb_backlight_power)(int);
152 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
153 void (*smart_update)(struct fb_info *);
154};
155
156void pxa_set_fb_info(struct device *, struct pxafb_mach_info *);
157unsigned long pxafb_get_hsync_time(struct device *dev);
158
159#ifdef CONFIG_FB_PXA_SMARTPANEL
160extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int);
161extern int pxafb_smart_flush(struct fb_info *info);
162#else
163static inline int pxafb_smart_queue(struct fb_info *info,
164 uint16_t *cmds, int n)
165{
166 return 0;
167}
168
169static inline int pxafb_smart_flush(struct fb_info *info)
170{
171 return 0;
172}
173#endif
174