1 /*
2  * Allwinner SoCs display driver.
3  *
4  * Copyright (C) 2016 Allwinner.
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10 
11 #ifndef __PANEL_H__
12 #define __PANEL_H__
13 #include "../de/bsp_display.h"
14 #include "lcd_source.h"
15 
16 extern void LCD_OPEN_FUNC(u32 sel, LCD_FUNC func, u32 delay /*ms */);
17 extern void LCD_CLOSE_FUNC(u32 sel, LCD_FUNC func, u32 delay /*ms */);
18 
19 struct __lcd_panel {
20     char name[32];
21     struct disp_lcd_panel_fun func;
22 };
23 
24 extern struct __lcd_panel *panel_array[];
25 
26 struct sunxi_lcd_drv {
27     struct sunxi_disp_source_ops src_ops;
28 };
29 
30 #ifndef SUPPORT_DSI
31 enum __dsi_dcs_t {
32     DSI_DCS_ENTER_IDLE_MODE = 0x39, /* 01 */
33     DSI_DCS_ENTER_INVERT_MODE = 0x21,   /* 02 */
34     DSI_DCS_ENTER_NORMAL_MODE = 0x13,   /* 03 */
35     DSI_DCS_ENTER_PARTIAL_MODE = 0x12,  /* 04 */
36     DSI_DCS_ENTER_SLEEP_MODE = 0x10,    /* 05 */
37     DSI_DCS_EXIT_IDLE_MODE = 0x38,  /* 06 */
38     DSI_DCS_EXIT_INVERT_MODE = 0x20,    /* 07 */
39     DSI_DCS_EXIT_SLEEP_MODE = 0x11, /* 08 */
40     DSI_DCS_GET_ADDRESS_MODE = 0x0b,    /* 09 */
41     DSI_DCS_GET_BLUE_CHANNEL = 0x08,    /* 10 */
42     DSI_DCS_GET_DIAGNOSTIC_RESULT = 0x0f,   /* 11 */
43     DSI_DCS_GET_DISPLAY_MODE = 0x0d,    /* 12 */
44     DSI_DCS_GET_GREEN_CHANNEL = 0x07,   /* 13 */
45     DSI_DCS_GET_PIXEL_FORMAT = 0x0c,    /* 14 */
46     DSI_DCS_GET_POWER_MODE = 0x0a,  /* 15 */
47     DSI_DCS_GET_RED_CHANNEL = 0x06, /* 16 */
48     DSI_DCS_GET_SCANLINE = 0x45,    /* 17 */
49     DSI_DCS_GET_SIGNAL_MODE = 0x0e, /* 18 */
50     DSI_DCS_NOP = 0x00, /* 19 */
51     DSI_DCS_READ_DDB_CONTINUE = 0xa8,   /* 20 */
52     DSI_DCS_READ_DDB_START = 0xa1,  /* 21 */
53     DSI_DCS_READ_MEMORY_CONTINUE = 0x3e,    /* 22 */
54     DSI_DCS_READ_MEMORY_START = 0x2e,   /* 23 */
55     DSI_DCS_SET_ADDRESS_MODE = 0x36,    /* 24 */
56     DSI_DCS_SET_COLUMN_ADDRESS = 0x2a,  /* 25 */
57     DSI_DCS_SET_DISPLAY_OFF = 0x28, /* 26 */
58     DSI_DCS_SET_DISPLAY_ON = 0x29,  /* 27 */
59     DSI_DCS_SET_GAMMA_CURVE = 0x26, /* 28 */
60     DSI_DCS_SET_PAGE_ADDRESS = 0x2b,    /* 29 */
61     DSI_DCS_SET_PARTIAL_AREA = 0x30,    /* 30 */
62     DSI_DCS_SET_PIXEL_FORMAT = 0x3a,    /* 31 */
63     DSI_DCS_SET_SCROLL_AREA = 0x33, /* 32 */
64     DSI_DCS_SET_SCROLL_START = 0x37,    /* 33 */
65     DSI_DCS_SET_TEAR_OFF = 0x34,    /* 34 */
66     DSI_DCS_SET_TEAR_ON = 0x35, /* 35 */
67     DSI_DCS_SET_TEAR_SCANLINE = 0x44,   /* 36 */
68     DSI_DCS_SOFT_RESET = 0x01,  /* 37 */
69     DSI_DCS_WRITE_LUT = 0x2d,   /* 38 */
70     DSI_DCS_WRITE_MEMORY_CONTINUE = 0x3c,   /* 39 */
71     DSI_DCS_WRITE_MEMORY_START = 0x2c,  /* 40 */
72 };
73 #endif
74 
75 extern int sunxi_disp_get_source_ops(struct sunxi_disp_source_ops *src_ops);
76 int lcd_init(void);
77 
78 extern struct __lcd_panel default_eink;
79 extern struct __lcd_panel default_panel;
80 extern struct __lcd_panel lt070me05000_panel;
81 extern struct __lcd_panel wtq05027d01_panel;
82 extern struct __lcd_panel t27p06_panel;
83 extern struct __lcd_panel dx0960be40a1_panel;
84 extern struct __lcd_panel tft720_1280_panel;
85 extern struct __lcd_panel S6D7AA0X01_panel;
86 extern struct __lcd_panel gg1p4062utsw_panel;
87 extern struct __lcd_panel ls029b3sx02_panel;
88 extern struct __lcd_panel he0801a068_panel;
89 extern struct __lcd_panel tft08006_panel;
90 #ifdef CONFIG_LCD_SUPPORT_INET_DSI_PANEL
91 extern struct __lcd_panel inet_dsi_panel;
92 #endif
93 #ifdef CONFIG_LCD_SUPPORT_LQ101R1SX03
94 extern struct __lcd_panel lq101r1sx03_panel;
95 #endif
96 #ifdef CONFIG_LCD_SUPPORT_WILLIAMLCD
97 extern struct __lcd_panel WilliamLcd_panel;
98 #endif
99 #ifdef CONFIG_LCD_SUPPORT_ILI9881C
100 extern struct __lcd_panel ili9881c_dsi_panel;
101 #endif
102 #ifdef CONFIG_LCD_SUPPORT_TM_DSI_PANEL
103 extern struct __lcd_panel tm_dsi_panel;
104 #endif
105 #ifdef CONFIG_LCD_SUPPORT_FD055HD003S
106 extern struct __lcd_panel fd055hd003s_panel;
107 #endif
108 #ifdef CONFIG_LCD_SUPPORT_FRD450H40014
109 extern struct __lcd_panel frd450h40014_panel;
110 #endif
111 #ifdef CONFIG_LCD_SUPPORT_H245QBN02
112 extern struct __lcd_panel h245qbn02_panel;
113 #endif
114 #ifdef CONFIG_LCD_SUPPORT_ILI9341
115 extern struct __lcd_panel ili9341_panel;
116 #endif
117 #ifdef CONFIG_LCD_SUPPORT_LH219WQ1
118 extern struct __lcd_panel lh219wq1_panel;
119 #endif
120 #ifdef CONFIG_LCD_SUPPORT_ST7789V
121 extern struct __lcd_panel st7789v_panel;
122 #endif
123 #ifdef CONFIG_LCD_SUPPORT_ST7796S
124 extern struct __lcd_panel st7796s_panel;
125 #endif
126 #ifdef CONFIG_LCD_SUPPORT_ST7701S
127 extern struct __lcd_panel st7701s_panel;
128 #endif
129 #ifdef CONFIG_LCD_SUPPORT_T30P106
130 extern struct __lcd_panel t30p106_panel;
131 #endif
132 #ifdef CONFIG_LCD_SUPPORT_TO20T20000
133 extern struct __lcd_panel to20t20000_panel;
134 #endif
135 #ifdef CONFIG_LCD_SUPPORT_S2003T46G
136 extern struct __lcd_panel s2003t46g_panel;
137 #endif
138 #ifdef CONFIG_LCD_SUPPORT_WTL096601G03
139 extern struct __lcd_panel wtl096601g03_panel;
140 #endif
141 #ifdef CONFIG_LCD_SUPPORT_RT13QV005D
142 extern struct __lcd_panel rt13qv005d_panel;
143 #endif
144 #ifdef CONFIG_LCD_SUPPORT_ST7789V_CPU
145 extern struct __lcd_panel st7789v_cpu_panel;
146 #endif
147 
148 #ifdef CONFIG_LCD_SUPPORT_VVX07H005A10
149 extern struct __lcd_panel VVX07H005A10_panel;
150 #endif
151 
152 #endif
153