MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / drivers / video / dm270fb.h
blob1de324c631707665d3081d02aba1b9d0c1f5676e
1 /***********************************************************************
2 * drivers/video/dm270fb.h
4 * TI TMS320DM270 Frame Buffer Driver
6 * Derived from driver/video/sa1100fb.h
8 * Copyright (C) 2004 InnoMedia Pte Ltd. All rights reserved.
9 * cheetim_loh@innomedia.com.sg <www.innomedia.com>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 ***********************************************************************/
33 #define DM270FB_DEBUG
35 #define DM270FB_NR_FB 1
37 /* maximum length of fb_fix_screeninfo.id is 15 characters */
38 #define DM270FB_NAME "DM270FB"
40 #define DISP_TYPE_COMP 0
41 #define DISP_TYPE_LCD 1
42 #define DISP_TYPE_TFT 2
43 #define DISP_TYPE_CRT 3
44 #define DISP_TYPE_EPSON 4
45 #define DISP_TYPE_CASIO 5
47 #define VID_FMT_NTSC 0
48 #define VID_FMT_PAL 1
50 #define FB_ACCEL_DM270 FB_ACCEL_NONE
52 #define DM270FB_NR_PALETTE 256
54 #define DM270FB_XRES_MIN 320
55 #define DM270FB_YRES_MIN 200
56 #define DM270FB_XRES_MAX 1024
57 #define DM270FB_YRES_MAX 768
58 #define DM270FB_BPP_MAX 8
60 #define DM270FB_DEFAULT_DISPTYPE DISP_TYPE_COMP
61 #define DM270FB_DEFAULT_VIDFMT VID_FMT_NTSC
62 #define DM270FB_DEFAULT_SYNC FB_SYNC_COMP_HIGH_ACT
63 #define DM270FB_DEFAULT_VMODE FB_VMODE_INTERLACED
64 #define DM270FB_DEFAULT_XRES 640
65 #define DM270FB_DEFAULT_YRES 480
66 #define DM270FB_DEFAULT_BPP 8
67 #define DM270FB_DEFAULT_PIXCLOCK 0
68 #define DM270FB_DEFAULT_LEFT_MARGIN 0
69 #define DM270FB_DEFAULT_RIGHT_MARGIN 0
70 #define DM270FB_DEFAULT_UPPER_MARGIN 0
71 #define DM270FB_DEFAULT_LOWER_MARGIN 0
72 #define DM270FB_DEFAULT_HSYNC_LEN 0
73 #define DM270FB_DEFAULT_VSYNC_LEN 0
75 #define DM270FB_OSD_BASEPX_NTSC (120 + 32)
76 #define DM270FB_OSD_BASEPY_NTSC 18
77 #define DM270FB_OSD_BASEPX_PAL (144 + 32)
78 #define DM270FB_OSD_BASEPY_PAL 22
80 struct dm270fb_cfg {
81 int noaccel;
82 int nopan;
83 int nowrap;
84 int nohwcursor;
85 int noinit;
86 int cmap_inverse;
87 int cmap_static;
88 int disp_type;
89 int vidout_std;
90 char fontname[40]; /* follow length of fb_info.fontname */
91 char *mode_option;
94 struct dm270fb_regaddr {
95 /* address dependent on bmpwin0 or bmpwin1 */
96 unsigned int bmpwinmd;
97 unsigned int bmpwinofst;
98 unsigned int bmpwinadl;
99 unsigned int bmpwinxp;
100 unsigned int bmpwinyp;
101 unsigned int bmpwinxl;
102 unsigned int bmpwinyl;
103 unsigned int wbmp;
106 struct dm270fb_regval {
107 unsigned short vid01;
108 unsigned short vid02;
109 unsigned short bmpwinmd;
110 unsigned short rectcur;
111 unsigned short bmpwinofst;
112 unsigned short bmpwinxp;
113 unsigned short bmpwinyp;
114 unsigned short bmpwinxl;
115 unsigned short bmpwinyl;
118 struct dm270fb_cursor {
119 int type;
120 int state;
121 int w;
122 int h;
123 int u;
124 int x;
125 int y;
126 int redraw;
127 unsigned long enable;
128 unsigned long disable;
129 struct timer_list timer;
130 spinlock_t lock;
133 struct dm270fb_par {
134 struct dm270fb_cfg cfg;
135 struct dm270fb_regaddr regaddr;
136 struct dm270fb_regval regval;
137 struct dm270fb_cursor cursor;
141 * Debug macros
143 #ifdef DM270FB_DEBUG
144 # define WPRINTK(fmt, args...) printk(KERN_WARNING "dm270fb: %s: " fmt, __FUNCTION__ , ## args)
145 # define DPRINTK(fmt, args...) printk(KERN_DEBUG "dm270fb: %s: " fmt, __FUNCTION__ , ## args)
146 #else
147 # define WPRINTK(fmt, args...)
148 # define DPRINTK(fmt, args...)
149 #endif