]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/arch-am33xx/da8xx-fb.h
karo: cleanup after merge of v2015.10-rc2
[karo-tx-uboot.git] / arch / arm / include / asm / arch-am33xx / da8xx-fb.h
1 /*
2  * Porting to u-boot:
3  *
4  * (C) Copyright 2011
5  * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
6  *
7  * Copyright (C) 2008-2009 MontaVista Software Inc.
8  * Copyright (C) 2008-2009 Texas Instruments Inc
9  *
10  * Based on the LCD driver for TI Avalanche processors written by
11  * Ajay Singh and Shalom Hai.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option)any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  */
27
28 #ifndef DA8XX_FB_H
29 #define DA8XX_FB_H
30
31 enum panel_type {
32         QVGA,
33         WVGA,
34 };
35
36 enum panel_shade {
37         MONOCHROME = 0,
38         COLOR_ACTIVE,
39         COLOR_PASSIVE,
40 };
41
42 enum raster_load_mode {
43         LOAD_DATA = 1,
44         LOAD_PALETTE,
45 };
46
47 struct display_panel {
48         enum panel_type panel_type; /* QVGA */
49         int max_bpp;
50         int min_bpp;
51         enum panel_shade panel_shade;
52 };
53
54 struct da8xx_panel {
55         const char      name[25];       /* Full name <vendor>_<model> */
56         unsigned short  width;
57         unsigned short  height;
58         int             hfp;            /* Horizontal front porch */
59         int             hbp;            /* Horizontal back porch */
60         int             hsw;            /* Horizontal Sync Pulse Width */
61         int             vfp;            /* Vertical front porch */
62         int             vbp;            /* Vertical back porch */
63         int             vsw;            /* Vertical Sync Pulse Width */
64         unsigned int    pxl_clk;        /* Pixel clock */
65         unsigned char   invert_pxl_clk; /* Invert Pixel clock */
66 };
67
68 struct da8xx_lcdc_platform_data {
69         const char manu_name[10];
70         void *controller_data;
71         const char type[25];
72         void (*panel_power_ctrl)(int);
73 };
74
75 struct lcd_ctrl_config {
76         const struct display_panel *p_disp_panel;
77
78         /* AC Bias Pin Frequency */
79         int ac_bias;
80
81         /* AC Bias Pin Transitions per Interrupt */
82         int ac_bias_intrpt;
83
84         /* DMA burst size */
85         int dma_burst_sz;
86
87         /* Bits per pixel */
88         int bpp;
89
90         /* FIFO DMA Request Delay */
91         int fdd;
92
93         /* TFT Alternative Signal Mapping (Only for active) */
94         unsigned char tft_alt_mode;
95
96         /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */
97         unsigned char stn_565_mode;
98
99         /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */
100         unsigned char mono_8bit_mode;
101
102         /* Invert line clock */
103         unsigned char invert_line_clock;
104
105         /* Invert frame clock  */
106         unsigned char invert_frm_clock;
107
108         /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */
109         unsigned char sync_edge;
110
111         /* Horizontal and Vertical Sync: Control: 0=ignore */
112         unsigned char sync_ctrl;
113
114         /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
115         unsigned char raster_order;
116 };
117
118 struct lcd_sync_arg {
119         int back_porch;
120         int front_porch;
121         int pulse_width;
122 };
123
124 void da8xx_fb_disable(void);
125 void da8xx_video_init(const struct da8xx_panel *panel,
126                 const struct lcd_ctrl_config *lcd_cfg, int bits_pixel);
127
128 #endif  /* ifndef DA8XX_FB_H */