summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch1316
1 files changed, 1316 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
new file mode 100644
index 0000000000..04ac6a9ce8
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
@@ -0,0 +1,1316 @@
1From 02243f13eec816e11d16676a131bc04b8a0666ab Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
3Date: Wed, 11 Feb 2009 16:33:02 +0200
4Subject: [PATCH] OMAPFB: move omapfb.h to include/linux/
5
6This is needed so that omapfb.h is automatically exported to user space.
7
8omapfb.h should be cleaned up later. Some stuff can probably be moved
9to omapfb's private include file.
10
11Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
12---
13 arch/arm/mach-omap1/board-nokia770.c | 2 +-
14 arch/arm/mach-omap2/board-n800.c | 2 +-
15 arch/arm/mach-omap2/io.c | 2 +-
16 arch/arm/plat-omap/fb.c | 2 +-
17 arch/arm/plat-omap/include/mach/omapfb.h | 398 ------------------------------
18 drivers/video/omap/blizzard.c | 2 +-
19 drivers/video/omap/dispc.c | 2 +-
20 drivers/video/omap/hwa742.c | 2 +-
21 drivers/video/omap/lcd_2430sdp.c | 2 +-
22 drivers/video/omap/lcd_ams_delta.c | 2 +-
23 drivers/video/omap/lcd_apollon.c | 2 +-
24 drivers/video/omap/lcd_h3.c | 2 +-
25 drivers/video/omap/lcd_h4.c | 3 +-
26 drivers/video/omap/lcd_inn1510.c | 2 +-
27 drivers/video/omap/lcd_inn1610.c | 2 +-
28 drivers/video/omap/lcd_ldp.c | 2 +-
29 drivers/video/omap/lcd_mipid.c | 2 +-
30 drivers/video/omap/lcd_omap2evm.c | 2 +-
31 drivers/video/omap/lcd_omap3beagle.c | 2 +-
32 drivers/video/omap/lcd_omap3evm.c | 2 +-
33 drivers/video/omap/lcd_osk.c | 2 +-
34 drivers/video/omap/lcd_overo.c | 2 +-
35 drivers/video/omap/lcd_p2.c | 2 +-
36 drivers/video/omap/lcd_palmte.c | 2 +-
37 drivers/video/omap/lcd_palmtt.c | 2 +-
38 drivers/video/omap/lcd_palmz71.c | 3 +-
39 drivers/video/omap/lcdc.c | 2 +-
40 drivers/video/omap/omapfb_main.c | 2 +-
41 drivers/video/omap/rfbi.c | 3 +-
42 drivers/video/omap/sossi.c | 2 +-
43 include/linux/omapfb.h | 398 ++++++++++++++++++++++++++++++
44 31 files changed, 427 insertions(+), 430 deletions(-)
45 delete mode 100644 arch/arm/plat-omap/include/mach/omapfb.h
46 create mode 100644 include/linux/omapfb.h
47
48diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
49index 8780ca6..ca4680a 100644
50--- a/arch/arm/mach-omap1/board-nokia770.c
51+++ b/arch/arm/mach-omap1/board-nokia770.c
52@@ -18,6 +18,7 @@
53 #include <linux/spi/spi.h>
54 #include <linux/spi/ads7846.h>
55 #include <linux/workqueue.h>
56+#include <linux/omapfb.h>
57 #include <linux/delay.h>
58
59 #include <mach/hardware.h>
60@@ -32,7 +33,6 @@
61 #include <mach/keypad.h>
62 #include <mach/common.h>
63 #include <mach/dsp_common.h>
64-#include <mach/omapfb.h>
65 #include <mach/lcd_mipid.h>
66 #include <mach/mmc.h>
67 #include <mach/usb.h>
68diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
69index cb32b61..f6f6571 100644
70--- a/arch/arm/mach-omap2/board-n800.c
71+++ b/arch/arm/mach-omap2/board-n800.c
72@@ -27,6 +27,7 @@
73 #include <linux/i2c/lm8323.h>
74 #include <linux/i2c/menelaus.h>
75 #include <linux/i2c/lp5521.h>
76+#include <linux/omapfb.h>
77 #include <mach/hardware.h>
78 #include <asm/mach-types.h>
79 #include <asm/mach/arch.h>
80@@ -39,7 +40,6 @@
81 #include <mach/lcd_mipid.h>
82 #include <mach/clock.h>
83 #include <mach/gpio-switch.h>
84-#include <mach/omapfb.h>
85 #include <mach/blizzard.h>
86
87 #include <../drivers/cbus/tahvo.h>
88diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
89index adbe21f..a04e3ee 100644
90--- a/arch/arm/mach-omap2/io.c
91+++ b/arch/arm/mach-omap2/io.c
92@@ -18,13 +18,13 @@
93 #include <linux/module.h>
94 #include <linux/kernel.h>
95 #include <linux/init.h>
96+#include <linux/omapfb.h>
97 #include <linux/io.h>
98
99 #include <asm/tlb.h>
100
101 #include <asm/mach/map.h>
102 #include <mach/mux.h>
103-#include <mach/omapfb.h>
104 #include <mach/sram.h>
105 #include <mach/sdrc.h>
106 #include <mach/gpmc.h>
107diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
108index 3746222..40615a6 100644
109--- a/arch/arm/plat-omap/fb.c
110+++ b/arch/arm/plat-omap/fb.c
111@@ -28,13 +28,13 @@
112 #include <linux/platform_device.h>
113 #include <linux/bootmem.h>
114 #include <linux/io.h>
115+#include <linux/omapfb.h>
116
117 #include <mach/hardware.h>
118 #include <asm/mach/map.h>
119
120 #include <mach/board.h>
121 #include <mach/sram.h>
122-#include <mach/omapfb.h>
123
124 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
125
126diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/mach/omapfb.h
127deleted file mode 100644
128index b226bdf..0000000
129--- a/arch/arm/plat-omap/include/mach/omapfb.h
130+++ /dev/null
131@@ -1,398 +0,0 @@
132-/*
133- * File: arch/arm/plat-omap/include/mach/omapfb.h
134- *
135- * Framebuffer driver for TI OMAP boards
136- *
137- * Copyright (C) 2004 Nokia Corporation
138- * Author: Imre Deak <imre.deak@nokia.com>
139- *
140- * This program is free software; you can redistribute it and/or modify it
141- * under the terms of the GNU General Public License as published by the
142- * Free Software Foundation; either version 2 of the License, or (at your
143- * option) any later version.
144- *
145- * This program is distributed in the hope that it will be useful, but
146- * WITHOUT ANY WARRANTY; without even the implied warranty of
147- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
148- * General Public License for more details.
149- *
150- * You should have received a copy of the GNU General Public License along
151- * with this program; if not, write to the Free Software Foundation, Inc.,
152- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
153- */
154-
155-#ifndef __OMAPFB_H
156-#define __OMAPFB_H
157-
158-#include <asm/ioctl.h>
159-#include <asm/types.h>
160-
161-/* IOCTL commands. */
162-
163-#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
164-#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
165-#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
166-#define OMAP_IO(num) _IO('O', num)
167-
168-#define OMAPFB_MIRROR OMAP_IOW(31, int)
169-#define OMAPFB_SYNC_GFX OMAP_IO(37)
170-#define OMAPFB_VSYNC OMAP_IO(38)
171-#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
172-#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
173-#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
174-#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
175-#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
176-#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
177-#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
178-#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
179-#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
180-#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
181-#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
182-#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
183-#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
184-
185-#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
186-#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
187-#define OMAPFB_CAPS_PANEL_MASK 0xff000000
188-
189-#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
190-#define OMAPFB_CAPS_TEARSYNC 0x00002000
191-#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
192-#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
193-#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
194-#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
195-#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
196-#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
197-#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
198-
199-/* Values from DSP must map to lower 16-bits */
200-#define OMAPFB_FORMAT_MASK 0x00ff
201-#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
202-#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
203-#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
204-#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
205-#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
206-
207-#define OMAPFB_EVENT_READY 1
208-#define OMAPFB_EVENT_DISABLED 2
209-
210-#define OMAPFB_MEMTYPE_SDRAM 0
211-#define OMAPFB_MEMTYPE_SRAM 1
212-#define OMAPFB_MEMTYPE_MAX 1
213-
214-enum omapfb_color_format {
215- OMAPFB_COLOR_RGB565 = 0,
216- OMAPFB_COLOR_YUV422,
217- OMAPFB_COLOR_YUV420,
218- OMAPFB_COLOR_CLUT_8BPP,
219- OMAPFB_COLOR_CLUT_4BPP,
220- OMAPFB_COLOR_CLUT_2BPP,
221- OMAPFB_COLOR_CLUT_1BPP,
222- OMAPFB_COLOR_RGB444,
223- OMAPFB_COLOR_YUY422,
224-};
225-
226-struct omapfb_update_window {
227- __u32 x, y;
228- __u32 width, height;
229- __u32 format;
230- __u32 out_x, out_y;
231- __u32 out_width, out_height;
232- __u32 reserved[8];
233-};
234-
235-struct omapfb_update_window_old {
236- __u32 x, y;
237- __u32 width, height;
238- __u32 format;
239-};
240-
241-enum omapfb_plane {
242- OMAPFB_PLANE_GFX = 0,
243- OMAPFB_PLANE_VID1,
244- OMAPFB_PLANE_VID2,
245-};
246-
247-enum omapfb_channel_out {
248- OMAPFB_CHANNEL_OUT_LCD = 0,
249- OMAPFB_CHANNEL_OUT_DIGIT,
250-};
251-
252-struct omapfb_plane_info {
253- __u32 pos_x;
254- __u32 pos_y;
255- __u8 enabled;
256- __u8 channel_out;
257- __u8 mirror;
258- __u8 reserved1;
259- __u32 out_width;
260- __u32 out_height;
261- __u32 reserved2[12];
262-};
263-
264-struct omapfb_mem_info {
265- __u32 size;
266- __u8 type;
267- __u8 reserved[3];
268-};
269-
270-struct omapfb_caps {
271- __u32 ctrl;
272- __u32 plane_color;
273- __u32 wnd_color;
274-};
275-
276-enum omapfb_color_key_type {
277- OMAPFB_COLOR_KEY_DISABLED = 0,
278- OMAPFB_COLOR_KEY_GFX_DST,
279- OMAPFB_COLOR_KEY_VID_SRC,
280-};
281-
282-struct omapfb_color_key {
283- __u8 channel_out;
284- __u32 background;
285- __u32 trans_key;
286- __u8 key_type;
287-};
288-
289-enum omapfb_update_mode {
290- OMAPFB_UPDATE_DISABLED = 0,
291- OMAPFB_AUTO_UPDATE,
292- OMAPFB_MANUAL_UPDATE
293-};
294-
295-#ifdef __KERNEL__
296-
297-#include <linux/completion.h>
298-#include <linux/interrupt.h>
299-#include <linux/fb.h>
300-#include <linux/mutex.h>
301-
302-#include <mach/board.h>
303-
304-#define OMAP_LCDC_INV_VSYNC 0x0001
305-#define OMAP_LCDC_INV_HSYNC 0x0002
306-#define OMAP_LCDC_INV_PIX_CLOCK 0x0004
307-#define OMAP_LCDC_INV_OUTPUT_EN 0x0008
308-#define OMAP_LCDC_HSVS_RISING_EDGE 0x0010
309-#define OMAP_LCDC_HSVS_OPPOSITE 0x0020
310-
311-#define OMAP_LCDC_SIGNAL_MASK 0x003f
312-
313-#define OMAP_LCDC_PANEL_TFT 0x0100
314-
315-#define OMAPFB_PLANE_XRES_MIN 8
316-#define OMAPFB_PLANE_YRES_MIN 8
317-
318-#ifdef CONFIG_ARCH_OMAP1
319-#define OMAPFB_PLANE_NUM 1
320-#else
321-#define OMAPFB_PLANE_NUM 3
322-#endif
323-
324-struct omapfb_device;
325-
326-struct lcd_panel {
327- const char *name;
328- int config; /* TFT/STN, signal inversion */
329- int bpp; /* Pixel format in fb mem */
330- int data_lines; /* Lines on LCD HW interface */
331-
332- int x_res, y_res;
333- int pixel_clock; /* In kHz */
334- int hsw; /* Horizontal synchronization
335- pulse width */
336- int hfp; /* Horizontal front porch */
337- int hbp; /* Horizontal back porch */
338- int vsw; /* Vertical synchronization
339- pulse width */
340- int vfp; /* Vertical front porch */
341- int vbp; /* Vertical back porch */
342- int acb; /* ac-bias pin frequency */
343- int pcd; /* pixel clock divider.
344- Obsolete use pixel_clock instead */
345-
346- int (*init) (struct lcd_panel *panel,
347- struct omapfb_device *fbdev);
348- void (*cleanup) (struct lcd_panel *panel);
349- int (*enable) (struct lcd_panel *panel);
350- void (*disable) (struct lcd_panel *panel);
351- unsigned long (*get_caps) (struct lcd_panel *panel);
352- int (*set_bklight_level)(struct lcd_panel *panel,
353- unsigned int level);
354- unsigned int (*get_bklight_level)(struct lcd_panel *panel);
355- unsigned int (*get_bklight_max) (struct lcd_panel *panel);
356- int (*run_test) (struct lcd_panel *panel, int test_num);
357-};
358-
359-struct extif_timings {
360- int cs_on_time;
361- int cs_off_time;
362- int we_on_time;
363- int we_off_time;
364- int re_on_time;
365- int re_off_time;
366- int we_cycle_time;
367- int re_cycle_time;
368- int cs_pulse_width;
369- int access_time;
370-
371- int clk_div;
372-
373- u32 tim[5]; /* set by extif->convert_timings */
374-
375- int converted;
376-};
377-
378-struct lcd_ctrl_extif {
379- int (*init) (struct omapfb_device *fbdev);
380- void (*cleanup) (void);
381- void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
382- unsigned long (*get_max_tx_rate)(void);
383- int (*convert_timings) (struct extif_timings *timings);
384- void (*set_timings) (const struct extif_timings *timings);
385- void (*set_bits_per_cycle)(int bpc);
386- void (*write_command) (const void *buf, unsigned int len);
387- void (*read_data) (void *buf, unsigned int len);
388- void (*write_data) (const void *buf, unsigned int len);
389- void (*transfer_area) (int width, int height,
390- void (callback)(void * data), void *data);
391- int (*setup_tearsync) (unsigned pin_cnt,
392- unsigned hs_pulse_time, unsigned vs_pulse_time,
393- int hs_pol_inv, int vs_pol_inv, int div);
394- int (*enable_tearsync) (int enable, unsigned line);
395-
396- unsigned long max_transmit_size;
397-};
398-
399-struct omapfb_notifier_block {
400- struct notifier_block nb;
401- void *data;
402- int plane_idx;
403-};
404-
405-typedef int (*omapfb_notifier_callback_t)(struct notifier_block *,
406- unsigned long event,
407- void *fbi);
408-
409-struct omapfb_mem_region {
410- u32 paddr;
411- void __iomem *vaddr;
412- unsigned long size;
413- u8 type; /* OMAPFB_PLANE_MEM_* */
414- unsigned alloc:1; /* allocated by the driver */
415- unsigned map:1; /* kernel mapped by the driver */
416-};
417-
418-struct omapfb_mem_desc {
419- int region_cnt;
420- struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
421-};
422-
423-struct lcd_ctrl {
424- const char *name;
425- void *data;
426-
427- int (*init) (struct omapfb_device *fbdev,
428- int ext_mode,
429- struct omapfb_mem_desc *req_md);
430- void (*cleanup) (void);
431- void (*bind_client) (struct omapfb_notifier_block *nb);
432- void (*get_caps) (int plane, struct omapfb_caps *caps);
433- int (*set_update_mode)(enum omapfb_update_mode mode);
434- enum omapfb_update_mode (*get_update_mode)(void);
435- int (*setup_plane) (int plane, int channel_out,
436- unsigned long offset,
437- int screen_width,
438- int pos_x, int pos_y, int width,
439- int height, int color_mode);
440- int (*set_rotate) (int angle);
441- int (*setup_mem) (int plane, size_t size,
442- int mem_type, unsigned long *paddr);
443- int (*mmap) (struct fb_info *info,
444- struct vm_area_struct *vma);
445- int (*set_scale) (int plane,
446- int orig_width, int orig_height,
447- int out_width, int out_height);
448- int (*enable_plane) (int plane, int enable);
449- int (*update_window) (struct fb_info *fbi,
450- struct omapfb_update_window *win,
451- void (*callback)(void *),
452- void *callback_data);
453- void (*sync) (void);
454- void (*suspend) (void);
455- void (*resume) (void);
456- int (*run_test) (int test_num);
457- int (*setcolreg) (u_int regno, u16 red, u16 green,
458- u16 blue, u16 transp,
459- int update_hw_mem);
460- int (*set_color_key) (struct omapfb_color_key *ck);
461- int (*get_color_key) (struct omapfb_color_key *ck);
462-};
463-
464-enum omapfb_state {
465- OMAPFB_DISABLED = 0,
466- OMAPFB_SUSPENDED= 99,
467- OMAPFB_ACTIVE = 100
468-};
469-
470-struct omapfb_plane_struct {
471- int idx;
472- struct omapfb_plane_info info;
473- enum omapfb_color_format color_mode;
474- struct omapfb_device *fbdev;
475-};
476-
477-struct omapfb_device {
478- int state;
479- int ext_lcdc; /* Using external
480- LCD controller */
481- struct mutex rqueue_mutex;
482-
483- int palette_size;
484- u32 pseudo_palette[17];
485-
486- struct lcd_panel *panel; /* LCD panel */
487- const struct lcd_ctrl *ctrl; /* LCD controller */
488- const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
489- struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
490- interface */
491- struct device *dev;
492- struct fb_var_screeninfo new_var; /* for mode changes */
493-
494- struct omapfb_mem_desc mem_desc;
495- struct fb_info *fb_info[OMAPFB_PLANE_NUM];
496-};
497-
498-struct omapfb_platform_data {
499- struct omap_lcd_config lcd;
500- struct omapfb_mem_desc mem_desc;
501- void *ctrl_platform_data;
502-};
503-
504-#ifdef CONFIG_ARCH_OMAP1
505-extern struct lcd_ctrl omap1_lcd_ctrl;
506-#else
507-extern struct lcd_ctrl omap2_disp_ctrl;
508-#endif
509-
510-extern void omapfb_reserve_sdram(void);
511-extern void omapfb_register_panel(struct lcd_panel *panel);
512-extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
513-extern void omapfb_notify_clients(struct omapfb_device *fbdev,
514- unsigned long event);
515-extern int omapfb_register_client(struct omapfb_notifier_block *nb,
516- omapfb_notifier_callback_t callback,
517- void *callback_data);
518-extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
519-extern int omapfb_update_window_async(struct fb_info *fbi,
520- struct omapfb_update_window *win,
521- void (*callback)(void *),
522- void *callback_data);
523-
524-/* in arch/arm/plat-omap/fb.c */
525-extern void omapfb_set_ctrl_platform_data(void *pdata);
526-
527-#endif /* __KERNEL__ */
528-
529-#endif /* __OMAPFB_H */
530diff --git a/drivers/video/omap/blizzard.c b/drivers/video/omap/blizzard.c
531index f60a233..8121c09 100644
532--- a/drivers/video/omap/blizzard.c
533+++ b/drivers/video/omap/blizzard.c
534@@ -25,9 +25,9 @@
535 #include <linux/fb.h>
536 #include <linux/delay.h>
537 #include <linux/clk.h>
538+#include <linux/omapfb.h>
539
540 #include <mach/dma.h>
541-#include <mach/omapfb.h>
542 #include <mach/blizzard.h>
543
544 #include "dispc.h"
545diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
546index c140c21..1915af5 100644
547--- a/drivers/video/omap/dispc.c
548+++ b/drivers/video/omap/dispc.c
549@@ -24,9 +24,9 @@
550 #include <linux/vmalloc.h>
551 #include <linux/clk.h>
552 #include <linux/io.h>
553+#include <linux/omapfb.h>
554
555 #include <mach/sram.h>
556-#include <mach/omapfb.h>
557 #include <mach/board.h>
558
559 #include "dispc.h"
560diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
561index f24df0b..9b4c506 100644
562--- a/drivers/video/omap/hwa742.c
563+++ b/drivers/video/omap/hwa742.c
564@@ -25,9 +25,9 @@
565 #include <linux/fb.h>
566 #include <linux/delay.h>
567 #include <linux/clk.h>
568+#include <linux/omapfb.h>
569
570 #include <mach/dma.h>
571-#include <mach/omapfb.h>
572 #include <mach/hwa742.h>
573
574 #define HWA742_REV_CODE_REG 0x0
575diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c
576index a22b452..1252cc3 100644
577--- a/drivers/video/omap/lcd_2430sdp.c
578+++ b/drivers/video/omap/lcd_2430sdp.c
579@@ -26,9 +26,9 @@
580 #include <linux/delay.h>
581 #include <linux/gpio.h>
582 #include <linux/i2c/twl4030.h>
583+#include <linux/omapfb.h>
584
585 #include <mach/mux.h>
586-#include <mach/omapfb.h>
587 #include <asm/mach-types.h>
588
589 #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
590diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
591index 3fd5342..4d54725 100644
592--- a/drivers/video/omap/lcd_ams_delta.c
593+++ b/drivers/video/omap/lcd_ams_delta.c
594@@ -24,13 +24,13 @@
595
596 #include <linux/module.h>
597 #include <linux/platform_device.h>
598+#include <linux/omapfb.h>
599
600 #include <asm/delay.h>
601 #include <asm/io.h>
602
603 #include <mach/board-ams-delta.h>
604 #include <mach/hardware.h>
605-#include <mach/omapfb.h>
606
607 #define AMS_DELTA_DEFAULT_CONTRAST 112
608
609diff --git a/drivers/video/omap/lcd_apollon.c b/drivers/video/omap/lcd_apollon.c
610index beae5d9..e3b2224 100644
611--- a/drivers/video/omap/lcd_apollon.c
612+++ b/drivers/video/omap/lcd_apollon.c
613@@ -23,10 +23,10 @@
614
615 #include <linux/module.h>
616 #include <linux/platform_device.h>
617+#include <linux/omapfb.h>
618
619 #include <mach/gpio.h>
620 #include <mach/mux.h>
621-#include <mach/omapfb.h>
622
623 /* #define USE_35INCH_LCD 1 */
624
625diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
626index 2486237..f7264ea 100644
627--- a/drivers/video/omap/lcd_h3.c
628+++ b/drivers/video/omap/lcd_h3.c
629@@ -22,9 +22,9 @@
630 #include <linux/module.h>
631 #include <linux/platform_device.h>
632 #include <linux/i2c/tps65010.h>
633+#include <linux/omapfb.h>
634
635 #include <mach/gpio.h>
636-#include <mach/omapfb.h>
637
638 #define MODULE_NAME "omapfb-lcd_h3"
639
640diff --git a/drivers/video/omap/lcd_h4.c b/drivers/video/omap/lcd_h4.c
641index 6ff5643..d72df0c 100644
642--- a/drivers/video/omap/lcd_h4.c
643+++ b/drivers/video/omap/lcd_h4.c
644@@ -21,8 +21,7 @@
645
646 #include <linux/module.h>
647 #include <linux/platform_device.h>
648-
649-#include <mach/omapfb.h>
650+#include <linux/omapfb.h>
651
652 static int h4_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
653 {
654diff --git a/drivers/video/omap/lcd_inn1510.c b/drivers/video/omap/lcd_inn1510.c
655index 6953ed4..f6e05d7 100644
656--- a/drivers/video/omap/lcd_inn1510.c
657+++ b/drivers/video/omap/lcd_inn1510.c
658@@ -22,9 +22,9 @@
659 #include <linux/module.h>
660 #include <linux/platform_device.h>
661 #include <linux/io.h>
662+#include <linux/omapfb.h>
663
664 #include <mach/fpga.h>
665-#include <mach/omapfb.h>
666
667 static int innovator1510_panel_init(struct lcd_panel *panel,
668 struct omapfb_device *fbdev)
669diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
670index 4c4f7ee..c599e41 100644
671--- a/drivers/video/omap/lcd_inn1610.c
672+++ b/drivers/video/omap/lcd_inn1610.c
673@@ -21,9 +21,9 @@
674
675 #include <linux/module.h>
676 #include <linux/platform_device.h>
677+#include <linux/omapfb.h>
678
679 #include <mach/gpio.h>
680-#include <mach/omapfb.h>
681
682 #define MODULE_NAME "omapfb-lcd_h3"
683
684diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c
685index 8925230..1c25186 100644
686--- a/drivers/video/omap/lcd_ldp.c
687+++ b/drivers/video/omap/lcd_ldp.c
688@@ -25,10 +25,10 @@
689 #include <linux/platform_device.h>
690 #include <linux/delay.h>
691 #include <linux/i2c/twl4030.h>
692+#include <linux/omapfb.h>
693
694 #include <mach/gpio.h>
695 #include <mach/mux.h>
696-#include <mach/omapfb.h>
697 #include <asm/mach-types.h>
698
699 #define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
700diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
701index 1895997..4b28005 100644
702--- a/drivers/video/omap/lcd_mipid.c
703+++ b/drivers/video/omap/lcd_mipid.c
704@@ -22,8 +22,8 @@
705 #include <linux/delay.h>
706 #include <linux/workqueue.h>
707 #include <linux/spi/spi.h>
708+#include <linux/omapfb.h>
709
710-#include <mach/omapfb.h>
711 #include <mach/lcd_mipid.h>
712
713 #include "../../cbus/tahvo.h"
714diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c
715index 2fc46c2..1908a2b 100644
716--- a/drivers/video/omap/lcd_omap2evm.c
717+++ b/drivers/video/omap/lcd_omap2evm.c
718@@ -25,9 +25,9 @@
719 #include <linux/platform_device.h>
720 #include <linux/gpio.h>
721 #include <linux/i2c/twl4030.h>
722+#include <linux/omapfb.h>
723
724 #include <mach/mux.h>
725-#include <mach/omapfb.h>
726 #include <asm/mach-types.h>
727
728 #define LCD_PANEL_ENABLE_GPIO 154
729diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
730index eae43e4..6be117e 100644
731--- a/drivers/video/omap/lcd_omap3beagle.c
732+++ b/drivers/video/omap/lcd_omap3beagle.c
733@@ -24,9 +24,9 @@
734 #include <linux/platform_device.h>
735 #include <linux/gpio.h>
736 #include <linux/i2c/twl4030.h>
737+#include <linux/omapfb.h>
738
739 #include <mach/mux.h>
740-#include <mach/omapfb.h>
741 #include <asm/mach-types.h>
742
743 #define LCD_PANEL_ENABLE_GPIO 170
744diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c
745index 1c3d814..10ba48c 100644
746--- a/drivers/video/omap/lcd_omap3evm.c
747+++ b/drivers/video/omap/lcd_omap3evm.c
748@@ -24,9 +24,9 @@
749 #include <linux/platform_device.h>
750 #include <linux/gpio.h>
751 #include <linux/i2c/twl4030.h>
752+#include <linux/omapfb.h>
753
754 #include <mach/mux.h>
755-#include <mach/omapfb.h>
756 #include <asm/mach-types.h>
757
758 #define LCD_PANEL_ENABLE_GPIO 153
759diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
760index 379c96d..d6b193e 100644
761--- a/drivers/video/omap/lcd_osk.c
762+++ b/drivers/video/omap/lcd_osk.c
763@@ -22,10 +22,10 @@
764
765 #include <linux/module.h>
766 #include <linux/platform_device.h>
767+#include <linux/omapfb.h>
768
769 #include <mach/gpio.h>
770 #include <mach/mux.h>
771-#include <mach/omapfb.h>
772
773 static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
774 {
775diff --git a/drivers/video/omap/lcd_overo.c b/drivers/video/omap/lcd_overo.c
776index 2bc5c92..40c2026 100644
777--- a/drivers/video/omap/lcd_overo.c
778+++ b/drivers/video/omap/lcd_overo.c
779@@ -22,10 +22,10 @@
780 #include <linux/module.h>
781 #include <linux/platform_device.h>
782 #include <linux/i2c/twl4030.h>
783+#include <linux/omapfb.h>
784
785 #include <mach/gpio.h>
786 #include <mach/mux.h>
787-#include <mach/omapfb.h>
788 #include <asm/mach-types.h>
789
790 #define LCD_ENABLE 144
791diff --git a/drivers/video/omap/lcd_p2.c b/drivers/video/omap/lcd_p2.c
792index dd40fd7..bc5abef 100644
793--- a/drivers/video/omap/lcd_p2.c
794+++ b/drivers/video/omap/lcd_p2.c
795@@ -24,10 +24,10 @@
796 #include <linux/module.h>
797 #include <linux/delay.h>
798 #include <linux/platform_device.h>
799+#include <linux/omapfb.h>
800
801 #include <mach/mux.h>
802 #include <mach/gpio.h>
803-#include <mach/omapfb.h>
804
805 /*
806 * File: epson-md-tft.h
807diff --git a/drivers/video/omap/lcd_palmte.c b/drivers/video/omap/lcd_palmte.c
808index 2183173..dcb456c 100644
809--- a/drivers/video/omap/lcd_palmte.c
810+++ b/drivers/video/omap/lcd_palmte.c
811@@ -22,9 +22,9 @@
812 #include <linux/module.h>
813 #include <linux/platform_device.h>
814 #include <linux/io.h>
815+#include <linux/omapfb.h>
816
817 #include <mach/fpga.h>
818-#include <mach/omapfb.h>
819
820 static int palmte_panel_init(struct lcd_panel *panel,
821 struct omapfb_device *fbdev)
822diff --git a/drivers/video/omap/lcd_palmtt.c b/drivers/video/omap/lcd_palmtt.c
823index 57b0f6c..e8adab8 100644
824--- a/drivers/video/omap/lcd_palmtt.c
825+++ b/drivers/video/omap/lcd_palmtt.c
826@@ -28,9 +28,9 @@ GPIO13 - screen blanking
827 #include <linux/platform_device.h>
828 #include <linux/module.h>
829 #include <linux/io.h>
830+#include <linux/omapfb.h>
831
832 #include <mach/gpio.h>
833-#include <mach/omapfb.h>
834
835 static int palmtt_panel_init(struct lcd_panel *panel,
836 struct omapfb_device *fbdev)
837diff --git a/drivers/video/omap/lcd_palmz71.c b/drivers/video/omap/lcd_palmz71.c
838index d33d78b..d5b3f82 100644
839--- a/drivers/video/omap/lcd_palmz71.c
840+++ b/drivers/video/omap/lcd_palmz71.c
841@@ -23,8 +23,7 @@
842 #include <linux/module.h>
843 #include <linux/platform_device.h>
844 #include <linux/io.h>
845-
846-#include <mach/omapfb.h>
847+#include <linux/omapfb.h>
848
849 static int palmz71_panel_init(struct lcd_panel *panel,
850 struct omapfb_device *fbdev)
851diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
852index ab39492..633e33c 100644
853--- a/drivers/video/omap/lcdc.c
854+++ b/drivers/video/omap/lcdc.c
855@@ -28,9 +28,9 @@
856 #include <linux/dma-mapping.h>
857 #include <linux/vmalloc.h>
858 #include <linux/clk.h>
859+#include <linux/omapfb.h>
860
861 #include <mach/dma.h>
862-#include <mach/omapfb.h>
863
864 #include <asm/mach-types.h>
865
866diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
867index 3bb4247..c6306af 100644
868--- a/drivers/video/omap/omapfb_main.c
869+++ b/drivers/video/omap/omapfb_main.c
870@@ -27,9 +27,9 @@
871 #include <linux/platform_device.h>
872 #include <linux/mm.h>
873 #include <linux/uaccess.h>
874+#include <linux/omapfb.h>
875
876 #include <mach/dma.h>
877-#include <mach/omapfb.h>
878
879 #include "lcdc.h"
880 #include "dispc.h"
881diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c
882index 29fa368..118cfa9 100644
883--- a/drivers/video/omap/rfbi.c
884+++ b/drivers/video/omap/rfbi.c
885@@ -26,8 +26,7 @@
886 #include <linux/interrupt.h>
887 #include <linux/clk.h>
888 #include <linux/io.h>
889-
890-#include <mach/omapfb.h>
891+#include <linux/omapfb.h>
892
893 #include "dispc.h"
894
895diff --git a/drivers/video/omap/sossi.c b/drivers/video/omap/sossi.c
896index cc697cc..ff9dd71 100644
897--- a/drivers/video/omap/sossi.c
898+++ b/drivers/video/omap/sossi.c
899@@ -23,9 +23,9 @@
900 #include <linux/clk.h>
901 #include <linux/irq.h>
902 #include <linux/io.h>
903+#include <linux/omapfb.h>
904
905 #include <mach/dma.h>
906-#include <mach/omapfb.h>
907
908 #include "lcdc.h"
909
910diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
911new file mode 100644
912index 0000000..b226bdf
913--- /dev/null
914+++ b/include/linux/omapfb.h
915@@ -0,0 +1,398 @@
916+/*
917+ * File: arch/arm/plat-omap/include/mach/omapfb.h
918+ *
919+ * Framebuffer driver for TI OMAP boards
920+ *
921+ * Copyright (C) 2004 Nokia Corporation
922+ * Author: Imre Deak <imre.deak@nokia.com>
923+ *
924+ * This program is free software; you can redistribute it and/or modify it
925+ * under the terms of the GNU General Public License as published by the
926+ * Free Software Foundation; either version 2 of the License, or (at your
927+ * option) any later version.
928+ *
929+ * This program is distributed in the hope that it will be useful, but
930+ * WITHOUT ANY WARRANTY; without even the implied warranty of
931+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
932+ * General Public License for more details.
933+ *
934+ * You should have received a copy of the GNU General Public License along
935+ * with this program; if not, write to the Free Software Foundation, Inc.,
936+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
937+ */
938+
939+#ifndef __OMAPFB_H
940+#define __OMAPFB_H
941+
942+#include <asm/ioctl.h>
943+#include <asm/types.h>
944+
945+/* IOCTL commands. */
946+
947+#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
948+#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
949+#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
950+#define OMAP_IO(num) _IO('O', num)
951+
952+#define OMAPFB_MIRROR OMAP_IOW(31, int)
953+#define OMAPFB_SYNC_GFX OMAP_IO(37)
954+#define OMAPFB_VSYNC OMAP_IO(38)
955+#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
956+#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
957+#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
958+#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
959+#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
960+#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
961+#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
962+#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
963+#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
964+#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
965+#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
966+#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
967+#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
968+
969+#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
970+#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
971+#define OMAPFB_CAPS_PANEL_MASK 0xff000000
972+
973+#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
974+#define OMAPFB_CAPS_TEARSYNC 0x00002000
975+#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
976+#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
977+#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
978+#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
979+#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
980+#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
981+#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
982+
983+/* Values from DSP must map to lower 16-bits */
984+#define OMAPFB_FORMAT_MASK 0x00ff
985+#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
986+#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
987+#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
988+#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
989+#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
990+
991+#define OMAPFB_EVENT_READY 1
992+#define OMAPFB_EVENT_DISABLED 2
993+
994+#define OMAPFB_MEMTYPE_SDRAM 0
995+#define OMAPFB_MEMTYPE_SRAM 1
996+#define OMAPFB_MEMTYPE_MAX 1
997+
998+enum omapfb_color_format {
999+ OMAPFB_COLOR_RGB565 = 0,
1000+ OMAPFB_COLOR_YUV422,
1001+ OMAPFB_COLOR_YUV420,
1002+ OMAPFB_COLOR_CLUT_8BPP,
1003+ OMAPFB_COLOR_CLUT_4BPP,
1004+ OMAPFB_COLOR_CLUT_2BPP,
1005+ OMAPFB_COLOR_CLUT_1BPP,
1006+ OMAPFB_COLOR_RGB444,
1007+ OMAPFB_COLOR_YUY422,
1008+};
1009+
1010+struct omapfb_update_window {
1011+ __u32 x, y;
1012+ __u32 width, height;
1013+ __u32 format;
1014+ __u32 out_x, out_y;
1015+ __u32 out_width, out_height;
1016+ __u32 reserved[8];
1017+};
1018+
1019+struct omapfb_update_window_old {
1020+ __u32 x, y;
1021+ __u32 width, height;
1022+ __u32 format;
1023+};
1024+
1025+enum omapfb_plane {
1026+ OMAPFB_PLANE_GFX = 0,
1027+ OMAPFB_PLANE_VID1,
1028+ OMAPFB_PLANE_VID2,
1029+};
1030+
1031+enum omapfb_channel_out {
1032+ OMAPFB_CHANNEL_OUT_LCD = 0,
1033+ OMAPFB_CHANNEL_OUT_DIGIT,
1034+};
1035+
1036+struct omapfb_plane_info {
1037+ __u32 pos_x;
1038+ __u32 pos_y;
1039+ __u8 enabled;
1040+ __u8 channel_out;
1041+ __u8 mirror;
1042+ __u8 reserved1;
1043+ __u32 out_width;
1044+ __u32 out_height;
1045+ __u32 reserved2[12];
1046+};
1047+
1048+struct omapfb_mem_info {
1049+ __u32 size;
1050+ __u8 type;
1051+ __u8 reserved[3];
1052+};
1053+
1054+struct omapfb_caps {
1055+ __u32 ctrl;
1056+ __u32 plane_color;
1057+ __u32 wnd_color;
1058+};
1059+
1060+enum omapfb_color_key_type {
1061+ OMAPFB_COLOR_KEY_DISABLED = 0,
1062+ OMAPFB_COLOR_KEY_GFX_DST,
1063+ OMAPFB_COLOR_KEY_VID_SRC,
1064+};
1065+
1066+struct omapfb_color_key {
1067+ __u8 channel_out;
1068+ __u32 background;
1069+ __u32 trans_key;
1070+ __u8 key_type;
1071+};
1072+
1073+enum omapfb_update_mode {
1074+ OMAPFB_UPDATE_DISABLED = 0,
1075+ OMAPFB_AUTO_UPDATE,
1076+ OMAPFB_MANUAL_UPDATE
1077+};
1078+
1079+#ifdef __KERNEL__
1080+
1081+#include <linux/completion.h>
1082+#include <linux/interrupt.h>
1083+#include <linux/fb.h>
1084+#include <linux/mutex.h>
1085+
1086+#include <mach/board.h>
1087+
1088+#define OMAP_LCDC_INV_VSYNC 0x0001
1089+#define OMAP_LCDC_INV_HSYNC 0x0002
1090+#define OMAP_LCDC_INV_PIX_CLOCK 0x0004
1091+#define OMAP_LCDC_INV_OUTPUT_EN 0x0008
1092+#define OMAP_LCDC_HSVS_RISING_EDGE 0x0010
1093+#define OMAP_LCDC_HSVS_OPPOSITE 0x0020
1094+
1095+#define OMAP_LCDC_SIGNAL_MASK 0x003f
1096+
1097+#define OMAP_LCDC_PANEL_TFT 0x0100
1098+
1099+#define OMAPFB_PLANE_XRES_MIN 8
1100+#define OMAPFB_PLANE_YRES_MIN 8
1101+
1102+#ifdef CONFIG_ARCH_OMAP1
1103+#define OMAPFB_PLANE_NUM 1
1104+#else
1105+#define OMAPFB_PLANE_NUM 3
1106+#endif
1107+
1108+struct omapfb_device;
1109+
1110+struct lcd_panel {
1111+ const char *name;
1112+ int config; /* TFT/STN, signal inversion */
1113+ int bpp; /* Pixel format in fb mem */
1114+ int data_lines; /* Lines on LCD HW interface */
1115+
1116+ int x_res, y_res;
1117+ int pixel_clock; /* In kHz */
1118+ int hsw; /* Horizontal synchronization
1119+ pulse width */
1120+ int hfp; /* Horizontal front porch */
1121+ int hbp; /* Horizontal back porch */
1122+ int vsw; /* Vertical synchronization
1123+ pulse width */
1124+ int vfp; /* Vertical front porch */
1125+ int vbp; /* Vertical back porch */
1126+ int acb; /* ac-bias pin frequency */
1127+ int pcd; /* pixel clock divider.
1128+ Obsolete use pixel_clock instead */
1129+
1130+ int (*init) (struct lcd_panel *panel,
1131+ struct omapfb_device *fbdev);
1132+ void (*cleanup) (struct lcd_panel *panel);
1133+ int (*enable) (struct lcd_panel *panel);
1134+ void (*disable) (struct lcd_panel *panel);
1135+ unsigned long (*get_caps) (struct lcd_panel *panel);
1136+ int (*set_bklight_level)(struct lcd_panel *panel,
1137+ unsigned int level);
1138+ unsigned int (*get_bklight_level)(struct lcd_panel *panel);
1139+ unsigned int (*get_bklight_max) (struct lcd_panel *panel);
1140+ int (*run_test) (struct lcd_panel *panel, int test_num);
1141+};
1142+
1143+struct extif_timings {
1144+ int cs_on_time;
1145+ int cs_off_time;
1146+ int we_on_time;
1147+ int we_off_time;
1148+ int re_on_time;
1149+ int re_off_time;
1150+ int we_cycle_time;
1151+ int re_cycle_time;
1152+ int cs_pulse_width;
1153+ int access_time;
1154+
1155+ int clk_div;
1156+
1157+ u32 tim[5]; /* set by extif->convert_timings */
1158+
1159+ int converted;
1160+};
1161+
1162+struct lcd_ctrl_extif {
1163+ int (*init) (struct omapfb_device *fbdev);
1164+ void (*cleanup) (void);
1165+ void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
1166+ unsigned long (*get_max_tx_rate)(void);
1167+ int (*convert_timings) (struct extif_timings *timings);
1168+ void (*set_timings) (const struct extif_timings *timings);
1169+ void (*set_bits_per_cycle)(int bpc);
1170+ void (*write_command) (const void *buf, unsigned int len);
1171+ void (*read_data) (void *buf, unsigned int len);
1172+ void (*write_data) (const void *buf, unsigned int len);
1173+ void (*transfer_area) (int width, int height,
1174+ void (callback)(void * data), void *data);
1175+ int (*setup_tearsync) (unsigned pin_cnt,
1176+ unsigned hs_pulse_time, unsigned vs_pulse_time,
1177+ int hs_pol_inv, int vs_pol_inv, int div);
1178+ int (*enable_tearsync) (int enable, unsigned line);
1179+
1180+ unsigned long max_transmit_size;
1181+};
1182+
1183+struct omapfb_notifier_block {
1184+ struct notifier_block nb;
1185+ void *data;
1186+ int plane_idx;
1187+};
1188+
1189+typedef int (*omapfb_notifier_callback_t)(struct notifier_block *,
1190+ unsigned long event,
1191+ void *fbi);
1192+
1193+struct omapfb_mem_region {
1194+ u32 paddr;
1195+ void __iomem *vaddr;
1196+ unsigned long size;
1197+ u8 type; /* OMAPFB_PLANE_MEM_* */
1198+ unsigned alloc:1; /* allocated by the driver */
1199+ unsigned map:1; /* kernel mapped by the driver */
1200+};
1201+
1202+struct omapfb_mem_desc {
1203+ int region_cnt;
1204+ struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
1205+};
1206+
1207+struct lcd_ctrl {
1208+ const char *name;
1209+ void *data;
1210+
1211+ int (*init) (struct omapfb_device *fbdev,
1212+ int ext_mode,
1213+ struct omapfb_mem_desc *req_md);
1214+ void (*cleanup) (void);
1215+ void (*bind_client) (struct omapfb_notifier_block *nb);
1216+ void (*get_caps) (int plane, struct omapfb_caps *caps);
1217+ int (*set_update_mode)(enum omapfb_update_mode mode);
1218+ enum omapfb_update_mode (*get_update_mode)(void);
1219+ int (*setup_plane) (int plane, int channel_out,
1220+ unsigned long offset,
1221+ int screen_width,
1222+ int pos_x, int pos_y, int width,
1223+ int height, int color_mode);
1224+ int (*set_rotate) (int angle);
1225+ int (*setup_mem) (int plane, size_t size,
1226+ int mem_type, unsigned long *paddr);
1227+ int (*mmap) (struct fb_info *info,
1228+ struct vm_area_struct *vma);
1229+ int (*set_scale) (int plane,
1230+ int orig_width, int orig_height,
1231+ int out_width, int out_height);
1232+ int (*enable_plane) (int plane, int enable);
1233+ int (*update_window) (struct fb_info *fbi,
1234+ struct omapfb_update_window *win,
1235+ void (*callback)(void *),
1236+ void *callback_data);
1237+ void (*sync) (void);
1238+ void (*suspend) (void);
1239+ void (*resume) (void);
1240+ int (*run_test) (int test_num);
1241+ int (*setcolreg) (u_int regno, u16 red, u16 green,
1242+ u16 blue, u16 transp,
1243+ int update_hw_mem);
1244+ int (*set_color_key) (struct omapfb_color_key *ck);
1245+ int (*get_color_key) (struct omapfb_color_key *ck);
1246+};
1247+
1248+enum omapfb_state {
1249+ OMAPFB_DISABLED = 0,
1250+ OMAPFB_SUSPENDED= 99,
1251+ OMAPFB_ACTIVE = 100
1252+};
1253+
1254+struct omapfb_plane_struct {
1255+ int idx;
1256+ struct omapfb_plane_info info;
1257+ enum omapfb_color_format color_mode;
1258+ struct omapfb_device *fbdev;
1259+};
1260+
1261+struct omapfb_device {
1262+ int state;
1263+ int ext_lcdc; /* Using external
1264+ LCD controller */
1265+ struct mutex rqueue_mutex;
1266+
1267+ int palette_size;
1268+ u32 pseudo_palette[17];
1269+
1270+ struct lcd_panel *panel; /* LCD panel */
1271+ const struct lcd_ctrl *ctrl; /* LCD controller */
1272+ const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
1273+ struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
1274+ interface */
1275+ struct device *dev;
1276+ struct fb_var_screeninfo new_var; /* for mode changes */
1277+
1278+ struct omapfb_mem_desc mem_desc;
1279+ struct fb_info *fb_info[OMAPFB_PLANE_NUM];
1280+};
1281+
1282+struct omapfb_platform_data {
1283+ struct omap_lcd_config lcd;
1284+ struct omapfb_mem_desc mem_desc;
1285+ void *ctrl_platform_data;
1286+};
1287+
1288+#ifdef CONFIG_ARCH_OMAP1
1289+extern struct lcd_ctrl omap1_lcd_ctrl;
1290+#else
1291+extern struct lcd_ctrl omap2_disp_ctrl;
1292+#endif
1293+
1294+extern void omapfb_reserve_sdram(void);
1295+extern void omapfb_register_panel(struct lcd_panel *panel);
1296+extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
1297+extern void omapfb_notify_clients(struct omapfb_device *fbdev,
1298+ unsigned long event);
1299+extern int omapfb_register_client(struct omapfb_notifier_block *nb,
1300+ omapfb_notifier_callback_t callback,
1301+ void *callback_data);
1302+extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
1303+extern int omapfb_update_window_async(struct fb_info *fbi,
1304+ struct omapfb_update_window *win,
1305+ void (*callback)(void *),
1306+ void *callback_data);
1307+
1308+/* in arch/arm/plat-omap/fb.c */
1309+extern void omapfb_set_ctrl_platform_data(void *pdata);
1310+
1311+#endif /* __KERNEL__ */
1312+
1313+#endif /* __OMAPFB_H */
1314--
13151.5.6.5
1316