xref: /openbmc/linux/include/drm/bridge/mhl.h (revision ead5d1f4d877e92c051e1a1ade623d0d30e71619)
1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
200c635e5SAndrzej Hajda /*
300c635e5SAndrzej Hajda  * Defines for Mobile High-Definition Link (MHL) interface
400c635e5SAndrzej Hajda  *
500c635e5SAndrzej Hajda  * Copyright (C) 2015, Samsung Electronics, Co., Ltd.
600c635e5SAndrzej Hajda  * Andrzej Hajda <a.hajda@samsung.com>
700c635e5SAndrzej Hajda  *
800c635e5SAndrzej Hajda  * Based on MHL driver for Android devices.
900c635e5SAndrzej Hajda  * Copyright (C) 2013-2014 Silicon Image, Inc.
1000c635e5SAndrzej Hajda  */
1100c635e5SAndrzej Hajda 
1200c635e5SAndrzej Hajda #ifndef __MHL_H__
1300c635e5SAndrzej Hajda #define __MHL_H__
1400c635e5SAndrzej Hajda 
15981b3f37SAndrzej Hajda #include <linux/types.h>
16981b3f37SAndrzej Hajda 
1700c635e5SAndrzej Hajda /* Device Capabilities Registers */
1800c635e5SAndrzej Hajda enum {
1900c635e5SAndrzej Hajda 	MHL_DCAP_DEV_STATE,
2000c635e5SAndrzej Hajda 	MHL_DCAP_MHL_VERSION,
2100c635e5SAndrzej Hajda 	MHL_DCAP_CAT,
2200c635e5SAndrzej Hajda 	MHL_DCAP_ADOPTER_ID_H,
2300c635e5SAndrzej Hajda 	MHL_DCAP_ADOPTER_ID_L,
2400c635e5SAndrzej Hajda 	MHL_DCAP_VID_LINK_MODE,
2500c635e5SAndrzej Hajda 	MHL_DCAP_AUD_LINK_MODE,
2600c635e5SAndrzej Hajda 	MHL_DCAP_VIDEO_TYPE,
2700c635e5SAndrzej Hajda 	MHL_DCAP_LOG_DEV_MAP,
2800c635e5SAndrzej Hajda 	MHL_DCAP_BANDWIDTH,
2900c635e5SAndrzej Hajda 	MHL_DCAP_FEATURE_FLAG,
3000c635e5SAndrzej Hajda 	MHL_DCAP_DEVICE_ID_H,
3100c635e5SAndrzej Hajda 	MHL_DCAP_DEVICE_ID_L,
3200c635e5SAndrzej Hajda 	MHL_DCAP_SCRATCHPAD_SIZE,
3300c635e5SAndrzej Hajda 	MHL_DCAP_INT_STAT_SIZE,
3400c635e5SAndrzej Hajda 	MHL_DCAP_RESERVED,
3500c635e5SAndrzej Hajda 	MHL_DCAP_SIZE
3600c635e5SAndrzej Hajda };
3700c635e5SAndrzej Hajda 
3800c635e5SAndrzej Hajda #define MHL_DCAP_CAT_SINK			0x01
3900c635e5SAndrzej Hajda #define MHL_DCAP_CAT_SOURCE			0x02
4000c635e5SAndrzej Hajda #define MHL_DCAP_CAT_POWER			0x10
4100c635e5SAndrzej Hajda #define MHL_DCAP_CAT_PLIM(x)			((x) << 5)
4200c635e5SAndrzej Hajda 
4300c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_RGB444		0x01
4400c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_YCBCR444		0x02
4500c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_YCBCR422		0x04
4600c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_PPIXEL		0x08
4700c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_ISLANDS		0x10
4800c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_VGA			0x20
4900c635e5SAndrzej Hajda #define MHL_DCAP_VID_LINK_16BPP			0x40
5000c635e5SAndrzej Hajda 
5100c635e5SAndrzej Hajda #define MHL_DCAP_AUD_LINK_2CH			0x01
5200c635e5SAndrzej Hajda #define MHL_DCAP_AUD_LINK_8CH			0x02
5300c635e5SAndrzej Hajda 
5400c635e5SAndrzej Hajda #define MHL_DCAP_VT_GRAPHICS			0x00
5500c635e5SAndrzej Hajda #define MHL_DCAP_VT_PHOTO			0x02
5600c635e5SAndrzej Hajda #define MHL_DCAP_VT_CINEMA			0x04
5700c635e5SAndrzej Hajda #define MHL_DCAP_VT_GAMES			0x08
5800c635e5SAndrzej Hajda #define MHL_DCAP_SUPP_VT			0x80
5900c635e5SAndrzej Hajda 
6000c635e5SAndrzej Hajda #define MHL_DCAP_LD_DISPLAY			0x01
6100c635e5SAndrzej Hajda #define MHL_DCAP_LD_VIDEO			0x02
6200c635e5SAndrzej Hajda #define MHL_DCAP_LD_AUDIO			0x04
6300c635e5SAndrzej Hajda #define MHL_DCAP_LD_MEDIA			0x08
6400c635e5SAndrzej Hajda #define MHL_DCAP_LD_TUNER			0x10
6500c635e5SAndrzej Hajda #define MHL_DCAP_LD_RECORD			0x20
6600c635e5SAndrzej Hajda #define MHL_DCAP_LD_SPEAKER			0x40
6700c635e5SAndrzej Hajda #define MHL_DCAP_LD_GUI				0x80
6800c635e5SAndrzej Hajda #define MHL_DCAP_LD_ALL				0xFF
6900c635e5SAndrzej Hajda 
7000c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_RCP_SUPPORT		0x01
7100c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_RAP_SUPPORT		0x02
7200c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_SP_SUPPORT		0x04
7300c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_UCP_SEND_SUPPOR	0x08
7400c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_UCP_RECV_SUPPORT	0x10
7500c635e5SAndrzej Hajda #define MHL_DCAP_FEATURE_RBP_SUPPORT		0x40
7600c635e5SAndrzej Hajda 
7700c635e5SAndrzej Hajda /* Extended Device Capabilities Registers */
7800c635e5SAndrzej Hajda enum {
7900c635e5SAndrzej Hajda 	MHL_XDC_ECBUS_SPEEDS,
8000c635e5SAndrzej Hajda 	MHL_XDC_TMDS_SPEEDS,
8100c635e5SAndrzej Hajda 	MHL_XDC_ECBUS_ROLES,
8200c635e5SAndrzej Hajda 	MHL_XDC_LOG_DEV_MAPX,
8300c635e5SAndrzej Hajda 	MHL_XDC_SIZE
8400c635e5SAndrzej Hajda };
8500c635e5SAndrzej Hajda 
8600c635e5SAndrzej Hajda #define MHL_XDC_ECBUS_S_075			0x01
8700c635e5SAndrzej Hajda #define MHL_XDC_ECBUS_S_8BIT			0x02
8800c635e5SAndrzej Hajda #define MHL_XDC_ECBUS_S_12BIT			0x04
8900c635e5SAndrzej Hajda #define MHL_XDC_ECBUS_D_150			0x10
9000c635e5SAndrzej Hajda #define MHL_XDC_ECBUS_D_8BIT			0x20
9100c635e5SAndrzej Hajda 
9200c635e5SAndrzej Hajda #define MHL_XDC_TMDS_000			0x00
9300c635e5SAndrzej Hajda #define MHL_XDC_TMDS_150			0x01
9400c635e5SAndrzej Hajda #define MHL_XDC_TMDS_300			0x02
9500c635e5SAndrzej Hajda #define MHL_XDC_TMDS_600			0x04
9600c635e5SAndrzej Hajda 
9700c635e5SAndrzej Hajda /* MHL_XDC_ECBUS_ROLES flags */
9800c635e5SAndrzej Hajda #define MHL_XDC_DEV_HOST			0x01
9900c635e5SAndrzej Hajda #define MHL_XDC_DEV_DEVICE			0x02
10000c635e5SAndrzej Hajda #define MHL_XDC_DEV_CHARGER			0x04
10100c635e5SAndrzej Hajda #define MHL_XDC_HID_HOST			0x08
10200c635e5SAndrzej Hajda #define MHL_XDC_HID_DEVICE			0x10
10300c635e5SAndrzej Hajda 
10400c635e5SAndrzej Hajda /* MHL_XDC_LOG_DEV_MAPX flags */
10500c635e5SAndrzej Hajda #define MHL_XDC_LD_PHONE			0x01
10600c635e5SAndrzej Hajda 
10700c635e5SAndrzej Hajda /* Device Status Registers */
10800c635e5SAndrzej Hajda enum {
10900c635e5SAndrzej Hajda 	MHL_DST_CONNECTED_RDY,
11000c635e5SAndrzej Hajda 	MHL_DST_LINK_MODE,
11100c635e5SAndrzej Hajda 	MHL_DST_VERSION,
11200c635e5SAndrzej Hajda 	MHL_DST_SIZE
11300c635e5SAndrzej Hajda };
11400c635e5SAndrzej Hajda 
11500c635e5SAndrzej Hajda /* Offset of DEVSTAT registers */
11600c635e5SAndrzej Hajda #define MHL_DST_OFFSET				0x30
11700c635e5SAndrzej Hajda #define MHL_DST_REG(name) (MHL_DST_OFFSET + MHL_DST_##name)
11800c635e5SAndrzej Hajda 
11900c635e5SAndrzej Hajda #define MHL_DST_CONN_DCAP_RDY			0x01
12000c635e5SAndrzej Hajda #define MHL_DST_CONN_XDEVCAPP_SUPP		0x02
12100c635e5SAndrzej Hajda #define MHL_DST_CONN_POW_STAT			0x04
12200c635e5SAndrzej Hajda #define MHL_DST_CONN_PLIM_STAT_MASK		0x38
12300c635e5SAndrzej Hajda 
12400c635e5SAndrzej Hajda #define MHL_DST_LM_CLK_MODE_MASK		0x07
12500c635e5SAndrzej Hajda #define MHL_DST_LM_CLK_MODE_PACKED_PIXEL	0x02
12600c635e5SAndrzej Hajda #define MHL_DST_LM_CLK_MODE_NORMAL		0x03
12700c635e5SAndrzej Hajda #define MHL_DST_LM_PATH_EN_MASK			0x08
12800c635e5SAndrzej Hajda #define MHL_DST_LM_PATH_ENABLED			0x08
12900c635e5SAndrzej Hajda #define MHL_DST_LM_PATH_DISABLED		0x00
13000c635e5SAndrzej Hajda #define MHL_DST_LM_MUTED_MASK			0x10
13100c635e5SAndrzej Hajda 
13200c635e5SAndrzej Hajda /* Extended Device Status Registers */
13300c635e5SAndrzej Hajda enum {
13400c635e5SAndrzej Hajda 	MHL_XDS_CURR_ECBUS_MODE,
13500c635e5SAndrzej Hajda 	MHL_XDS_AVLINK_MODE_STATUS,
13600c635e5SAndrzej Hajda 	MHL_XDS_AVLINK_MODE_CONTROL,
13700c635e5SAndrzej Hajda 	MHL_XDS_MULTI_SINK_STATUS,
13800c635e5SAndrzej Hajda 	MHL_XDS_SIZE
13900c635e5SAndrzej Hajda };
14000c635e5SAndrzej Hajda 
14100c635e5SAndrzej Hajda /* Offset of XDEVSTAT registers */
14200c635e5SAndrzej Hajda #define MHL_XDS_OFFSET				0x90
14300c635e5SAndrzej Hajda #define MHL_XDS_REG(name) (MHL_XDS_OFFSET + MHL_XDS_##name)
14400c635e5SAndrzej Hajda 
14500c635e5SAndrzej Hajda /* MHL_XDS_REG_CURR_ECBUS_MODE flags */
14600c635e5SAndrzej Hajda #define MHL_XDS_SLOT_MODE_8BIT			0x00
14700c635e5SAndrzej Hajda #define MHL_XDS_SLOT_MODE_6BIT			0x01
14800c635e5SAndrzej Hajda #define MHL_XDS_ECBUS_S				0x04
14900c635e5SAndrzej Hajda #define MHL_XDS_ECBUS_D				0x08
15000c635e5SAndrzej Hajda 
15100c635e5SAndrzej Hajda #define MHL_XDS_LINK_CLOCK_75MHZ		0x00
15200c635e5SAndrzej Hajda #define MHL_XDS_LINK_CLOCK_150MHZ		0x10
15300c635e5SAndrzej Hajda #define MHL_XDS_LINK_CLOCK_300MHZ		0x20
15400c635e5SAndrzej Hajda #define MHL_XDS_LINK_CLOCK_600MHZ		0x30
15500c635e5SAndrzej Hajda 
15600c635e5SAndrzej Hajda #define MHL_XDS_LINK_STATUS_NO_SIGNAL		0x00
15700c635e5SAndrzej Hajda #define MHL_XDS_LINK_STATUS_CRU_LOCKED		0x01
15800c635e5SAndrzej Hajda #define MHL_XDS_LINK_STATUS_TMDS_NORMAL		0x02
15900c635e5SAndrzej Hajda #define MHL_XDS_LINK_STATUS_TMDS_RESERVED	0x03
16000c635e5SAndrzej Hajda 
16100c635e5SAndrzej Hajda #define MHL_XDS_LINK_RATE_1_5_GBPS		0x00
16200c635e5SAndrzej Hajda #define MHL_XDS_LINK_RATE_3_0_GBPS		0x01
16300c635e5SAndrzej Hajda #define MHL_XDS_LINK_RATE_6_0_GBPS		0x02
16400c635e5SAndrzej Hajda #define MHL_XDS_ATT_CAPABLE			0x08
16500c635e5SAndrzej Hajda 
16600c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_1_HPD_LOW		0x00
16700c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_1_HPD_HIGH		0x01
16800c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_2_HPD_LOW		0x00
16900c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_2_HPD_HIGH		0x04
17000c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_3_HPD_LOW		0x00
17100c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_3_HPD_HIGH		0x10
17200c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_4_HPD_LOW		0x00
17300c635e5SAndrzej Hajda #define MHL_XDS_SINK_STATUS_4_HPD_HIGH		0x40
17400c635e5SAndrzej Hajda 
17500c635e5SAndrzej Hajda /* Interrupt Registers */
17600c635e5SAndrzej Hajda enum {
17700c635e5SAndrzej Hajda 	MHL_INT_RCHANGE,
17800c635e5SAndrzej Hajda 	MHL_INT_DCHANGE,
17900c635e5SAndrzej Hajda 	MHL_INT_SIZE
18000c635e5SAndrzej Hajda };
18100c635e5SAndrzej Hajda 
18200c635e5SAndrzej Hajda /* Offset of DEVSTAT registers */
18300c635e5SAndrzej Hajda #define MHL_INT_OFFSET				0x20
18400c635e5SAndrzej Hajda #define MHL_INT_REG(name) (MHL_INT_OFFSET + MHL_INT_##name)
18500c635e5SAndrzej Hajda 
18600c635e5SAndrzej Hajda #define	MHL_INT_RC_DCAP_CHG			0x01
18700c635e5SAndrzej Hajda #define MHL_INT_RC_DSCR_CHG			0x02
18800c635e5SAndrzej Hajda #define MHL_INT_RC_REQ_WRT			0x04
18900c635e5SAndrzej Hajda #define MHL_INT_RC_GRT_WRT			0x08
19000c635e5SAndrzej Hajda #define MHL_INT_RC_3D_REQ			0x10
19100c635e5SAndrzej Hajda #define MHL_INT_RC_FEAT_REQ			0x20
19200c635e5SAndrzej Hajda #define MHL_INT_RC_FEAT_COMPLETE		0x40
19300c635e5SAndrzej Hajda 
19400c635e5SAndrzej Hajda #define MHL_INT_DC_EDID_CHG			0x02
19500c635e5SAndrzej Hajda 
19600c635e5SAndrzej Hajda enum {
19700c635e5SAndrzej Hajda 	MHL_ACK = 0x33, /* Command or Data byte acknowledge */
19800c635e5SAndrzej Hajda 	MHL_NACK = 0x34, /* Command or Data byte not acknowledge */
19900c635e5SAndrzej Hajda 	MHL_ABORT = 0x35, /* Transaction abort */
20000c635e5SAndrzej Hajda 	MHL_WRITE_STAT = 0xe0, /* Write one status register */
20100c635e5SAndrzej Hajda 	MHL_SET_INT = 0x60, /* Write one interrupt register */
20200c635e5SAndrzej Hajda 	MHL_READ_DEVCAP_REG = 0x61, /* Read one register */
20300c635e5SAndrzej Hajda 	MHL_GET_STATE = 0x62, /* Read CBUS revision level from follower */
20400c635e5SAndrzej Hajda 	MHL_GET_VENDOR_ID = 0x63, /* Read vendor ID value from follower */
20500c635e5SAndrzej Hajda 	MHL_SET_HPD = 0x64, /* Set Hot Plug Detect in follower */
20600c635e5SAndrzej Hajda 	MHL_CLR_HPD = 0x65, /* Clear Hot Plug Detect in follower */
20700c635e5SAndrzej Hajda 	MHL_SET_CAP_ID = 0x66, /* Set Capture ID for downstream device */
20800c635e5SAndrzej Hajda 	MHL_GET_CAP_ID = 0x67, /* Get Capture ID from downstream device */
20900c635e5SAndrzej Hajda 	MHL_MSC_MSG = 0x68, /* VS command to send RCP sub-commands */
21000c635e5SAndrzej Hajda 	MHL_GET_SC1_ERRORCODE = 0x69, /* Get Vendor-Specific error code */
21100c635e5SAndrzej Hajda 	MHL_GET_DDC_ERRORCODE = 0x6A, /* Get DDC channel command error code */
21200c635e5SAndrzej Hajda 	MHL_GET_MSC_ERRORCODE = 0x6B, /* Get MSC command error code */
21300c635e5SAndrzej Hajda 	MHL_WRITE_BURST = 0x6C, /* Write 1-16 bytes to responder's scratchpad */
21400c635e5SAndrzej Hajda 	MHL_GET_SC3_ERRORCODE = 0x6D, /* Get channel 3 command error code */
21500c635e5SAndrzej Hajda 	MHL_WRITE_XSTAT = 0x70, /* Write one extended status register */
21600c635e5SAndrzej Hajda 	MHL_READ_XDEVCAP_REG = 0x71, /* Read one extended devcap register */
21700c635e5SAndrzej Hajda 	/* let the rest of these float, they are software specific */
21800c635e5SAndrzej Hajda 	MHL_READ_EDID_BLOCK,
21900c635e5SAndrzej Hajda 	MHL_SEND_3D_REQ_OR_FEAT_REQ,
22000c635e5SAndrzej Hajda 	MHL_READ_DEVCAP,
22100c635e5SAndrzej Hajda 	MHL_READ_XDEVCAP
22200c635e5SAndrzej Hajda };
22300c635e5SAndrzej Hajda 
22400c635e5SAndrzej Hajda /* MSC message types */
22500c635e5SAndrzej Hajda enum {
22600c635e5SAndrzej Hajda 	MHL_MSC_MSG_RCP = 0x10, /* RCP sub-command */
22700c635e5SAndrzej Hajda 	MHL_MSC_MSG_RCPK = 0x11, /* RCP Acknowledge sub-command */
22800c635e5SAndrzej Hajda 	MHL_MSC_MSG_RCPE = 0x12, /* RCP Error sub-command */
22900c635e5SAndrzej Hajda 	MHL_MSC_MSG_RAP = 0x20, /* Mode Change Warning sub-command */
23000c635e5SAndrzej Hajda 	MHL_MSC_MSG_RAPK = 0x21, /* MCW Acknowledge sub-command */
23100c635e5SAndrzej Hajda 	MHL_MSC_MSG_RBP = 0x22, /* Remote Button Protocol sub-command */
23200c635e5SAndrzej Hajda 	MHL_MSC_MSG_RBPK = 0x23, /* RBP Acknowledge sub-command */
23300c635e5SAndrzej Hajda 	MHL_MSC_MSG_RBPE = 0x24, /* RBP Error sub-command */
23400c635e5SAndrzej Hajda 	MHL_MSC_MSG_UCP = 0x30, /* UCP sub-command */
23500c635e5SAndrzej Hajda 	MHL_MSC_MSG_UCPK = 0x31, /* UCP Acknowledge sub-command */
23600c635e5SAndrzej Hajda 	MHL_MSC_MSG_UCPE = 0x32, /* UCP Error sub-command */
23700c635e5SAndrzej Hajda 	MHL_MSC_MSG_RUSB = 0x40, /* Request USB host role */
23800c635e5SAndrzej Hajda 	MHL_MSC_MSG_RUSBK = 0x41, /* Acknowledge request for USB host role */
23900c635e5SAndrzej Hajda 	MHL_MSC_MSG_RHID = 0x42, /* Request HID host role */
24000c635e5SAndrzej Hajda 	MHL_MSC_MSG_RHIDK = 0x43, /* Acknowledge request for HID host role */
24100c635e5SAndrzej Hajda 	MHL_MSC_MSG_ATT = 0x50, /* Request attention sub-command */
24200c635e5SAndrzej Hajda 	MHL_MSC_MSG_ATTK = 0x51, /* ATT Acknowledge sub-command */
24300c635e5SAndrzej Hajda 	MHL_MSC_MSG_BIST_TRIGGER = 0x60,
24400c635e5SAndrzej Hajda 	MHL_MSC_MSG_BIST_REQUEST_STAT = 0x61,
24500c635e5SAndrzej Hajda 	MHL_MSC_MSG_BIST_READY = 0x62,
24600c635e5SAndrzej Hajda 	MHL_MSC_MSG_BIST_STOP = 0x63,
24700c635e5SAndrzej Hajda };
24800c635e5SAndrzej Hajda 
24900c635e5SAndrzej Hajda /* RAP action codes */
25000c635e5SAndrzej Hajda #define MHL_RAP_POLL		0x00	/* Just do an ack */
25100c635e5SAndrzej Hajda #define MHL_RAP_CONTENT_ON	0x10	/* Turn content stream ON */
25200c635e5SAndrzej Hajda #define MHL_RAP_CONTENT_OFF	0x11	/* Turn content stream OFF */
25300c635e5SAndrzej Hajda #define MHL_RAP_CBUS_MODE_DOWN	0x20
25400c635e5SAndrzej Hajda #define MHL_RAP_CBUS_MODE_UP	0x21
25500c635e5SAndrzej Hajda 
25600c635e5SAndrzej Hajda /* RAPK status codes */
25700c635e5SAndrzej Hajda #define MHL_RAPK_NO_ERR		0x00	/* RAP action recognized & supported */
25800c635e5SAndrzej Hajda #define MHL_RAPK_UNRECOGNIZED	0x01	/* Unknown RAP action code received */
25900c635e5SAndrzej Hajda #define MHL_RAPK_UNSUPPORTED	0x02	/* Rcvd RAP action code not supported */
26000c635e5SAndrzej Hajda #define MHL_RAPK_BUSY		0x03	/* Responder too busy to respond */
26100c635e5SAndrzej Hajda 
262e25f1f7cSMaciej Purski /* Bit masks for RCP messages */
263e25f1f7cSMaciej Purski #define MHL_RCP_KEY_RELEASED_MASK	0x80
264e25f1f7cSMaciej Purski #define MHL_RCP_KEY_ID_MASK		0x7F
265e25f1f7cSMaciej Purski 
26600c635e5SAndrzej Hajda /*
26700c635e5SAndrzej Hajda  * Error status codes for RCPE messages
26800c635e5SAndrzej Hajda  */
26900c635e5SAndrzej Hajda /* No error. (Not allowed in RCPE messages) */
27000c635e5SAndrzej Hajda #define MHL_RCPE_STATUS_NO_ERROR		0x00
27100c635e5SAndrzej Hajda /* Unsupported/unrecognized key code */
27200c635e5SAndrzej Hajda #define MHL_RCPE_STATUS_INEFFECTIVE_KEY_CODE	0x01
27300c635e5SAndrzej Hajda /* Responder busy. Initiator may retry message */
27400c635e5SAndrzej Hajda #define MHL_RCPE_STATUS_BUSY			0x02
27500c635e5SAndrzej Hajda 
27600c635e5SAndrzej Hajda /*
27700c635e5SAndrzej Hajda  * Error status codes for RBPE messages
27800c635e5SAndrzej Hajda  */
27900c635e5SAndrzej Hajda /* No error. (Not allowed in RBPE messages) */
28000c635e5SAndrzej Hajda #define MHL_RBPE_STATUS_NO_ERROR		0x00
28100c635e5SAndrzej Hajda /* Unsupported/unrecognized button code */
28200c635e5SAndrzej Hajda #define MHL_RBPE_STATUS_INEFFECTIVE_BUTTON_CODE	0x01
28300c635e5SAndrzej Hajda /* Responder busy. Initiator may retry message */
28400c635e5SAndrzej Hajda #define MHL_RBPE_STATUS_BUSY			0x02
28500c635e5SAndrzej Hajda 
28600c635e5SAndrzej Hajda /*
28700c635e5SAndrzej Hajda  * Error status codes for UCPE messages
28800c635e5SAndrzej Hajda  */
28900c635e5SAndrzej Hajda /* No error. (Not allowed in UCPE messages) */
29000c635e5SAndrzej Hajda #define MHL_UCPE_STATUS_NO_ERROR		0x00
29100c635e5SAndrzej Hajda /* Unsupported/unrecognized key code */
29200c635e5SAndrzej Hajda #define MHL_UCPE_STATUS_INEFFECTIVE_KEY_CODE	0x01
29300c635e5SAndrzej Hajda 
294981b3f37SAndrzej Hajda enum mhl_burst_id {
295981b3f37SAndrzej Hajda 	MHL_BURST_ID_3D_VIC = 0x10,
296981b3f37SAndrzej Hajda 	MHL_BURST_ID_3D_DTD = 0x11,
297981b3f37SAndrzej Hajda 	MHL_BURST_ID_HEV_VIC = 0x20,
298981b3f37SAndrzej Hajda 	MHL_BURST_ID_HEV_DTDA = 0x21,
299981b3f37SAndrzej Hajda 	MHL_BURST_ID_HEV_DTDB = 0x22,
300981b3f37SAndrzej Hajda 	MHL_BURST_ID_VC_ASSIGN = 0x38,
301981b3f37SAndrzej Hajda 	MHL_BURST_ID_VC_CONFIRM = 0x39,
302981b3f37SAndrzej Hajda 	MHL_BURST_ID_AUD_DELAY = 0x40,
303981b3f37SAndrzej Hajda 	MHL_BURST_ID_ADT_BURSTID = 0x41,
304981b3f37SAndrzej Hajda 	MHL_BURST_ID_BIST_SETUP = 0x51,
305981b3f37SAndrzej Hajda 	MHL_BURST_ID_BIST_RETURN_STAT = 0x52,
306981b3f37SAndrzej Hajda 	MHL_BURST_ID_EMSC_SUPPORT = 0x61,
307981b3f37SAndrzej Hajda 	MHL_BURST_ID_HID_PAYLOAD = 0x62,
308981b3f37SAndrzej Hajda 	MHL_BURST_ID_BLK_RCV_BUFFER_INFO = 0x63,
309981b3f37SAndrzej Hajda 	MHL_BURST_ID_BITS_PER_PIXEL_FMT = 0x64,
310981b3f37SAndrzej Hajda };
311981b3f37SAndrzej Hajda 
312981b3f37SAndrzej Hajda struct mhl_burst_blk_rcv_buffer_info {
313981b3f37SAndrzej Hajda 	__be16 id;
314981b3f37SAndrzej Hajda 	__le16 size;
315981b3f37SAndrzej Hajda } __packed;
316981b3f37SAndrzej Hajda 
317981b3f37SAndrzej Hajda struct mhl3_burst_header {
318981b3f37SAndrzej Hajda 	__be16 id;
319981b3f37SAndrzej Hajda 	u8 checksum;
320981b3f37SAndrzej Hajda 	u8 total_entries;
321981b3f37SAndrzej Hajda 	u8 sequence_index;
322981b3f37SAndrzej Hajda } __packed;
323981b3f37SAndrzej Hajda 
324981b3f37SAndrzej Hajda struct mhl_burst_bits_per_pixel_fmt {
325981b3f37SAndrzej Hajda 	struct mhl3_burst_header hdr;
326981b3f37SAndrzej Hajda 	u8 num_entries;
327981b3f37SAndrzej Hajda 	struct {
328981b3f37SAndrzej Hajda 		u8 stream_id;
329981b3f37SAndrzej Hajda 		u8 pixel_format;
330*78a7b61aSGustavo A. R. Silva 	} __packed desc[];
331981b3f37SAndrzej Hajda } __packed;
332981b3f37SAndrzej Hajda 
333981b3f37SAndrzej Hajda struct mhl_burst_emsc_support {
334981b3f37SAndrzej Hajda 	struct mhl3_burst_header hdr;
335981b3f37SAndrzej Hajda 	u8 num_entries;
336*78a7b61aSGustavo A. R. Silva 	__be16 burst_id[];
337981b3f37SAndrzej Hajda } __packed;
338981b3f37SAndrzej Hajda 
339981b3f37SAndrzej Hajda struct mhl_burst_audio_descr {
340981b3f37SAndrzej Hajda 	struct mhl3_burst_header hdr;
341981b3f37SAndrzej Hajda 	u8 flags;
342981b3f37SAndrzej Hajda 	u8 short_desc[9];
343981b3f37SAndrzej Hajda } __packed;
344981b3f37SAndrzej Hajda 
345be1cd6feSAndrzej Hajda /*
346be1cd6feSAndrzej Hajda  * MHL3 infoframe related definitions
347be1cd6feSAndrzej Hajda  */
348be1cd6feSAndrzej Hajda 
349be1cd6feSAndrzej Hajda #define MHL3_IEEE_OUI		0x7ca61d
350be1cd6feSAndrzej Hajda #define MHL3_INFOFRAME_SIZE	15
351be1cd6feSAndrzej Hajda 
352be1cd6feSAndrzej Hajda enum mhl3_video_format {
353be1cd6feSAndrzej Hajda 	MHL3_VIDEO_FORMAT_NONE,
354be1cd6feSAndrzej Hajda 	MHL3_VIDEO_FORMAT_3D,
355be1cd6feSAndrzej Hajda 	MHL3_VIDEO_FORMAT_MULTI_VIEW,
356be1cd6feSAndrzej Hajda 	MHL3_VIDEO_FORMAT_DUAL_3D
357be1cd6feSAndrzej Hajda };
358be1cd6feSAndrzej Hajda 
359be1cd6feSAndrzej Hajda enum mhl3_3d_format_type {
360be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_FS, /* frame sequential */
361be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_TB, /* top-bottom */
362be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_LR, /* left-right */
363be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_FS_TB, /* frame sequential, top-bottom */
364be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_FS_LR, /* frame sequential, left-right */
365be1cd6feSAndrzej Hajda 	MHL3_3D_FORMAT_TYPE_TB_LR /* top-bottom, left-right */
366be1cd6feSAndrzej Hajda };
367be1cd6feSAndrzej Hajda 
368be1cd6feSAndrzej Hajda struct mhl3_infoframe {
369be1cd6feSAndrzej Hajda 	unsigned char version;
370be1cd6feSAndrzej Hajda 	enum mhl3_video_format video_format;
371be1cd6feSAndrzej Hajda 	enum mhl3_3d_format_type format_type;
372be1cd6feSAndrzej Hajda 	bool sep_audio;
373be1cd6feSAndrzej Hajda 	int hev_format;
374be1cd6feSAndrzej Hajda 	int av_delay;
375be1cd6feSAndrzej Hajda };
376be1cd6feSAndrzej Hajda 
37700c635e5SAndrzej Hajda #endif /* __MHL_H__ */
378