Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * File: include/asm-arm/arch-omap/omapfb.h |
| 3 | * |
| 4 | * Framebuffer driver for TI OMAP boards |
| 5 | * |
| 6 | * Copyright (C) 2004 Nokia Corporation |
| 7 | * Author: Imre Deak <imre.deak@nokia.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License as published by the |
| 11 | * Free Software Foundation; either version 2 of the License, or (at your |
| 12 | * option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along |
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 22 | */ |
| 23 | |
| 24 | #ifndef __OMAPFB_H |
| 25 | #define __OMAPFB_H |
| 26 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 27 | #include <asm/ioctl.h> |
| 28 | #include <asm/types.h> |
| 29 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 30 | /* IOCTL commands. */ |
| 31 | |
| 32 | #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) |
| 33 | #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) |
| 34 | #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) |
| 35 | #define OMAP_IO(num) _IO('O', num) |
| 36 | |
| 37 | #define OMAPFB_MIRROR OMAP_IOW(31, int) |
| 38 | #define OMAPFB_SYNC_GFX OMAP_IO(37) |
| 39 | #define OMAPFB_VSYNC OMAP_IO(38) |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 40 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 41 | #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps) |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 42 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 43 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) |
| 44 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 45 | #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old) |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 46 | #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 47 | #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key) |
| 48 | #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info) |
| 49 | #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info) |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 50 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window) |
| 51 | #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info) |
| 52 | #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info) |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 53 | |
| 54 | #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff |
| 55 | #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 |
| 56 | #define OMAPFB_CAPS_PANEL_MASK 0xff000000 |
| 57 | |
| 58 | #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 59 | #define OMAPFB_CAPS_TEARSYNC 0x00002000 |
| 60 | #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000 |
| 61 | #define OMAPFB_CAPS_PLANE_SCALE 0x00008000 |
| 62 | #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000 |
| 63 | #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000 |
| 64 | #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000 |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 65 | #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 |
| 66 | |
| 67 | /* Values from DSP must map to lower 16-bits */ |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 68 | #define OMAPFB_FORMAT_MASK 0x00ff |
| 69 | #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 |
| 70 | #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200 |
| 71 | #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400 |
| 72 | #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800 |
| 73 | #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000 |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 74 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 75 | #define OMAPFB_EVENT_READY 1 |
| 76 | #define OMAPFB_EVENT_DISABLED 2 |
| 77 | |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 78 | #define OMAPFB_MEMTYPE_SDRAM 0 |
| 79 | #define OMAPFB_MEMTYPE_SRAM 1 |
| 80 | #define OMAPFB_MEMTYPE_MAX 1 |
| 81 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 82 | enum omapfb_color_format { |
| 83 | OMAPFB_COLOR_RGB565 = 0, |
| 84 | OMAPFB_COLOR_YUV422, |
| 85 | OMAPFB_COLOR_YUV420, |
| 86 | OMAPFB_COLOR_CLUT_8BPP, |
| 87 | OMAPFB_COLOR_CLUT_4BPP, |
| 88 | OMAPFB_COLOR_CLUT_2BPP, |
| 89 | OMAPFB_COLOR_CLUT_1BPP, |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 90 | OMAPFB_COLOR_RGB444, |
| 91 | OMAPFB_COLOR_YUY422, |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | struct omapfb_update_window { |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 95 | __u32 x, y; |
| 96 | __u32 width, height; |
| 97 | __u32 format; |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 98 | __u32 out_x, out_y; |
| 99 | __u32 out_width, out_height; |
| 100 | __u32 reserved[8]; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | struct omapfb_update_window_old { |
| 104 | __u32 x, y; |
| 105 | __u32 width, height; |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 106 | __u32 format; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 107 | }; |
| 108 | |
| 109 | enum omapfb_plane { |
| 110 | OMAPFB_PLANE_GFX = 0, |
| 111 | OMAPFB_PLANE_VID1, |
| 112 | OMAPFB_PLANE_VID2, |
| 113 | }; |
| 114 | |
| 115 | enum omapfb_channel_out { |
| 116 | OMAPFB_CHANNEL_OUT_LCD = 0, |
| 117 | OMAPFB_CHANNEL_OUT_DIGIT, |
| 118 | }; |
| 119 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 120 | struct omapfb_plane_info { |
| 121 | __u32 pos_x; |
| 122 | __u32 pos_y; |
| 123 | __u8 enabled; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 124 | __u8 channel_out; |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 125 | __u8 mirror; |
| 126 | __u8 reserved1; |
| 127 | __u32 out_width; |
| 128 | __u32 out_height; |
| 129 | __u32 reserved2[12]; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 130 | }; |
| 131 | |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 132 | struct omapfb_mem_info { |
| 133 | __u32 size; |
| 134 | __u8 type; |
| 135 | __u8 reserved[3]; |
| 136 | }; |
| 137 | |
| 138 | struct omapfb_caps { |
| 139 | __u32 ctrl; |
| 140 | __u32 plane_color; |
| 141 | __u32 wnd_color; |
| 142 | }; |
| 143 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 144 | enum omapfb_color_key_type { |
| 145 | OMAPFB_COLOR_KEY_DISABLED = 0, |
| 146 | OMAPFB_COLOR_KEY_GFX_DST, |
| 147 | OMAPFB_COLOR_KEY_VID_SRC, |
| 148 | }; |
| 149 | |
| 150 | struct omapfb_color_key { |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 151 | __u8 channel_out; |
| 152 | __u32 background; |
| 153 | __u32 trans_key; |
| 154 | __u8 key_type; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | enum omapfb_update_mode { |
| 158 | OMAPFB_UPDATE_DISABLED = 0, |
| 159 | OMAPFB_AUTO_UPDATE, |
| 160 | OMAPFB_MANUAL_UPDATE |
| 161 | }; |
| 162 | |
| 163 | #ifdef __KERNEL__ |
| 164 | |
| 165 | #include <linux/completion.h> |
| 166 | #include <linux/interrupt.h> |
| 167 | #include <linux/fb.h> |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 168 | #include <linux/mutex.h> |
| 169 | |
| 170 | #include <asm/arch/board.h> |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 171 | |
| 172 | #define OMAP_LCDC_INV_VSYNC 0x0001 |
| 173 | #define OMAP_LCDC_INV_HSYNC 0x0002 |
| 174 | #define OMAP_LCDC_INV_PIX_CLOCK 0x0004 |
| 175 | #define OMAP_LCDC_INV_OUTPUT_EN 0x0008 |
| 176 | #define OMAP_LCDC_HSVS_RISING_EDGE 0x0010 |
| 177 | #define OMAP_LCDC_HSVS_OPPOSITE 0x0020 |
| 178 | |
| 179 | #define OMAP_LCDC_SIGNAL_MASK 0x003f |
| 180 | |
| 181 | #define OMAP_LCDC_PANEL_TFT 0x0100 |
| 182 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 183 | #define OMAPFB_PLANE_XRES_MIN 8 |
| 184 | #define OMAPFB_PLANE_YRES_MIN 8 |
| 185 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 186 | #ifdef CONFIG_ARCH_OMAP1 |
| 187 | #define OMAPFB_PLANE_NUM 1 |
| 188 | #else |
| 189 | #define OMAPFB_PLANE_NUM 3 |
| 190 | #endif |
| 191 | |
| 192 | struct omapfb_device; |
| 193 | |
| 194 | struct lcd_panel { |
| 195 | const char *name; |
| 196 | int config; /* TFT/STN, signal inversion */ |
| 197 | int bpp; /* Pixel format in fb mem */ |
| 198 | int data_lines; /* Lines on LCD HW interface */ |
| 199 | |
| 200 | int x_res, y_res; |
| 201 | int pixel_clock; /* In kHz */ |
| 202 | int hsw; /* Horizontal synchronization |
| 203 | pulse width */ |
| 204 | int hfp; /* Horizontal front porch */ |
| 205 | int hbp; /* Horizontal back porch */ |
| 206 | int vsw; /* Vertical synchronization |
| 207 | pulse width */ |
| 208 | int vfp; /* Vertical front porch */ |
| 209 | int vbp; /* Vertical back porch */ |
| 210 | int acb; /* ac-bias pin frequency */ |
| 211 | int pcd; /* pixel clock divider. |
| 212 | Obsolete use pixel_clock instead */ |
| 213 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 214 | int (*init) (struct lcd_panel *panel, |
| 215 | struct omapfb_device *fbdev); |
| 216 | void (*cleanup) (struct lcd_panel *panel); |
| 217 | int (*enable) (struct lcd_panel *panel); |
| 218 | void (*disable) (struct lcd_panel *panel); |
| 219 | unsigned long (*get_caps) (struct lcd_panel *panel); |
| 220 | int (*set_bklight_level)(struct lcd_panel *panel, |
| 221 | unsigned int level); |
| 222 | unsigned int (*get_bklight_level)(struct lcd_panel *panel); |
| 223 | unsigned int (*get_bklight_max) (struct lcd_panel *panel); |
| 224 | int (*run_test) (struct lcd_panel *panel, int test_num); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 225 | }; |
| 226 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 227 | struct extif_timings { |
| 228 | int cs_on_time; |
| 229 | int cs_off_time; |
| 230 | int we_on_time; |
| 231 | int we_off_time; |
| 232 | int re_on_time; |
| 233 | int re_off_time; |
| 234 | int we_cycle_time; |
| 235 | int re_cycle_time; |
| 236 | int cs_pulse_width; |
| 237 | int access_time; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 238 | |
| 239 | int clk_div; |
| 240 | |
| 241 | u32 tim[5]; /* set by extif->convert_timings */ |
| 242 | |
| 243 | int converted; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 244 | }; |
| 245 | |
| 246 | struct lcd_ctrl_extif { |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 247 | int (*init) (struct omapfb_device *fbdev); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 248 | void (*cleanup) (void); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 249 | void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div); |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 250 | unsigned long (*get_max_tx_rate)(void); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 251 | int (*convert_timings) (struct extif_timings *timings); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 252 | void (*set_timings) (const struct extif_timings *timings); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 253 | void (*set_bits_per_cycle)(int bpc); |
| 254 | void (*write_command) (const void *buf, unsigned int len); |
| 255 | void (*read_data) (void *buf, unsigned int len); |
| 256 | void (*write_data) (const void *buf, unsigned int len); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 257 | void (*transfer_area) (int width, int height, |
| 258 | void (callback)(void * data), void *data); |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 259 | int (*setup_tearsync) (unsigned pin_cnt, |
| 260 | unsigned hs_pulse_time, unsigned vs_pulse_time, |
| 261 | int hs_pol_inv, int vs_pol_inv, int div); |
| 262 | int (*enable_tearsync) (int enable, unsigned line); |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 263 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 264 | unsigned long max_transmit_size; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 265 | }; |
| 266 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 267 | struct omapfb_notifier_block { |
| 268 | struct notifier_block nb; |
| 269 | void *data; |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 270 | int plane_idx; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 271 | }; |
| 272 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 273 | typedef int (*omapfb_notifier_callback_t)(struct notifier_block *, |
| 274 | unsigned long event, |
| 275 | void *fbi); |
| 276 | |
| 277 | struct omapfb_mem_region { |
| 278 | dma_addr_t paddr; |
| 279 | void *vaddr; |
| 280 | unsigned long size; |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 281 | u8 type; /* OMAPFB_PLANE_MEM_* */ |
| 282 | unsigned alloc:1; /* allocated by the driver */ |
| 283 | unsigned map:1; /* kernel mapped by the driver */ |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 284 | }; |
| 285 | |
| 286 | struct omapfb_mem_desc { |
| 287 | int region_cnt; |
| 288 | struct omapfb_mem_region region[OMAPFB_PLANE_NUM]; |
| 289 | }; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 290 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 291 | struct lcd_ctrl { |
| 292 | const char *name; |
| 293 | void *data; |
| 294 | |
| 295 | int (*init) (struct omapfb_device *fbdev, |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 296 | int ext_mode, |
| 297 | struct omapfb_mem_desc *req_md); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 298 | void (*cleanup) (void); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 299 | void (*bind_client) (struct omapfb_notifier_block *nb); |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 300 | void (*get_caps) (int plane, struct omapfb_caps *caps); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 301 | int (*set_update_mode)(enum omapfb_update_mode mode); |
| 302 | enum omapfb_update_mode (*get_update_mode)(void); |
| 303 | int (*setup_plane) (int plane, int channel_out, |
| 304 | unsigned long offset, |
| 305 | int screen_width, |
| 306 | int pos_x, int pos_y, int width, |
| 307 | int height, int color_mode); |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 308 | int (*setup_mem) (int plane, size_t size, |
| 309 | int mem_type, unsigned long *paddr); |
| 310 | int (*mmap) (struct fb_info *info, |
| 311 | struct vm_area_struct *vma); |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 312 | int (*set_scale) (int plane, |
| 313 | int orig_width, int orig_height, |
| 314 | int out_width, int out_height); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 315 | int (*enable_plane) (int plane, int enable); |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 316 | int (*update_window) (struct fb_info *fbi, |
| 317 | struct omapfb_update_window *win, |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 318 | void (*callback)(void *), |
| 319 | void *callback_data); |
| 320 | void (*sync) (void); |
| 321 | void (*suspend) (void); |
| 322 | void (*resume) (void); |
| 323 | int (*run_test) (int test_num); |
| 324 | int (*setcolreg) (u_int regno, u16 red, u16 green, |
| 325 | u16 blue, u16 transp, |
| 326 | int update_hw_mem); |
| 327 | int (*set_color_key) (struct omapfb_color_key *ck); |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 328 | int (*get_color_key) (struct omapfb_color_key *ck); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 329 | }; |
| 330 | |
| 331 | enum omapfb_state { |
| 332 | OMAPFB_DISABLED = 0, |
| 333 | OMAPFB_SUSPENDED= 99, |
| 334 | OMAPFB_ACTIVE = 100 |
| 335 | }; |
| 336 | |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 337 | struct omapfb_plane_struct { |
| 338 | int idx; |
| 339 | struct omapfb_plane_info info; |
| 340 | enum omapfb_color_format color_mode; |
| 341 | struct omapfb_device *fbdev; |
| 342 | }; |
| 343 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 344 | struct omapfb_device { |
| 345 | int state; |
| 346 | int ext_lcdc; /* Using external |
| 347 | LCD controller */ |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 348 | struct mutex rqueue_mutex; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 349 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 350 | int palette_size; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 351 | u32 pseudo_palette[17]; |
| 352 | |
| 353 | struct lcd_panel *panel; /* LCD panel */ |
| 354 | struct lcd_ctrl *ctrl; /* LCD controller */ |
| 355 | struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */ |
| 356 | struct lcd_ctrl_extif *ext_if; /* LCD ctrl external |
| 357 | interface */ |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 358 | struct device *dev; |
Kai Svahn | b01d96d | 2007-02-01 16:19:15 -0800 | [diff] [blame] | 359 | struct fb_var_screeninfo new_var; /* for mode changes */ |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 360 | |
| 361 | struct omapfb_mem_desc mem_desc; |
| 362 | struct fb_info *fb_info[OMAPFB_PLANE_NUM]; |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 363 | }; |
| 364 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 365 | struct omapfb_platform_data { |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 366 | struct omap_lcd_config lcd; |
| 367 | struct omapfb_mem_desc mem_desc; |
| 368 | void *ctrl_platform_data; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 369 | }; |
| 370 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 371 | #ifdef CONFIG_ARCH_OMAP1 |
| 372 | extern struct lcd_ctrl omap1_lcd_ctrl; |
| 373 | #else |
| 374 | extern struct lcd_ctrl omap2_disp_ctrl; |
| 375 | #endif |
| 376 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 377 | extern void omapfb_register_panel(struct lcd_panel *panel); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 378 | extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 379 | extern void omapfb_notify_clients(struct omapfb_device *fbdev, |
| 380 | unsigned long event); |
| 381 | extern int omapfb_register_client(struct omapfb_notifier_block *nb, |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 382 | omapfb_notifier_callback_t callback, |
| 383 | void *callback_data); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 384 | extern int omapfb_unregister_client(struct omapfb_notifier_block *nb); |
Tony Lindgren | f4e4c32 | 2006-12-07 13:57:38 -0800 | [diff] [blame] | 385 | extern int omapfb_update_window_async(struct fb_info *fbi, |
| 386 | struct omapfb_update_window *win, |
| 387 | void (*callback)(void *), |
| 388 | void *callback_data); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 389 | |
Imre Deak | 771af22 | 2006-12-06 17:13:50 -0800 | [diff] [blame] | 390 | /* in arch/arm/plat-omap/fb.c */ |
Imre Deak | 771af22 | 2006-12-06 17:13:50 -0800 | [diff] [blame] | 391 | extern void omapfb_set_ctrl_platform_data(void *pdata); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 392 | |
| 393 | #endif /* __KERNEL__ */ |
| 394 | |
| 395 | #endif /* __OMAPFB_H */ |