1 /* 2 * JzRISC lcd controller 3 * 4 * Copyright (C) 2005-2007, Ingenic Semiconductor Inc. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 * MA 02111-1307 USA 20 */ 21 22 #ifndef __JZLCD_H__ 23 #define __JZLCD_H__ 24 25 unsigned long lcd_get_size(void); 26 void lcd_ctrl_init(void *lcdbase); 27 void lcd_enable(void); 28 void lcd_disable(void); 29 30 struct lcd_desc{ 31 unsigned int next_desc; /* LCDDAx */ 32 unsigned int databuf; /* LCDSAx */ 33 unsigned int frame_id; /* LCDFIDx */ 34 unsigned int cmd; /* LCDCMDx */ 35 }; 36 37 struct jzfb_info { 38 unsigned int cfg; /* panel mode and pin usage etc. */ 39 unsigned int w; 40 unsigned int h; 41 unsigned int bpp; /* bit per pixel */ 42 unsigned int fclk; /* frame clk */ 43 unsigned int hsw; /* hsync width, in pclk */ 44 unsigned int vsw; /* vsync width, in line count */ 45 unsigned int elw; /* end of line, in pclk */ 46 unsigned int blw; /* begin of line, in pclk */ 47 unsigned int efw; /* end of frame, in line count */ 48 unsigned int bfw; /* begin of frame, in line count */ 49 }; 50 51 #define MODE_MASK 0x0f 52 #define MODE_TFT_GEN 0x00 53 #define MODE_TFT_SHARP 0x01 54 #define MODE_TFT_CASIO 0x02 55 #define MODE_TFT_SAMSUNG 0x03 56 #define MODE_CCIR656_NONINT 0x04 57 #define MODE_CCIR656_INT 0x05 58 #define MODE_STN_COLOR_SINGLE 0x08 59 #define MODE_STN_MONO_SINGLE 0x09 60 #define MODE_STN_COLOR_DUAL 0x0a 61 #define MODE_STN_MONO_DUAL 0x0b 62 #define MODE_8BIT_SERIAL_TFT 0x0c 63 64 #define MODE_TFT_18BIT (1<<7) 65 66 #define STN_DAT_PIN1 (0x00 << 4) 67 #define STN_DAT_PIN2 (0x01 << 4) 68 #define STN_DAT_PIN4 (0x02 << 4) 69 #define STN_DAT_PIN8 (0x03 << 4) 70 #define STN_DAT_PINMASK STN_DAT_PIN8 71 72 #define STFT_PSHI (1 << 15) 73 #define STFT_CLSHI (1 << 14) 74 #define STFT_SPLHI (1 << 13) 75 #define STFT_REVHI (1 << 12) 76 77 #define SYNC_MASTER (0 << 16) 78 #define SYNC_SLAVE (1 << 16) 79 80 #define DE_P (0 << 9) 81 #define DE_N (1 << 9) 82 83 #define PCLK_P (0 << 10) 84 #define PCLK_N (1 << 10) 85 86 #define HSYNC_P (0 << 11) 87 #define HSYNC_N (1 << 11) 88 89 #define VSYNC_P (0 << 8) 90 #define VSYNC_N (1 << 8) 91 92 #define DATA_NORMAL (0 << 17) 93 #define DATA_INVERSE (1 << 17) 94 95 96 /* Jz LCDFB supported I/O controls. */ 97 #define FBIOSETBACKLIGHT 0x4688 98 #define FBIODISPON 0x4689 99 #define FBIODISPOFF 0x468a 100 #define FBIORESET 0x468b 101 #define FBIOPRINT_REG 0x468c 102 103 #endif /* __JZLCD_H__ */