123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- #ifndef __AUOFB_H
- #define __AUOFB_H
- /*
- * linux/drivers/video/auofb.h
- *
- * $Id: s3cfb.h,v 1.13 2008/05/26 07:58:22 jsgood Exp $
- *
- * Copyright (c)2005 rahul tanwar <rahul.tanwar@samsung.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file COPYING in the main directory of this archive for
- * more details.
- *
- * S3C LCD Controller Frame Buffer Driver
- * based on skeletonfb.c, sa1100fb.h
- *
- */
- #define BIT0 0x00000001
- #define BIT1 0x00000002
- #define BIT2 0x00000004
- #define BIT3 0x00000008
- #define BIT4 0x00000010
- #define BIT5 0x00000020
- #define BIT6 0x00000040
- #define BIT7 0x00000080
- #define BIT8 0x00000100
- #define BIT9 0x00000200
- #define BIT10 0x00000400
- #define BIT11 0x00000800
- #define BIT12 0x00001000
- #define BIT13 0x00002000
- #define BIT14 0x00004000
- #define BIT15 0x00008000
- #define BIT16 0x00010000
- #define BIT17 0x00020000
- #define BIT18 0x00040000
- #define BIT19 0x00080000
- #define BIT20 0x00100000
- #define BIT21 0x00200000
- #define BIT22 0x00400000
- #define BIT23 0x00800000
- #define BIT24 0x01000000
- #define BIT25 0x02000000
- #define BIT26 0x04000000
- #define BIT27 0x08000000
- #define BIT28 0x10000000
- #define BIT29 0x20000000
- #define BIT30 0x40000000
- #define BIT31 0x80000000
- #define MIN_XRES 64
- #define MIN_YRES 64
- #define AUOFB_IOCTL_TCON_GET_BUSY_STATUS 0xFF00
- #define AUOFB_IOCTL_SW_REFRESH 0xFF01
- #define AUOFB_IOCTL_TCON_PARTIAL_UPDATE 0xFF02
- #define AUOFB_IOCTL_TCON_SHUTDOWN 0xFF03
- #define AUOFB_IOCTL_TCON_STANDBY 0xFF04
- #define AUOFB_IOCTL_TCON_WAKEUP 0xFF05
- #define AUOFB_IOCTL_TCON_SLEEP 0xFF06
- #define AUOFB_IOCTL_TCON_NO_SLEEP 0xFF07
- #define AUOFB_IOCTL_TCON_REFRESH 0xFF08
- #define AUOFB_IOCTL_SET_UPDATE_THRESHOLD 0xFF09
- #define AUOFB_IOCTL_TCON_RESET 0xFF0A
- #define AUOFB_IOCTL_TCON_INIT 0xFF0B
- #define AUOFB_IOCTL_TCON_UPDATE_LUT 0xFF0C
- #define AUOFB_IOCTL_TCON_READ_LUT 0xFF0D
- #define AUOFB_IOCTL_TCON_POWER_STATE 0xFF70
- #define AUOFB_IOCTL_TCON_GET_TEMPERATURE 0xFFA0
- #define AUOFB_IOCTL_TCON_GET_EPD_TYPE 0xFFA1
- #define AUOFB_IOCTL_TCON_GET_PANEL_TYPE 0xFFA2
- #define AUOFB_IOCTL_TCON_GET_LUT_INFO 0xFFA3
- #define AUOFB_IOCTL_SHOW_PROGRESS_BAR 0xFFE0
- #define AUOFB_IOCTL_CLEAN_EPD 0xFFE1
- /* Qisda, Howard Hsu, 2010/01/11, Add show image ioctrl { */
- #define AUOFB_IOCTL_SHOW_IMAGE 0xFFE2
- /* } Qisda, Howard Hsu, 2010/01/11, Add show image ioctrl */
- #define EPD_DEVICE_POWER_STATE AUOFB_IOCTL_TCON_POWER_STATE
- enum {
- EN_EPD_DEVICE_POWER_STATE_D0 = 0, //normal
- EN_EPD_DEVICE_POWER_STATE_D1, //stand by
- EN_EPD_DEVICE_POWER_STATE_D2, //sleep
- EN_EPD_DEVICE_POWER_STATE_D3, //shutdown
- };
- struct auo_fb_rgb {
- struct fb_bitfield red;
- struct fb_bitfield green;
- struct fb_bitfield blue;
- struct fb_bitfield transp;
- };
- //???
- const static struct auo_fb_rgb auo_fb_rgb_4 = {
- .red = {.offset = 8, .length = 4,},
- .green = {.offset = 4, .length = 4,},
- .blue = {.offset = 0, .length = 4,},
- .transp = {.offset = 0, .length = 0,},
- };
- const static struct auo_fb_rgb auo_fb_rgb_8 = {
- .red = {.offset = 0, .length = 8,},
- .green = {.offset = 0, .length = 8,},
- .blue = {.offset = 0, .length = 8,},
- .transp = {.offset = 0, .length = 0,},
- };
- const static struct auo_fb_rgb auo_fb_rgb_16 = {
- .red = {.offset = 11, .length = 5,},
- .green = {.offset = 5, .length = 6,},
- .blue = {.offset = 0, .length = 5,},
- .transp = {.offset = 0, .length = 0,},
- };
- const static struct auo_fb_rgb auo_fb_rgb_24 = {
- .red = {.offset = 16, .length = 8,},
- .green = {.offset = 8, .length = 8,},
- .blue = {.offset = 0, .length = 8,},
- .transp = {.offset = 0, .length = 0,},
- };
- const static struct auo_fb_rgb auo_fb_rgb_32 = {
- .red={.offset=16, .length=8,},
- .green={.offset=8, .length=8,},
- .blue={.offset=0, .length=8,},
- .transp={.offset= 24, .length=8,},
- };
- struct auo_fb_info {
- struct fb_info fb;
- struct device *dev;
- // YREOM 2007 add for supporting many OSD
- u_int win_id;
- u_int max_bpp;
- u_int max_xres;
- u_int max_yres;
- /* raw memory addresses */
- dma_addr_t map_dma_f1; /* physical */
- u_char * map_cpu_f1; /* virtual */
- u_int map_size_f1;
- /* addresses of pieces placed in raw buffer */
- u_char * screen_cpu_f1; /* virtual address of frame buffer */
- dma_addr_t screen_dma_f1; /* physical address of frame buffer */
- /* raw memory addresses */
- dma_addr_t map_dma_f2; /* physical */
- u_char * map_cpu_f2; /* virtual */
- u_int map_size_f2;
- /* addresses of pieces placed in raw buffer */
- u_char * screen_cpu_f2; /* virtual address of frame buffer */
- dma_addr_t screen_dma_f2; /* physical address of frame buffer */
- unsigned int palette_ready;
- unsigned int fb_change_ready;
- /* keep these registers in case we need to re-write palette */
- u32 palette_buffer[256];
- u32 pseudo_pal[16];
- };
- #define PALETTE_BUFF_CLEAR (0x80000000) /* entry is clear/invalid */
- int auofb_init(void);
- #if 0
- #define dprintk(msg...) printk("auo_fb: " msg)
- #else
- #define dprintk(msg...) while (0) { }
- #endif
- struct auo_fb_mach_info {
- /* Screen size */
- int width;
- int height;
- /* Screen info */
- int xres;
- int yres;
- /* Virtual Screen info */
- int xres_virtual;
- int yres_virtual;
- int xoffset;
- int yoffset;
- /* OSD Screen size */
- int osd_width;
- int osd_height;
- /* OSD Screen info */
- int osd_xres;
- int osd_yres;
- /* OSD Screen info */
- int osd_xres_virtual;
- int osd_yres_virtual;
- int bpp;
- int bytes_per_pixel;
- unsigned long pixclock;
- int hsync_len;
- int left_margin;
- int right_margin;
- int vsync_len;
- int upper_margin;
- int lower_margin;
- int sync;
- int cmap_grayscale:1, cmap_inverse:1, cmap_static:1, unused:29;
- /* lcd configuration registers */
- unsigned long lcdcon1;
- unsigned long lcdcon2;
- unsigned long lcdcon3;
- unsigned long lcdcon4;
- unsigned long lcdcon5;
- /* GPIOs */
- unsigned long gpcup;
- unsigned long gpcup_mask;
- unsigned long gpccon;
- unsigned long gpccon_mask;
- unsigned long gpdup;
- unsigned long gpdup_mask;
- unsigned long gpdcon;
- unsigned long gpdcon_mask;
- /* lpc3600 control register */
- unsigned long lpcsel;
- unsigned long lcdtcon1;
- unsigned long lcdtcon2;
- unsigned long lcdtcon3;
- unsigned long lcdosd1;
- unsigned long lcdosd2;
- unsigned long lcdosd3;
- unsigned long lcdsaddrb1;
- unsigned long lcdsaddrb2;
- unsigned long lcdsaddrf1;
- unsigned long lcdsaddrf2;
- unsigned long lcdeaddrb1;
- unsigned long lcdeaddrb2;
- unsigned long lcdeaddrf1;
- unsigned long lcdeaddrf2;
- unsigned long lcdvscrb1;
- unsigned long lcdvscrb2;
- unsigned long lcdvscrf1;
- unsigned long lcdvscrf2;
- unsigned long lcdintcon;
- unsigned long lcdkeycon;
- unsigned long lcdkeyval;
- unsigned long lcdbgcon;
- unsigned long lcdfgcon;
- unsigned long lcddithcon;
- /* For s3c2443, s3c6400 */
- unsigned long vidcon0;
- unsigned long vidcon1;
- unsigned long vidtcon0;
- unsigned long vidtcon1;
- unsigned long vidtcon2;
- unsigned long vidtcon3;
- unsigned long wincon0;
- unsigned long wincon2;
- unsigned long wincon1;
- unsigned long wincon3;
- unsigned long wincon4;
- unsigned long vidosd0a;
- unsigned long vidosd0b;
- unsigned long vidosd0c;
- unsigned long vidosd1a;
- unsigned long vidosd1b;
- unsigned long vidosd1c;
- unsigned long vidosd1d;
- unsigned long vidosd2a;
- unsigned long vidosd2b;
- unsigned long vidosd2c;
- unsigned long vidosd2d;
- unsigned long vidosd3a;
- unsigned long vidosd3b;
- unsigned long vidosd3c;
- unsigned long vidosd4a;
- unsigned long vidosd4b;
- unsigned long vidosd4c;
- unsigned long vidw00add0b0;
- unsigned long vidw00add0b1;
- unsigned long vidw01add0;
- unsigned long vidw01add0b0;
- unsigned long vidw01add0b1;
- unsigned long vidw00add1b0;
- unsigned long vidw00add1b1;
- unsigned long vidw01add1;
- unsigned long vidw01add1b0;
- unsigned long vidw01add1b1;
- unsigned long vidw00add2b0;
- unsigned long vidw00add2b1;
- unsigned long vidw02add0;
- unsigned long vidw03add0;
- unsigned long vidw04add0;
- unsigned long vidw02add1;
- unsigned long vidw03add1;
- unsigned long vidw04add1;
- unsigned long vidw00add2;
- unsigned long vidw01add2;
- unsigned long vidw02add2;
- unsigned long vidw03add2;
- unsigned long vidw04add2;
- unsigned long vidintcon;
- unsigned long vidintcon0;
- unsigned long vidintcon1;
- unsigned long w1keycon0;
- unsigned long w1keycon1;
- unsigned long w2keycon0;
- unsigned long w2keycon1;
- unsigned long w3keycon0;
- unsigned long w3keycon1;
- unsigned long w4keycon0;
- unsigned long w4keycon1;
- unsigned long win0map;
- unsigned long win1map;
- unsigned long win2map;
- unsigned long win3map;
- unsigned long win4map;
- unsigned long wpalcon;
- unsigned long dithmode;
- unsigned long intclr0;
- unsigned long intclr1;
- unsigned long intclr2;
- unsigned long win0pal;
- unsigned long win1pal;
- /* backlight info */
- int backlight_min;
- int backlight_max;
- int backlight_default;
- /* Utility fonctions */
- void (*backlight_power)(int);
- void (*lcd_power)(int);
- void (*set_brightness)(int);
- };
- typedef struct {
- int Bpp;
- int LeftTop_x;
- int LeftTop_y;
- int Width;
- int Height;
- } auo_win_info_t;
- typedef struct {
- int width;
- int height;
- int bpp;
- int offset;
- int v_width;
- int v_height;
- } vs_info_t;
- typedef struct {
- int direction;
- unsigned int compkey_red;
- unsigned int compkey_green;
- unsigned int compkey_blue;
- } auo_color_key_info_t;
- typedef struct {
- unsigned int colval_red;
- unsigned int colval_green;
- unsigned int colval_blue;
- } auo_color_val_info_t;
- #ifndef MHZ
- #define MHZ (1000*1000)
- #endif
- #define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000)
- extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
- extern struct auo_fb_mach_info auo_mach_info;
- extern void set_brightness(int);
- extern int auo_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);
- extern void auofb_activate_var(struct auo_fb_info *fbi, struct fb_var_screeninfo *var);
- #endif
|