xref: /kernel/linux/linux-5.10/include/drm/bridge/mhl.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Defines for Mobile High-Definition Link (MHL) interface
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2015, Samsung Electronics, Co., Ltd.
68c2ecf20Sopenharmony_ci * Andrzej Hajda <a.hajda@samsung.com>
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Based on MHL driver for Android devices.
98c2ecf20Sopenharmony_ci * Copyright (C) 2013-2014 Silicon Image, Inc.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef __MHL_H__
138c2ecf20Sopenharmony_ci#define __MHL_H__
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/types.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* Device Capabilities Registers */
188c2ecf20Sopenharmony_cienum {
198c2ecf20Sopenharmony_ci	MHL_DCAP_DEV_STATE,
208c2ecf20Sopenharmony_ci	MHL_DCAP_MHL_VERSION,
218c2ecf20Sopenharmony_ci	MHL_DCAP_CAT,
228c2ecf20Sopenharmony_ci	MHL_DCAP_ADOPTER_ID_H,
238c2ecf20Sopenharmony_ci	MHL_DCAP_ADOPTER_ID_L,
248c2ecf20Sopenharmony_ci	MHL_DCAP_VID_LINK_MODE,
258c2ecf20Sopenharmony_ci	MHL_DCAP_AUD_LINK_MODE,
268c2ecf20Sopenharmony_ci	MHL_DCAP_VIDEO_TYPE,
278c2ecf20Sopenharmony_ci	MHL_DCAP_LOG_DEV_MAP,
288c2ecf20Sopenharmony_ci	MHL_DCAP_BANDWIDTH,
298c2ecf20Sopenharmony_ci	MHL_DCAP_FEATURE_FLAG,
308c2ecf20Sopenharmony_ci	MHL_DCAP_DEVICE_ID_H,
318c2ecf20Sopenharmony_ci	MHL_DCAP_DEVICE_ID_L,
328c2ecf20Sopenharmony_ci	MHL_DCAP_SCRATCHPAD_SIZE,
338c2ecf20Sopenharmony_ci	MHL_DCAP_INT_STAT_SIZE,
348c2ecf20Sopenharmony_ci	MHL_DCAP_RESERVED,
358c2ecf20Sopenharmony_ci	MHL_DCAP_SIZE
368c2ecf20Sopenharmony_ci};
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define MHL_DCAP_CAT_SINK			0x01
398c2ecf20Sopenharmony_ci#define MHL_DCAP_CAT_SOURCE			0x02
408c2ecf20Sopenharmony_ci#define MHL_DCAP_CAT_POWER			0x10
418c2ecf20Sopenharmony_ci#define MHL_DCAP_CAT_PLIM(x)			((x) << 5)
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_RGB444		0x01
448c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_YCBCR444		0x02
458c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_YCBCR422		0x04
468c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_PPIXEL		0x08
478c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_ISLANDS		0x10
488c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_VGA			0x20
498c2ecf20Sopenharmony_ci#define MHL_DCAP_VID_LINK_16BPP			0x40
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define MHL_DCAP_AUD_LINK_2CH			0x01
528c2ecf20Sopenharmony_ci#define MHL_DCAP_AUD_LINK_8CH			0x02
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define MHL_DCAP_VT_GRAPHICS			0x00
558c2ecf20Sopenharmony_ci#define MHL_DCAP_VT_PHOTO			0x02
568c2ecf20Sopenharmony_ci#define MHL_DCAP_VT_CINEMA			0x04
578c2ecf20Sopenharmony_ci#define MHL_DCAP_VT_GAMES			0x08
588c2ecf20Sopenharmony_ci#define MHL_DCAP_SUPP_VT			0x80
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_DISPLAY			0x01
618c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_VIDEO			0x02
628c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_AUDIO			0x04
638c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_MEDIA			0x08
648c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_TUNER			0x10
658c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_RECORD			0x20
668c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_SPEAKER			0x40
678c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_GUI				0x80
688c2ecf20Sopenharmony_ci#define MHL_DCAP_LD_ALL				0xFF
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_RCP_SUPPORT		0x01
718c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_RAP_SUPPORT		0x02
728c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_SP_SUPPORT		0x04
738c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_UCP_SEND_SUPPOR	0x08
748c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_UCP_RECV_SUPPORT	0x10
758c2ecf20Sopenharmony_ci#define MHL_DCAP_FEATURE_RBP_SUPPORT		0x40
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* Extended Device Capabilities Registers */
788c2ecf20Sopenharmony_cienum {
798c2ecf20Sopenharmony_ci	MHL_XDC_ECBUS_SPEEDS,
808c2ecf20Sopenharmony_ci	MHL_XDC_TMDS_SPEEDS,
818c2ecf20Sopenharmony_ci	MHL_XDC_ECBUS_ROLES,
828c2ecf20Sopenharmony_ci	MHL_XDC_LOG_DEV_MAPX,
838c2ecf20Sopenharmony_ci	MHL_XDC_SIZE
848c2ecf20Sopenharmony_ci};
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define MHL_XDC_ECBUS_S_075			0x01
878c2ecf20Sopenharmony_ci#define MHL_XDC_ECBUS_S_8BIT			0x02
888c2ecf20Sopenharmony_ci#define MHL_XDC_ECBUS_S_12BIT			0x04
898c2ecf20Sopenharmony_ci#define MHL_XDC_ECBUS_D_150			0x10
908c2ecf20Sopenharmony_ci#define MHL_XDC_ECBUS_D_8BIT			0x20
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define MHL_XDC_TMDS_000			0x00
938c2ecf20Sopenharmony_ci#define MHL_XDC_TMDS_150			0x01
948c2ecf20Sopenharmony_ci#define MHL_XDC_TMDS_300			0x02
958c2ecf20Sopenharmony_ci#define MHL_XDC_TMDS_600			0x04
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/* MHL_XDC_ECBUS_ROLES flags */
988c2ecf20Sopenharmony_ci#define MHL_XDC_DEV_HOST			0x01
998c2ecf20Sopenharmony_ci#define MHL_XDC_DEV_DEVICE			0x02
1008c2ecf20Sopenharmony_ci#define MHL_XDC_DEV_CHARGER			0x04
1018c2ecf20Sopenharmony_ci#define MHL_XDC_HID_HOST			0x08
1028c2ecf20Sopenharmony_ci#define MHL_XDC_HID_DEVICE			0x10
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* MHL_XDC_LOG_DEV_MAPX flags */
1058c2ecf20Sopenharmony_ci#define MHL_XDC_LD_PHONE			0x01
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/* Device Status Registers */
1088c2ecf20Sopenharmony_cienum {
1098c2ecf20Sopenharmony_ci	MHL_DST_CONNECTED_RDY,
1108c2ecf20Sopenharmony_ci	MHL_DST_LINK_MODE,
1118c2ecf20Sopenharmony_ci	MHL_DST_VERSION,
1128c2ecf20Sopenharmony_ci	MHL_DST_SIZE
1138c2ecf20Sopenharmony_ci};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci/* Offset of DEVSTAT registers */
1168c2ecf20Sopenharmony_ci#define MHL_DST_OFFSET				0x30
1178c2ecf20Sopenharmony_ci#define MHL_DST_REG(name) (MHL_DST_OFFSET + MHL_DST_##name)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define MHL_DST_CONN_DCAP_RDY			0x01
1208c2ecf20Sopenharmony_ci#define MHL_DST_CONN_XDEVCAPP_SUPP		0x02
1218c2ecf20Sopenharmony_ci#define MHL_DST_CONN_POW_STAT			0x04
1228c2ecf20Sopenharmony_ci#define MHL_DST_CONN_PLIM_STAT_MASK		0x38
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#define MHL_DST_LM_CLK_MODE_MASK		0x07
1258c2ecf20Sopenharmony_ci#define MHL_DST_LM_CLK_MODE_PACKED_PIXEL	0x02
1268c2ecf20Sopenharmony_ci#define MHL_DST_LM_CLK_MODE_NORMAL		0x03
1278c2ecf20Sopenharmony_ci#define MHL_DST_LM_PATH_EN_MASK			0x08
1288c2ecf20Sopenharmony_ci#define MHL_DST_LM_PATH_ENABLED			0x08
1298c2ecf20Sopenharmony_ci#define MHL_DST_LM_PATH_DISABLED		0x00
1308c2ecf20Sopenharmony_ci#define MHL_DST_LM_MUTED_MASK			0x10
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* Extended Device Status Registers */
1338c2ecf20Sopenharmony_cienum {
1348c2ecf20Sopenharmony_ci	MHL_XDS_CURR_ECBUS_MODE,
1358c2ecf20Sopenharmony_ci	MHL_XDS_AVLINK_MODE_STATUS,
1368c2ecf20Sopenharmony_ci	MHL_XDS_AVLINK_MODE_CONTROL,
1378c2ecf20Sopenharmony_ci	MHL_XDS_MULTI_SINK_STATUS,
1388c2ecf20Sopenharmony_ci	MHL_XDS_SIZE
1398c2ecf20Sopenharmony_ci};
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci/* Offset of XDEVSTAT registers */
1428c2ecf20Sopenharmony_ci#define MHL_XDS_OFFSET				0x90
1438c2ecf20Sopenharmony_ci#define MHL_XDS_REG(name) (MHL_XDS_OFFSET + MHL_XDS_##name)
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci/* MHL_XDS_REG_CURR_ECBUS_MODE flags */
1468c2ecf20Sopenharmony_ci#define MHL_XDS_SLOT_MODE_8BIT			0x00
1478c2ecf20Sopenharmony_ci#define MHL_XDS_SLOT_MODE_6BIT			0x01
1488c2ecf20Sopenharmony_ci#define MHL_XDS_ECBUS_S				0x04
1498c2ecf20Sopenharmony_ci#define MHL_XDS_ECBUS_D				0x08
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_CLOCK_75MHZ		0x00
1528c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_CLOCK_150MHZ		0x10
1538c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_CLOCK_300MHZ		0x20
1548c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_CLOCK_600MHZ		0x30
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_STATUS_NO_SIGNAL		0x00
1578c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_STATUS_CRU_LOCKED		0x01
1588c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_STATUS_TMDS_NORMAL		0x02
1598c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_STATUS_TMDS_RESERVED	0x03
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_RATE_1_5_GBPS		0x00
1628c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_RATE_3_0_GBPS		0x01
1638c2ecf20Sopenharmony_ci#define MHL_XDS_LINK_RATE_6_0_GBPS		0x02
1648c2ecf20Sopenharmony_ci#define MHL_XDS_ATT_CAPABLE			0x08
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_1_HPD_LOW		0x00
1678c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_1_HPD_HIGH		0x01
1688c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_2_HPD_LOW		0x00
1698c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_2_HPD_HIGH		0x04
1708c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_3_HPD_LOW		0x00
1718c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_3_HPD_HIGH		0x10
1728c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_4_HPD_LOW		0x00
1738c2ecf20Sopenharmony_ci#define MHL_XDS_SINK_STATUS_4_HPD_HIGH		0x40
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci/* Interrupt Registers */
1768c2ecf20Sopenharmony_cienum {
1778c2ecf20Sopenharmony_ci	MHL_INT_RCHANGE,
1788c2ecf20Sopenharmony_ci	MHL_INT_DCHANGE,
1798c2ecf20Sopenharmony_ci	MHL_INT_SIZE
1808c2ecf20Sopenharmony_ci};
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci/* Offset of DEVSTAT registers */
1838c2ecf20Sopenharmony_ci#define MHL_INT_OFFSET				0x20
1848c2ecf20Sopenharmony_ci#define MHL_INT_REG(name) (MHL_INT_OFFSET + MHL_INT_##name)
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci#define	MHL_INT_RC_DCAP_CHG			0x01
1878c2ecf20Sopenharmony_ci#define MHL_INT_RC_DSCR_CHG			0x02
1888c2ecf20Sopenharmony_ci#define MHL_INT_RC_REQ_WRT			0x04
1898c2ecf20Sopenharmony_ci#define MHL_INT_RC_GRT_WRT			0x08
1908c2ecf20Sopenharmony_ci#define MHL_INT_RC_3D_REQ			0x10
1918c2ecf20Sopenharmony_ci#define MHL_INT_RC_FEAT_REQ			0x20
1928c2ecf20Sopenharmony_ci#define MHL_INT_RC_FEAT_COMPLETE		0x40
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define MHL_INT_DC_EDID_CHG			0x02
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_cienum {
1978c2ecf20Sopenharmony_ci	MHL_ACK = 0x33, /* Command or Data byte acknowledge */
1988c2ecf20Sopenharmony_ci	MHL_NACK = 0x34, /* Command or Data byte not acknowledge */
1998c2ecf20Sopenharmony_ci	MHL_ABORT = 0x35, /* Transaction abort */
2008c2ecf20Sopenharmony_ci	MHL_WRITE_STAT = 0xe0, /* Write one status register */
2018c2ecf20Sopenharmony_ci	MHL_SET_INT = 0x60, /* Write one interrupt register */
2028c2ecf20Sopenharmony_ci	MHL_READ_DEVCAP_REG = 0x61, /* Read one register */
2038c2ecf20Sopenharmony_ci	MHL_GET_STATE = 0x62, /* Read CBUS revision level from follower */
2048c2ecf20Sopenharmony_ci	MHL_GET_VENDOR_ID = 0x63, /* Read vendor ID value from follower */
2058c2ecf20Sopenharmony_ci	MHL_SET_HPD = 0x64, /* Set Hot Plug Detect in follower */
2068c2ecf20Sopenharmony_ci	MHL_CLR_HPD = 0x65, /* Clear Hot Plug Detect in follower */
2078c2ecf20Sopenharmony_ci	MHL_SET_CAP_ID = 0x66, /* Set Capture ID for downstream device */
2088c2ecf20Sopenharmony_ci	MHL_GET_CAP_ID = 0x67, /* Get Capture ID from downstream device */
2098c2ecf20Sopenharmony_ci	MHL_MSC_MSG = 0x68, /* VS command to send RCP sub-commands */
2108c2ecf20Sopenharmony_ci	MHL_GET_SC1_ERRORCODE = 0x69, /* Get Vendor-Specific error code */
2118c2ecf20Sopenharmony_ci	MHL_GET_DDC_ERRORCODE = 0x6A, /* Get DDC channel command error code */
2128c2ecf20Sopenharmony_ci	MHL_GET_MSC_ERRORCODE = 0x6B, /* Get MSC command error code */
2138c2ecf20Sopenharmony_ci	MHL_WRITE_BURST = 0x6C, /* Write 1-16 bytes to responder's scratchpad */
2148c2ecf20Sopenharmony_ci	MHL_GET_SC3_ERRORCODE = 0x6D, /* Get channel 3 command error code */
2158c2ecf20Sopenharmony_ci	MHL_WRITE_XSTAT = 0x70, /* Write one extended status register */
2168c2ecf20Sopenharmony_ci	MHL_READ_XDEVCAP_REG = 0x71, /* Read one extended devcap register */
2178c2ecf20Sopenharmony_ci	/* let the rest of these float, they are software specific */
2188c2ecf20Sopenharmony_ci	MHL_READ_EDID_BLOCK,
2198c2ecf20Sopenharmony_ci	MHL_SEND_3D_REQ_OR_FEAT_REQ,
2208c2ecf20Sopenharmony_ci	MHL_READ_DEVCAP,
2218c2ecf20Sopenharmony_ci	MHL_READ_XDEVCAP
2228c2ecf20Sopenharmony_ci};
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci/* MSC message types */
2258c2ecf20Sopenharmony_cienum {
2268c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RCP = 0x10, /* RCP sub-command */
2278c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RCPK = 0x11, /* RCP Acknowledge sub-command */
2288c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RCPE = 0x12, /* RCP Error sub-command */
2298c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RAP = 0x20, /* Mode Change Warning sub-command */
2308c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RAPK = 0x21, /* MCW Acknowledge sub-command */
2318c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RBP = 0x22, /* Remote Button Protocol sub-command */
2328c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RBPK = 0x23, /* RBP Acknowledge sub-command */
2338c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RBPE = 0x24, /* RBP Error sub-command */
2348c2ecf20Sopenharmony_ci	MHL_MSC_MSG_UCP = 0x30, /* UCP sub-command */
2358c2ecf20Sopenharmony_ci	MHL_MSC_MSG_UCPK = 0x31, /* UCP Acknowledge sub-command */
2368c2ecf20Sopenharmony_ci	MHL_MSC_MSG_UCPE = 0x32, /* UCP Error sub-command */
2378c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RUSB = 0x40, /* Request USB host role */
2388c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RUSBK = 0x41, /* Acknowledge request for USB host role */
2398c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RHID = 0x42, /* Request HID host role */
2408c2ecf20Sopenharmony_ci	MHL_MSC_MSG_RHIDK = 0x43, /* Acknowledge request for HID host role */
2418c2ecf20Sopenharmony_ci	MHL_MSC_MSG_ATT = 0x50, /* Request attention sub-command */
2428c2ecf20Sopenharmony_ci	MHL_MSC_MSG_ATTK = 0x51, /* ATT Acknowledge sub-command */
2438c2ecf20Sopenharmony_ci	MHL_MSC_MSG_BIST_TRIGGER = 0x60,
2448c2ecf20Sopenharmony_ci	MHL_MSC_MSG_BIST_REQUEST_STAT = 0x61,
2458c2ecf20Sopenharmony_ci	MHL_MSC_MSG_BIST_READY = 0x62,
2468c2ecf20Sopenharmony_ci	MHL_MSC_MSG_BIST_STOP = 0x63,
2478c2ecf20Sopenharmony_ci};
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci/* RAP action codes */
2508c2ecf20Sopenharmony_ci#define MHL_RAP_POLL		0x00	/* Just do an ack */
2518c2ecf20Sopenharmony_ci#define MHL_RAP_CONTENT_ON	0x10	/* Turn content stream ON */
2528c2ecf20Sopenharmony_ci#define MHL_RAP_CONTENT_OFF	0x11	/* Turn content stream OFF */
2538c2ecf20Sopenharmony_ci#define MHL_RAP_CBUS_MODE_DOWN	0x20
2548c2ecf20Sopenharmony_ci#define MHL_RAP_CBUS_MODE_UP	0x21
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci/* RAPK status codes */
2578c2ecf20Sopenharmony_ci#define MHL_RAPK_NO_ERR		0x00	/* RAP action recognized & supported */
2588c2ecf20Sopenharmony_ci#define MHL_RAPK_UNRECOGNIZED	0x01	/* Unknown RAP action code received */
2598c2ecf20Sopenharmony_ci#define MHL_RAPK_UNSUPPORTED	0x02	/* Rcvd RAP action code not supported */
2608c2ecf20Sopenharmony_ci#define MHL_RAPK_BUSY		0x03	/* Responder too busy to respond */
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci/* Bit masks for RCP messages */
2638c2ecf20Sopenharmony_ci#define MHL_RCP_KEY_RELEASED_MASK	0x80
2648c2ecf20Sopenharmony_ci#define MHL_RCP_KEY_ID_MASK		0x7F
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci/*
2678c2ecf20Sopenharmony_ci * Error status codes for RCPE messages
2688c2ecf20Sopenharmony_ci */
2698c2ecf20Sopenharmony_ci/* No error. (Not allowed in RCPE messages) */
2708c2ecf20Sopenharmony_ci#define MHL_RCPE_STATUS_NO_ERROR		0x00
2718c2ecf20Sopenharmony_ci/* Unsupported/unrecognized key code */
2728c2ecf20Sopenharmony_ci#define MHL_RCPE_STATUS_INEFFECTIVE_KEY_CODE	0x01
2738c2ecf20Sopenharmony_ci/* Responder busy. Initiator may retry message */
2748c2ecf20Sopenharmony_ci#define MHL_RCPE_STATUS_BUSY			0x02
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci/*
2778c2ecf20Sopenharmony_ci * Error status codes for RBPE messages
2788c2ecf20Sopenharmony_ci */
2798c2ecf20Sopenharmony_ci/* No error. (Not allowed in RBPE messages) */
2808c2ecf20Sopenharmony_ci#define MHL_RBPE_STATUS_NO_ERROR		0x00
2818c2ecf20Sopenharmony_ci/* Unsupported/unrecognized button code */
2828c2ecf20Sopenharmony_ci#define MHL_RBPE_STATUS_INEFFECTIVE_BUTTON_CODE	0x01
2838c2ecf20Sopenharmony_ci/* Responder busy. Initiator may retry message */
2848c2ecf20Sopenharmony_ci#define MHL_RBPE_STATUS_BUSY			0x02
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci/*
2878c2ecf20Sopenharmony_ci * Error status codes for UCPE messages
2888c2ecf20Sopenharmony_ci */
2898c2ecf20Sopenharmony_ci/* No error. (Not allowed in UCPE messages) */
2908c2ecf20Sopenharmony_ci#define MHL_UCPE_STATUS_NO_ERROR		0x00
2918c2ecf20Sopenharmony_ci/* Unsupported/unrecognized key code */
2928c2ecf20Sopenharmony_ci#define MHL_UCPE_STATUS_INEFFECTIVE_KEY_CODE	0x01
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_cienum mhl_burst_id {
2958c2ecf20Sopenharmony_ci	MHL_BURST_ID_3D_VIC = 0x10,
2968c2ecf20Sopenharmony_ci	MHL_BURST_ID_3D_DTD = 0x11,
2978c2ecf20Sopenharmony_ci	MHL_BURST_ID_HEV_VIC = 0x20,
2988c2ecf20Sopenharmony_ci	MHL_BURST_ID_HEV_DTDA = 0x21,
2998c2ecf20Sopenharmony_ci	MHL_BURST_ID_HEV_DTDB = 0x22,
3008c2ecf20Sopenharmony_ci	MHL_BURST_ID_VC_ASSIGN = 0x38,
3018c2ecf20Sopenharmony_ci	MHL_BURST_ID_VC_CONFIRM = 0x39,
3028c2ecf20Sopenharmony_ci	MHL_BURST_ID_AUD_DELAY = 0x40,
3038c2ecf20Sopenharmony_ci	MHL_BURST_ID_ADT_BURSTID = 0x41,
3048c2ecf20Sopenharmony_ci	MHL_BURST_ID_BIST_SETUP = 0x51,
3058c2ecf20Sopenharmony_ci	MHL_BURST_ID_BIST_RETURN_STAT = 0x52,
3068c2ecf20Sopenharmony_ci	MHL_BURST_ID_EMSC_SUPPORT = 0x61,
3078c2ecf20Sopenharmony_ci	MHL_BURST_ID_HID_PAYLOAD = 0x62,
3088c2ecf20Sopenharmony_ci	MHL_BURST_ID_BLK_RCV_BUFFER_INFO = 0x63,
3098c2ecf20Sopenharmony_ci	MHL_BURST_ID_BITS_PER_PIXEL_FMT = 0x64,
3108c2ecf20Sopenharmony_ci};
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_cistruct mhl_burst_blk_rcv_buffer_info {
3138c2ecf20Sopenharmony_ci	__be16 id;
3148c2ecf20Sopenharmony_ci	__le16 size;
3158c2ecf20Sopenharmony_ci} __packed;
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_cistruct mhl3_burst_header {
3188c2ecf20Sopenharmony_ci	__be16 id;
3198c2ecf20Sopenharmony_ci	u8 checksum;
3208c2ecf20Sopenharmony_ci	u8 total_entries;
3218c2ecf20Sopenharmony_ci	u8 sequence_index;
3228c2ecf20Sopenharmony_ci} __packed;
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_cistruct mhl_burst_bits_per_pixel_fmt {
3258c2ecf20Sopenharmony_ci	struct mhl3_burst_header hdr;
3268c2ecf20Sopenharmony_ci	u8 num_entries;
3278c2ecf20Sopenharmony_ci	struct {
3288c2ecf20Sopenharmony_ci		u8 stream_id;
3298c2ecf20Sopenharmony_ci		u8 pixel_format;
3308c2ecf20Sopenharmony_ci	} __packed desc[];
3318c2ecf20Sopenharmony_ci} __packed;
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_cistruct mhl_burst_emsc_support {
3348c2ecf20Sopenharmony_ci	struct mhl3_burst_header hdr;
3358c2ecf20Sopenharmony_ci	u8 num_entries;
3368c2ecf20Sopenharmony_ci	__be16 burst_id[];
3378c2ecf20Sopenharmony_ci} __packed;
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_cistruct mhl_burst_audio_descr {
3408c2ecf20Sopenharmony_ci	struct mhl3_burst_header hdr;
3418c2ecf20Sopenharmony_ci	u8 flags;
3428c2ecf20Sopenharmony_ci	u8 short_desc[9];
3438c2ecf20Sopenharmony_ci} __packed;
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci/*
3468c2ecf20Sopenharmony_ci * MHL3 infoframe related definitions
3478c2ecf20Sopenharmony_ci */
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci#define MHL3_IEEE_OUI		0x7ca61d
3508c2ecf20Sopenharmony_ci#define MHL3_INFOFRAME_SIZE	15
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_cienum mhl3_video_format {
3538c2ecf20Sopenharmony_ci	MHL3_VIDEO_FORMAT_NONE,
3548c2ecf20Sopenharmony_ci	MHL3_VIDEO_FORMAT_3D,
3558c2ecf20Sopenharmony_ci	MHL3_VIDEO_FORMAT_MULTI_VIEW,
3568c2ecf20Sopenharmony_ci	MHL3_VIDEO_FORMAT_DUAL_3D
3578c2ecf20Sopenharmony_ci};
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_cienum mhl3_3d_format_type {
3608c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_FS, /* frame sequential */
3618c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_TB, /* top-bottom */
3628c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_LR, /* left-right */
3638c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_FS_TB, /* frame sequential, top-bottom */
3648c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_FS_LR, /* frame sequential, left-right */
3658c2ecf20Sopenharmony_ci	MHL3_3D_FORMAT_TYPE_TB_LR /* top-bottom, left-right */
3668c2ecf20Sopenharmony_ci};
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_cistruct mhl3_infoframe {
3698c2ecf20Sopenharmony_ci	unsigned char version;
3708c2ecf20Sopenharmony_ci	enum mhl3_video_format video_format;
3718c2ecf20Sopenharmony_ci	enum mhl3_3d_format_type format_type;
3728c2ecf20Sopenharmony_ci	bool sep_audio;
3738c2ecf20Sopenharmony_ci	int hev_format;
3748c2ecf20Sopenharmony_ci	int av_delay;
3758c2ecf20Sopenharmony_ci};
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci#endif /* __MHL_H__ */
378