blob: 19b880bb43a56a40f003fb46f1c4d2c068bd6bcc [file] [log] [blame]
Chandan Uddaraju78ae6752010-10-19 12:57:10 -07001/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29
30#ifndef _PLATFORM_MSM_SHARED_MIPI_DSI_H_
31#define _PLATFORM_MSM_SHARED_MIPI_DSI_H_
32
33#define PASS 0
34#define FAIL 1
35
Chandan Uddarajufe93e822010-11-21 20:44:47 -080036#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
37
38#define MIPI_DSI_BASE (0x04700000)
39
Chandan Uddaraju78ae6752010-10-19 12:57:10 -070040#define DSI_CLKOUT_TIMING_CTRL (0x047000C0)
41#define MMSS_DSI_PIXEL_MD (0x04000134)
42#define MMSS_DSI_PIXEL_NS (0x04000138)
43#define MMSS_DSI_PIXEL_CC (0x04000130)
44#define MMSS_DSI_CC (0x0400004C)
45#define MMSS_DSI_MD (0x04000050)
46#define MMSS_DSI_NS (0x04000054)
47#define MMSS_MISC_CC2 (0x0400005C)
48#define MMSS_MISC_CC (0x04000058)
49#define DSI_PHY_SW_RESET (0x04700128)
50#define DSI_SOFT_RESET (0x04700114)
51#define DSI_CAL_CTRL (0x047000F4)
52
53#define DSIPHY_REGULATOR_CTRL_0 (0x047002CC)
54#define DSIPHY_REGULATOR_CTRL_1 (0x047002D0)
55#define DSIPHY_REGULATOR_CTRL_2 (0x047002D4)
56#define DSIPHY_REGULATOR_CTRL_3 (0x047002D8)
57
58#define DSIPHY_TIMING_CTRL_0 (0x04700260)
59#define DSIPHY_TIMING_CTRL_1 (0x04700264)
60#define DSIPHY_TIMING_CTRL_2 (0x04700268)
61#define DSIPHY_TIMING_CTRL_3 (0x0470026C)
62#define DSIPHY_TIMING_CTRL_4 (0x04700270)
63#define DSIPHY_TIMING_CTRL_5 (0x04700274)
64#define DSIPHY_TIMING_CTRL_6 (0x04700278)
65#define DSIPHY_TIMING_CTRL_7 (0x0470027C)
66#define DSIPHY_TIMING_CTRL_8 (0x04700280)
67#define DSIPHY_TIMING_CTRL_9 (0x04700284)
68#define DSIPHY_TIMING_CTRL_10 (0x04700288)
69
70#define DSIPHY_CTRL_0 (0x04700290)
71#define DSIPHY_CTRL_1 (0x04700294)
72#define DSIPHY_CTRL_2 (0x04700298)
73#define DSIPHY_CTRL_3 (0x0470029C)
74
75#define DSIPHY_STRENGTH_CTRL_0 (0x047002A0)
76#define DSIPHY_STRENGTH_CTRL_1 (0x047002A4)
77#define DSIPHY_STRENGTH_CTRL_2 (0x047002A8)
78#define DSIPHY_STRENGTH_CTRL_3 (0x047002AC)
79
80#define DSIPHY_PLL_CTRL_0 (0x04700200)
81#define DSIPHY_PLL_CTRL_1 (0x04700204)
82#define DSIPHY_PLL_CTRL_2 (0x04700208)
83#define DSIPHY_PLL_CTRL_3 (0x0470020C)
84#define DSIPHY_PLL_CTRL_4 (0x04700210)
85#define DSIPHY_PLL_CTRL_5 (0x04700214)
86#define DSIPHY_PLL_CTRL_6 (0x04700218)
87#define DSIPHY_PLL_CTRL_7 (0x0470021C)
88#define DSIPHY_PLL_CTRL_8 (0x04700220)
89#define DSIPHY_PLL_CTRL_9 (0x04700224)
90#define DSIPHY_PLL_CTRL_10 (0x04700228)
91#define DSIPHY_PLL_CTRL_11 (0x0470022C)
92#define DSIPHY_PLL_CTRL_12 (0x04700230)
93#define DSIPHY_PLL_CTRL_13 (0x04700234)
94#define DSIPHY_PLL_CTRL_14 (0x04700238)
95#define DSIPHY_PLL_CTRL_15 (0x0470023C)
96#define DSIPHY_PLL_CTRL_16 (0x04700240)
97#define DSIPHY_PLL_CTRL_17 (0x04700244)
98#define DSIPHY_PLL_CTRL_18 (0x04700248)
99#define DSIPHY_PLL_CTRL_19 (0x0470024C)
100
101#define DSI_CMD_DMA_MEM_START_ADDR_PANEL (0x46000000)
102
103#define DSI_CLK_CTRL (0x04700118)
104#define DSI_TRIG_CTRL (0x04700080)
105#define DSI_CTRL (0x04700000)
106#define DSI_COMMAND_MODE_DMA_CTRL (0x04700038)
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800107#define DSI_COMMAND_MODE_MDP_CTRL (0x0470003C)
108#define DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL (0x04700040)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700109#define DSI_DMA_CMD_OFFSET (0x04700044)
110#define DSI_DMA_CMD_LENGTH (0x04700048)
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800111#define DSI_COMMAND_MODE_MDP_STREAM0_CTRL (0x04700054)
112#define DSI_COMMAND_MODE_MDP_STREAM0_TOTAL (0x04700058)
113#define DSI_COMMAND_MODE_MDP_STREAM1_CTRL (0x0470005C)
114#define DSI_COMMAND_MODE_MDP_STREAM1_TOTAL (0x04700060)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700115#define DSI_ERR_INT_MASK0 (0x04700108)
116#define DSI_INT_CTRL (0x0470010C)
117
118#define DSI_VIDEO_MODE_ACTIVE_H (0x04700020)
119#define DSI_VIDEO_MODE_ACTIVE_V (0x04700024)
120#define DSI_VIDEO_MODE_TOTAL (0x04700028)
121#define DSI_VIDEO_MODE_HSYNC (0x0470002C)
122#define DSI_VIDEO_MODE_VSYNC (0x04700030)
123#define DSI_VIDEO_MODE_VSYNC_VPOS (0x04700034)
124
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800125#define DSI_MISR_CMD_CTRL (0x0470009C)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700126#define DSI_MISR_VIDEO_CTRL (0x047000A0)
127#define DSI_EOT_PACKET_CTRL (0x047000C8)
128#define DSI_VIDEO_MODE_CTRL (0x0470000C)
129#define DSI_CAL_STRENGTH_CTRL (0x04700100)
130#define DSI_CMD_MODE_DMA_SW_TRIGGER (0x0470008C)
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800131#define DSI_CMD_MODE_MDP_SW_TRIGGER (0x04700090)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700132
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800133#define MDP_OVERLAYPROC0_START (0x05100004)
134#define MDP_DMA_P_START (0x0510000C)
135#define MDP_DMA_S_START (0x05100010)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700136#define MDP_AXI_RDMASTER_CONFIG (0x05100028)
137#define MDP_AXI_WRMASTER_CONFIG (0x05100030)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700138#define MDP_DISP_INTF_SEL (0x05100038)
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800139#define MDP_MAX_RD_PENDING_CMD_CONFIG (0x0510004C)
140#define MDP_INTR_ENABLE (0x05100050)
141#define MDP_DSI_CMD_MODE_ID_MAP (0x051000A0)
142#define MDP_DSI_CMD_MODE_TRIGGER_EN (0x051000A4)
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700143#define MDP_OVERLAYPROC0_CFG (0x05110004)
144#define MDP_DMA_P_CONFIG (0x05190000)
145#define MDP_DMA_P_OUT_XY (0x05190010)
146#define MDP_DMA_P_SIZE (0x05190004)
147#define MDP_DMA_P_BUF_ADDR (0x05190008)
148#define MDP_DMA_P_BUF_Y_STRIDE (0x0519000C)
149#define MDP_DMA_P_OP_MODE (0x05190070)
150#define MDP_DSI_VIDEO_EN (0x051E0000)
151#define MDP_DSI_VIDEO_HSYNC_CTL (0x051E0004)
152#define MDP_DSI_VIDEO_VSYNC_PERIOD (0x051E0008)
153#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH (0x051E000C)
154#define MDP_DSI_VIDEO_DISPLAY_HCTL (0x051E0010)
155#define MDP_DSI_VIDEO_DISPLAY_V_START (0x051E0014)
156#define MDP_DSI_VIDEO_DISPLAY_V_END (0x051E0018)
157#define MDP_DSI_VIDEO_BORDER_CLR (0x051E0028)
158#define MDP_DSI_VIDEO_HSYNC_SKEW (0x051E0030)
159#define MDP_DSI_VIDEO_CTL_POLARITY (0x051E0038)
160#define MDP_DSI_VIDEO_TEST_CTL (0x051E0034)
161
162#define MDP_TEST_MODE_CLK (0x051F0000)
163#define MDP_INTR_STATUS (0x05100054)
164#define MMSS_SFPB_GPREG (0x05700058)
165
Shashank Mittalcbd271d2011-01-14 15:18:33 -0800166#define MIPI_DSI_MRPS 0x04 /* Maximum Return Packet Size */
167#define MIPI_DSI_REG_LEN 16 /* 4 x 4 bytes register */
168
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700169//BEGINNING OF Tochiba Config- video mode
170
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800171static const unsigned char toshiba_panel_mcap_off[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700172 0x02, 0x00, 0x29, 0xc0,
173 0xb2, 0x00, 0xff, 0xff
174};
175
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800176static const unsigned char toshiba_panel_ena_test_reg[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700177 0x03, 0x00, 0x29, 0xc0,
178 0xEF, 0x01, 0x01, 0xff
179};
180
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800181static const unsigned char toshiba_panel_ena_test_reg_wvga[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700182 0x03, 0x00, 0x29, 0xc0,
183 0xEF, 0x01, 0x01, 0xff
184};
185
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800186static const unsigned char toshiba_panel_num_of_2lane[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700187 0x03, 0x00, 0x29, 0xc0, // 63:2lane
188 0xEF, 0x60, 0x63, 0xff
189};
190
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800191static const unsigned char toshiba_panel_num_of_1lane[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700192 0x03, 0x00, 0x29, 0xc0, // 62:1lane
193 0xEF, 0x60, 0x62, 0xff
194};
195
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800196static const unsigned char toshiba_panel_non_burst_sync_pulse[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700197 0x03, 0x00, 0x29, 0xc0,
198 0xef, 0x61, 0x09, 0xff
199};
200
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800201static const unsigned char toshiba_panel_set_DMODE_WQVGA[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700202 0x02, 0x00, 0x29, 0xc0,
203 0xB3, 0x01, 0xFF, 0xff
204};
205
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800206static const unsigned char toshiba_panel_set_DMODE_WVGA[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700207 0x02, 0x00, 0x29, 0xc0,
208 0xB3, 0x00, 0xFF, 0xff
209};
210
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800211static const unsigned char toshiba_panel_set_intern_WR_clk1_wvga[8]
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700212 = {
213
214 0x03, 0x00, 0x29, 0xC0, // 1 last packet
215 0xef, 0x2f, 0xcc, 0xff,
216};
217
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800218static const unsigned char toshiba_panel_set_intern_WR_clk2_wvga[8]
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700219 = {
220
221 0x03, 0x00, 0x29, 0xC0, // 1 last packet
222 0xef, 0x6e, 0xdd, 0xff,
223};
224
225static const unsigned char
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800226 toshiba_panel_set_intern_WR_clk1_wqvga[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700227
228 0x03, 0x00, 0x29, 0xC0, // 1 last packet
229 0xef, 0x2f, 0x22, 0xff,
230};
231
232static const unsigned char
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800233 toshiba_panel_set_intern_WR_clk2_wqvga[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700234
235 0x03, 0x00, 0x29, 0xC0, // 1 last packet
236 0xef, 0x6e, 0x33, 0xff,
237};
238
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800239static const unsigned char toshiba_panel_set_hor_addr_2A_wvga[12] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700240
241 0x05, 0x00, 0x39, 0xC0, // 1 last packet
242 // 0x2A, 0x00, 0x08, 0x00,//100 = 64h
243 // 0x6b, 0xFF, 0xFF, 0xFF,
244 0x2A, 0x00, 0x00, 0x01, // 0X1DF = 480-1 0X13F = 320-1
245 0xdf, 0xFF, 0xFF, 0xFF,
246};
247
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800248static const unsigned char toshiba_panel_set_hor_addr_2B_wvga[12] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700249
250 0x05, 0x00, 0x39, 0xC0, // 1 last packet
251 // 0x2B, 0x00, 0x08, 0x00,//0X355 = 854-1; 0X1DF = 480-1
252 // 0x6b, 0xFF, 0xFF, 0xFF,
253 0x2B, 0x00, 0x00, 0x03, // 0X355 = 854-1; 0X1DF = 480-1
254 0x55, 0xFF, 0xFF, 0xFF,
255};
256
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800257static const unsigned char toshiba_panel_set_hor_addr_2A_wqvga[12]
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700258 = {
259
260 0x05, 0x00, 0x39, 0xC0, // 1 last packet
261 0x2A, 0x00, 0x00, 0x00, // 0XEF = 240-1
262 0xef, 0xFF, 0xFF, 0xFF,
263};
264
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800265static const unsigned char toshiba_panel_set_hor_addr_2B_wqvga[12]
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700266 = {
267
268 0x05, 0x00, 0x39, 0xC0, // 1 last packet
269 0x2B, 0x00, 0x00, 0x01, // 0X1aa = 427-1;
270 0xaa, 0xFF, 0xFF, 0xFF,
271};
272
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800273static const unsigned char toshiba_panel_IFSEL[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700274 0x02, 0x00, 0x29, 0xc0,
275 0x53, 0x01, 0xff, 0xff
276};
277
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800278static const unsigned char toshiba_panel_IFSEL_cmd_mode[8] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700279 0x02, 0x00, 0x29, 0xc0,
280 0x53, 0x00, 0xff, 0xff
281};
282
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800283static const unsigned char toshiba_panel_exit_sleep[4] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700284 0x11, 0x00, 0x05, 0x80, // 25 Reg 0x29 < Display On>; generic write 1
285 // params
286};
287
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800288static const unsigned char toshiba_panel_display_on[4] = {
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700289 // 0x29, 0x00, 0x05, 0x80,//25 Reg 0x29 < Display On>; generic write 1
290 // params
291 0x29, 0x00, 0x05, 0x80, // 25 Reg 0x29 < Display On>; generic write 1
292 // params
293};
294
295//color mode off
296static const unsigned char dsi_display_config_color_mode_off[4] = {
297 0x00, 0x00, 0x02, 0x80,
298};
299
300//color mode on
301static const unsigned char dsi_display_config_color_mode_on[4] = {
302 0x00, 0x00, 0x12, 0x80,
303};
304
305//the end OF Tochiba Config- video mode
306
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800307/* NOVATEK BLUE panel */
308static char novatek_panel_sw_reset[4] = {0x01, 0x00, 0x05, 0x00}; /* DTYPE_DCS_WRITE */
309static char novatek_panel_enter_sleep[4] = {0x10, 0x00, 0x05, 0x80}; /* DTYPE_DCS_WRITE */
310static char novatek_panel_exit_sleep[4] = {0x11, 0x00, 0x05, 0x80}; /* DTYPE_DCS_WRITE */
311static char novatek_panel_display_off[4] = {0x28, 0x00, 0x05, 0x80}; /* DTYPE_DCS_WRITE */
312static char novatek_panel_display_on[4] = {0x29, 0x00, 0x05, 0x80}; /* DTYPE_DCS_WRITE */
Shashank Mittalcbd271d2011-01-14 15:18:33 -0800313static char novatek_panel_max_packet[4] = {0x04, 0x00, 0x37, 0x80}; /* DTYPE_SET_MAX_PACKET */
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800314
315static char novatek_panel_set_onelane[4] = {0xae, 0x01, 0x15, 0x80}; /* DTYPE_DCS_WRITE1 */
316static char novatek_panel_rgb_888[4] = {0x3A, 0x77, 0x15, 0x80}; /* DTYPE_DCS_WRITE1 */
317static char novatek_panel_set_twolane[4] = {0xae, 0x03, 0x15, 0x80}; /* DTYPE_DCS_WRITE1 */
318
Shashank Mittalcbd271d2011-01-14 15:18:33 -0800319static char novatek_panel_manufacture_id[4] = {0x04, 0x00, 0x06, 0xA0}; /* DTYPE_DCS_READ */
320
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800321/* commands by Novatke */
322static char novatek_panel_f4[4] = {0xf4, 0x55, 0x15, 0x80}; /* DTYPE_DCS_WRITE1 */
323static char novatek_panel_8c[20] = { /* DTYPE_DCS_LWRITE */
324 0x10, 0x00, 0x39, 0xC0, 0x8C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
325 0x00, 0x08, 0x08, 0x00, 0x30, 0xC0, 0xB7, 0x37};
326static char novatek_panel_ff[4] = {0xff, 0x55, 0x15, 0x80}; /* DTYPE_DCS_WRITE1 */
327
328static char novatek_panel_set_width[12] = { /* DTYPE_DCS_LWRITE */
329 0x05, 0x00, 0x39, 0xC0,//1 last packet
330 0x2A, 0x00, 0x00, 0x02,//clmn:0 - 0x21B=539
331 0x1B, 0xFF, 0xFF, 0xFF
332}; /* 540 - 1 */
333static char novatek_panel_set_height[12] = { /* DTYPE_DCS_LWRITE */
334 0x05, 0x00, 0x39, 0xC0,//1 last packet
335 0x2B, 0x00, 0x00, 0x03,//row:0 - 0x3BF=959
336 0xBF, 0xFF, 0xFF, 0xFF,
337}; /* 960 - 1 */
338/* End of Novatek Blue panel commands */
339
340
341#define MIPI_VIDEO_MODE 1
342#define MIPI_CMD_MODE 2
343
344struct mipi_dsi_phy_ctrl {
345 uint32_t regulator[4];
346 uint32_t timing[12];
347 uint32_t ctrl[4];
348 uint32_t strength[4];
349 uint32_t pll[21];
350};
351
352struct mipi_dsi_cmd {
353 int size;
354 char *payload;
355};
356
357struct mipi_dsi_panel_config {
358 char mode;
359 char num_of_lanes;
360 struct mipi_dsi_phy_ctrl *dsi_phy_config;
361 struct mipi_dsi_cmd *panel_cmds;
362 int num_of_panel_cmds;
363};
364
365static struct mipi_dsi_cmd toshiba_panel_video_mode_cmds[] = {
366 {sizeof(toshiba_panel_mcap_off), toshiba_panel_mcap_off},
367 {sizeof(toshiba_panel_ena_test_reg), toshiba_panel_ena_test_reg},
368 {sizeof(toshiba_panel_num_of_1lane), toshiba_panel_num_of_1lane},
369 {sizeof(toshiba_panel_non_burst_sync_pulse), toshiba_panel_non_burst_sync_pulse},
370 {sizeof(toshiba_panel_set_DMODE_WVGA), toshiba_panel_set_DMODE_WVGA},
371 {sizeof(toshiba_panel_set_intern_WR_clk1_wvga), toshiba_panel_set_intern_WR_clk1_wvga},
372 {sizeof(toshiba_panel_set_intern_WR_clk2_wvga), toshiba_panel_set_intern_WR_clk2_wvga},
373 {sizeof(toshiba_panel_set_hor_addr_2A_wvga), toshiba_panel_set_hor_addr_2A_wvga},
374 {sizeof(toshiba_panel_set_hor_addr_2B_wvga), toshiba_panel_set_hor_addr_2B_wvga},
375 {sizeof(toshiba_panel_IFSEL), toshiba_panel_IFSEL},
376 {sizeof(toshiba_panel_exit_sleep), toshiba_panel_exit_sleep},
377 {sizeof(toshiba_panel_display_on), toshiba_panel_display_on},
378 {sizeof(dsi_display_config_color_mode_on), dsi_display_config_color_mode_on},
379 {sizeof(dsi_display_config_color_mode_off), dsi_display_config_color_mode_off},
380};
381
382static struct mipi_dsi_phy_ctrl mipi_dsi_toshiba_panel_phy_ctrl = {
383 /* 480*854, RGB888, 1 Lane 60 fps video mode */
384 {0x03, 0x01, 0x01, 0x00}, /* regulator */
385 /* timing */
386 {0x50, 0x0f, 0x14, 0x19, 0x23, 0x0e, 0x12, 0x16,
387 0x1b, 0x1c, 0x04},
388 {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */
389 {0xee, 0x03, 0x86, 0x03}, /* strength */
390 /* pll control */
391
392#if defined(DSI_BIT_CLK_366MHZ)
393 {0x41, 0xdb, 0xb2, 0xf5, 0x00, 0x50, 0x48, 0x63,
394 0x31, 0x0f, 0x07,
395 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 },
396#elif defined(DSI_BIT_CLK_380MHZ)
397 {0x41, 0xf7, 0xb2, 0xf5, 0x00, 0x50, 0x48, 0x63,
398 0x31, 0x0f, 0x07,
399 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 },
400#elif defined(DSI_BIT_CLK_400MHZ)
401 {0x41, 0x8f, 0xb1, 0xda, 0x00, 0x50, 0x48, 0x63,
402 0x31, 0x0f, 0x07,
403 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 },
404#else /* 200 mhz */
405 {0x41, 0x8f, 0xb1, 0xda, 0x00, 0x50, 0x48, 0x63,
406 0x33, 0x1f, 0x1f /* for 1 lane ; 0x0f for 2 lanes*/,
407 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 },
408#endif
409};
410
Shashank Mittalcbd271d2011-01-14 15:18:33 -0800411static struct mipi_dsi_cmd novatek_panel_manufacture_id_cmd =
412 {sizeof(novatek_panel_manufacture_id), novatek_panel_manufacture_id};
413
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800414static struct mipi_dsi_cmd novatek_panel_cmd_mode_cmds[] = {
415 {sizeof(novatek_panel_sw_reset), novatek_panel_sw_reset},
416 {sizeof(novatek_panel_exit_sleep), novatek_panel_exit_sleep},
417 {sizeof(novatek_panel_display_on), novatek_panel_display_on},
Shashank Mittalcbd271d2011-01-14 15:18:33 -0800418 {sizeof(novatek_panel_max_packet), novatek_panel_max_packet},
Chandan Uddarajufe93e822010-11-21 20:44:47 -0800419 {sizeof(novatek_panel_f4), novatek_panel_f4},
420 {sizeof(novatek_panel_8c), novatek_panel_8c},
421 {sizeof(novatek_panel_ff), novatek_panel_ff},
422 {sizeof(novatek_panel_set_twolane), novatek_panel_set_twolane},
423 {sizeof(novatek_panel_set_width), novatek_panel_set_width},
424 {sizeof(novatek_panel_set_height), novatek_panel_set_height},
425 {sizeof(novatek_panel_rgb_888), novatek_panel_rgb_888}
426};
427
428static struct mipi_dsi_phy_ctrl mipi_dsi_novatek_panel_phy_ctrl = {
429 /* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
430 {0x03, 0x01, 0x01, 0x00}, /* regulator */
431 /* timing */
432 {0x96, 0x26, 0x23, 0x00, 0x50, 0x4B, 0x1e,
433 0x28, 0x28, 0x03, 0x04},
434 {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */
435 {0xee, 0x02, 0x86, 0x00}, /* strength */
436 /* pll control */
437 {0x40, 0xf9, 0xb0, 0xda, 0x00, 0x50, 0x48, 0x63,
438 /* 0x30, 0x07, 0x07, --> One lane configuration */
439 0x30, 0x07, 0x03, /* --> Two lane configuration */
440 0x05, 0x14, 0x03, 0x0, 0x0, 0x54, 0x06, 0x10, 0x04, 0x0},
441};
442
443struct mipi_dsi_panel_config toshiba_panel_info = {
444 .mode = MIPI_VIDEO_MODE,
445 .num_of_lanes = 1,
446 .dsi_phy_config = &mipi_dsi_toshiba_panel_phy_ctrl,
447 .panel_cmds = toshiba_panel_video_mode_cmds,
448 .num_of_panel_cmds = ARRAY_SIZE(toshiba_panel_video_mode_cmds),
449};
450
451struct mipi_dsi_panel_config novatek_panel_info = {
452 .mode = MIPI_CMD_MODE,
453 .num_of_lanes = 2,
454 .dsi_phy_config = &mipi_dsi_novatek_panel_phy_ctrl,
455 .panel_cmds = novatek_panel_cmd_mode_cmds,
456 .num_of_panel_cmds = ARRAY_SIZE(novatek_panel_cmd_mode_cmds),
457};
458
Chandan Uddaraju78ae6752010-10-19 12:57:10 -0700459#endif