xref: /rk3399_rockchip-uboot/include/mipi_display.h (revision a92bdacccc2618a4682820c07546173ffa74b21c)
1ebe079bcSSiarhei Siamashka /*
2ebe079bcSSiarhei Siamashka  * Defines for Mobile Industry Processor Interface (MIPI(R))
3ebe079bcSSiarhei Siamashka  * Display Working Group standards: DSI, DCS, DBI, DPI
4ebe079bcSSiarhei Siamashka  *
5ebe079bcSSiarhei Siamashka  * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
6ebe079bcSSiarhei Siamashka  * Copyright (C) 2006 Nokia Corporation
7ebe079bcSSiarhei Siamashka  * Author: Imre Deak <imre.deak@nokia.com>
8ebe079bcSSiarhei Siamashka  *
9ebe079bcSSiarhei Siamashka  * This program is free software; you can redistribute it and/or modify
10ebe079bcSSiarhei Siamashka  * it under the terms of the GNU General Public License version 2 as
11ebe079bcSSiarhei Siamashka  * published by the Free Software Foundation.
12ebe079bcSSiarhei Siamashka  */
13ebe079bcSSiarhei Siamashka #ifndef MIPI_DISPLAY_H
14ebe079bcSSiarhei Siamashka #define MIPI_DISPLAY_H
15ebe079bcSSiarhei Siamashka 
16ebe079bcSSiarhei Siamashka /* MIPI DSI Processor-to-Peripheral transaction types */
17ebe079bcSSiarhei Siamashka enum {
18ebe079bcSSiarhei Siamashka 	MIPI_DSI_V_SYNC_START				= 0x01,
19ebe079bcSSiarhei Siamashka 	MIPI_DSI_V_SYNC_END				= 0x11,
20ebe079bcSSiarhei Siamashka 	MIPI_DSI_H_SYNC_START				= 0x21,
21ebe079bcSSiarhei Siamashka 	MIPI_DSI_H_SYNC_END				= 0x31,
22ebe079bcSSiarhei Siamashka 
23*a92bdaccSGuochun Huang 	MIPI_DSI_COMPRESSION_MODE			= 0x07,
24*a92bdaccSGuochun Huang 
25ebe079bcSSiarhei Siamashka 	MIPI_DSI_COLOR_MODE_OFF				= 0x02,
26ebe079bcSSiarhei Siamashka 	MIPI_DSI_COLOR_MODE_ON				= 0x12,
27ebe079bcSSiarhei Siamashka 	MIPI_DSI_SHUTDOWN_PERIPHERAL			= 0x22,
28ebe079bcSSiarhei Siamashka 	MIPI_DSI_TURN_ON_PERIPHERAL			= 0x32,
29ebe079bcSSiarhei Siamashka 
30ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM		= 0x03,
31ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM		= 0x13,
32ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM		= 0x23,
33ebe079bcSSiarhei Siamashka 
34ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM		= 0x04,
35ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM		= 0x14,
36ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM		= 0x24,
37ebe079bcSSiarhei Siamashka 
38ebe079bcSSiarhei Siamashka 	MIPI_DSI_DCS_SHORT_WRITE			= 0x05,
39ebe079bcSSiarhei Siamashka 	MIPI_DSI_DCS_SHORT_WRITE_PARAM			= 0x15,
40ebe079bcSSiarhei Siamashka 
41ebe079bcSSiarhei Siamashka 	MIPI_DSI_DCS_READ				= 0x06,
42ebe079bcSSiarhei Siamashka 
43ebe079bcSSiarhei Siamashka 	MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE		= 0x37,
44ebe079bcSSiarhei Siamashka 
45ebe079bcSSiarhei Siamashka 	MIPI_DSI_END_OF_TRANSMISSION			= 0x08,
46ebe079bcSSiarhei Siamashka 
47ebe079bcSSiarhei Siamashka 	MIPI_DSI_NULL_PACKET				= 0x09,
48ebe079bcSSiarhei Siamashka 	MIPI_DSI_BLANKING_PACKET			= 0x19,
49ebe079bcSSiarhei Siamashka 	MIPI_DSI_GENERIC_LONG_WRITE			= 0x29,
50ebe079bcSSiarhei Siamashka 	MIPI_DSI_DCS_LONG_WRITE				= 0x39,
51ebe079bcSSiarhei Siamashka 
52*a92bdaccSGuochun Huang 	MIPI_DSI_PICTURE_PARAMETER_SET			= 0x0a,
53*a92bdaccSGuochun Huang 	MIPI_DSI_COMPRESSED_PIXEL_STREAM		= 0x0b,
54*a92bdaccSGuochun Huang 
55ebe079bcSSiarhei Siamashka 	MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20	= 0x0c,
56ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24		= 0x1c,
57ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16		= 0x2c,
58ebe079bcSSiarhei Siamashka 
59ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_30			= 0x0d,
60ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_36			= 0x1d,
61ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12		= 0x3d,
62ebe079bcSSiarhei Siamashka 
63ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_16			= 0x0e,
64ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_18			= 0x1e,
65ebe079bcSSiarhei Siamashka 	MIPI_DSI_PIXEL_STREAM_3BYTE_18			= 0x2e,
66ebe079bcSSiarhei Siamashka 	MIPI_DSI_PACKED_PIXEL_STREAM_24			= 0x3e,
67ebe079bcSSiarhei Siamashka };
68ebe079bcSSiarhei Siamashka 
69ebe079bcSSiarhei Siamashka /* MIPI DSI Peripheral-to-Processor transaction types */
70ebe079bcSSiarhei Siamashka enum {
71ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT	= 0x02,
72ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_END_OF_TRANSMISSION			= 0x08,
73ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE	= 0x11,
74ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE	= 0x12,
75ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE		= 0x1a,
76ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_DCS_LONG_READ_RESPONSE		= 0x1c,
77ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE	= 0x21,
78ebe079bcSSiarhei Siamashka 	MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE	= 0x22,
79ebe079bcSSiarhei Siamashka };
80ebe079bcSSiarhei Siamashka 
81ebe079bcSSiarhei Siamashka /* MIPI DCS commands */
82ebe079bcSSiarhei Siamashka enum {
83ebe079bcSSiarhei Siamashka 	MIPI_DCS_NOP			= 0x00,
84ebe079bcSSiarhei Siamashka 	MIPI_DCS_SOFT_RESET		= 0x01,
85ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_DISPLAY_ID		= 0x04,
86ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_RED_CHANNEL	= 0x06,
87ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_GREEN_CHANNEL	= 0x07,
88ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_BLUE_CHANNEL	= 0x08,
89ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_DISPLAY_STATUS	= 0x09,
90ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_POWER_MODE		= 0x0A,
91ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_ADDRESS_MODE	= 0x0B,
92ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_PIXEL_FORMAT	= 0x0C,
93ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_DISPLAY_MODE	= 0x0D,
94ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_SIGNAL_MODE	= 0x0E,
95ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_DIAGNOSTIC_RESULT	= 0x0F,
96ebe079bcSSiarhei Siamashka 	MIPI_DCS_ENTER_SLEEP_MODE	= 0x10,
97ebe079bcSSiarhei Siamashka 	MIPI_DCS_EXIT_SLEEP_MODE	= 0x11,
98ebe079bcSSiarhei Siamashka 	MIPI_DCS_ENTER_PARTIAL_MODE	= 0x12,
99ebe079bcSSiarhei Siamashka 	MIPI_DCS_ENTER_NORMAL_MODE	= 0x13,
100ebe079bcSSiarhei Siamashka 	MIPI_DCS_EXIT_INVERT_MODE	= 0x20,
101ebe079bcSSiarhei Siamashka 	MIPI_DCS_ENTER_INVERT_MODE	= 0x21,
102ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_GAMMA_CURVE	= 0x26,
103ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_DISPLAY_OFF	= 0x28,
104ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_DISPLAY_ON		= 0x29,
105ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_COLUMN_ADDRESS	= 0x2A,
106ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_PAGE_ADDRESS	= 0x2B,
107ebe079bcSSiarhei Siamashka 	MIPI_DCS_WRITE_MEMORY_START	= 0x2C,
108ebe079bcSSiarhei Siamashka 	MIPI_DCS_WRITE_LUT		= 0x2D,
109ebe079bcSSiarhei Siamashka 	MIPI_DCS_READ_MEMORY_START	= 0x2E,
110ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_PARTIAL_AREA	= 0x30,
111ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_SCROLL_AREA	= 0x33,
112ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_TEAR_OFF		= 0x34,
113ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_TEAR_ON		= 0x35,
114ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_ADDRESS_MODE	= 0x36,
115ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_SCROLL_START	= 0x37,
116ebe079bcSSiarhei Siamashka 	MIPI_DCS_EXIT_IDLE_MODE		= 0x38,
117ebe079bcSSiarhei Siamashka 	MIPI_DCS_ENTER_IDLE_MODE	= 0x39,
118ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_PIXEL_FORMAT	= 0x3A,
119ebe079bcSSiarhei Siamashka 	MIPI_DCS_WRITE_MEMORY_CONTINUE	= 0x3C,
120ebe079bcSSiarhei Siamashka 	MIPI_DCS_READ_MEMORY_CONTINUE	= 0x3E,
121ebe079bcSSiarhei Siamashka 	MIPI_DCS_SET_TEAR_SCANLINE	= 0x44,
122ebe079bcSSiarhei Siamashka 	MIPI_DCS_GET_SCANLINE		= 0x45,
123c5bb939dSWyon Bi 	MIPI_DCS_SET_DISPLAY_BRIGHTNESS	= 0x51,		/* MIPI DCS 1.3 */
124c5bb939dSWyon Bi 	MIPI_DCS_GET_DISPLAY_BRIGHTNESS	= 0x52,		/* MIPI DCS 1.3 */
125c5bb939dSWyon Bi 	MIPI_DCS_WRITE_CONTROL_DISPLAY	= 0x53,		/* MIPI DCS 1.3 */
126c5bb939dSWyon Bi 	MIPI_DCS_GET_CONTROL_DISPLAY	= 0x54,		/* MIPI DCS 1.3 */
127c5bb939dSWyon Bi 	MIPI_DCS_WRITE_POWER_SAVE	= 0x55,		/* MIPI DCS 1.3 */
128c5bb939dSWyon Bi 	MIPI_DCS_GET_POWER_SAVE		= 0x56,		/* MIPI DCS 1.3 */
129c5bb939dSWyon Bi 	MIPI_DCS_SET_CABC_MIN_BRIGHTNESS = 0x5E,	/* MIPI DCS 1.3 */
130c5bb939dSWyon Bi 	MIPI_DCS_GET_CABC_MIN_BRIGHTNESS = 0x5F,	/* MIPI DCS 1.3 */
131ebe079bcSSiarhei Siamashka 	MIPI_DCS_READ_DDB_START		= 0xA1,
132ebe079bcSSiarhei Siamashka 	MIPI_DCS_READ_DDB_CONTINUE	= 0xA8,
133ebe079bcSSiarhei Siamashka };
134ebe079bcSSiarhei Siamashka 
135ebe079bcSSiarhei Siamashka /* MIPI DCS pixel formats */
136ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_24BIT	7
137ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_18BIT	6
138ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_16BIT	5
139ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_12BIT	3
140ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_8BIT		2
141ebe079bcSSiarhei Siamashka #define MIPI_DCS_PIXEL_FMT_3BIT		1
142ebe079bcSSiarhei Siamashka 
143ebe079bcSSiarhei Siamashka #endif
144