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