18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
48c2ecf20Sopenharmony_ci *    Zheng Yang <zhengyang@rock-chips.com>
58c2ecf20Sopenharmony_ci *    Yakir Yang <ykk@rock-chips.com>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __INNO_HDMI_H__
98c2ecf20Sopenharmony_ci#define __INNO_HDMI_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define DDC_SEGMENT_ADDR		0x30
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cienum PWR_MODE {
148c2ecf20Sopenharmony_ci	NORMAL,
158c2ecf20Sopenharmony_ci	LOWER_PWR,
168c2ecf20Sopenharmony_ci};
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define HDMI_SCL_RATE			(100*1000)
198c2ecf20Sopenharmony_ci#define DDC_BUS_FREQ_L			0x4b
208c2ecf20Sopenharmony_ci#define DDC_BUS_FREQ_H			0x4c
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define HDMI_SYS_CTRL			0x00
238c2ecf20Sopenharmony_ci#define m_RST_ANALOG			(1 << 6)
248c2ecf20Sopenharmony_ci#define v_RST_ANALOG			(0 << 6)
258c2ecf20Sopenharmony_ci#define v_NOT_RST_ANALOG		(1 << 6)
268c2ecf20Sopenharmony_ci#define m_RST_DIGITAL			(1 << 5)
278c2ecf20Sopenharmony_ci#define v_RST_DIGITAL			(0 << 5)
288c2ecf20Sopenharmony_ci#define v_NOT_RST_DIGITAL		(1 << 5)
298c2ecf20Sopenharmony_ci#define m_REG_CLK_INV			(1 << 4)
308c2ecf20Sopenharmony_ci#define v_REG_CLK_NOT_INV		(0 << 4)
318c2ecf20Sopenharmony_ci#define v_REG_CLK_INV			(1 << 4)
328c2ecf20Sopenharmony_ci#define m_VCLK_INV			(1 << 3)
338c2ecf20Sopenharmony_ci#define v_VCLK_NOT_INV			(0 << 3)
348c2ecf20Sopenharmony_ci#define v_VCLK_INV			(1 << 3)
358c2ecf20Sopenharmony_ci#define m_REG_CLK_SOURCE		(1 << 2)
368c2ecf20Sopenharmony_ci#define v_REG_CLK_SOURCE_TMDS		(0 << 2)
378c2ecf20Sopenharmony_ci#define v_REG_CLK_SOURCE_SYS		(1 << 2)
388c2ecf20Sopenharmony_ci#define m_POWER				(1 << 1)
398c2ecf20Sopenharmony_ci#define v_PWR_ON			(0 << 1)
408c2ecf20Sopenharmony_ci#define v_PWR_OFF			(1 << 1)
418c2ecf20Sopenharmony_ci#define m_INT_POL			(1 << 0)
428c2ecf20Sopenharmony_ci#define v_INT_POL_HIGH			1
438c2ecf20Sopenharmony_ci#define v_INT_POL_LOW			0
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define HDMI_VIDEO_CONTRL1		0x01
468c2ecf20Sopenharmony_ci#define m_VIDEO_INPUT_FORMAT		(7 << 1)
478c2ecf20Sopenharmony_ci#define m_DE_SOURCE			(1 << 0)
488c2ecf20Sopenharmony_ci#define v_VIDEO_INPUT_FORMAT(n)		(n << 1)
498c2ecf20Sopenharmony_ci#define v_DE_EXTERNAL			1
508c2ecf20Sopenharmony_ci#define v_DE_INTERNAL			0
518c2ecf20Sopenharmony_cienum {
528c2ecf20Sopenharmony_ci	VIDEO_INPUT_SDR_RGB444 = 0,
538c2ecf20Sopenharmony_ci	VIDEO_INPUT_DDR_RGB444 = 5,
548c2ecf20Sopenharmony_ci	VIDEO_INPUT_DDR_YCBCR422 = 6
558c2ecf20Sopenharmony_ci};
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define HDMI_VIDEO_CONTRL2		0x02
588c2ecf20Sopenharmony_ci#define m_VIDEO_OUTPUT_COLOR		(3 << 6)
598c2ecf20Sopenharmony_ci#define m_VIDEO_INPUT_BITS		(3 << 4)
608c2ecf20Sopenharmony_ci#define m_VIDEO_INPUT_CSP		(1 << 0)
618c2ecf20Sopenharmony_ci#define v_VIDEO_OUTPUT_COLOR(n)		(((n) & 0x3) << 6)
628c2ecf20Sopenharmony_ci#define v_VIDEO_INPUT_BITS(n)		(n << 4)
638c2ecf20Sopenharmony_ci#define v_VIDEO_INPUT_CSP(n)		(n << 0)
648c2ecf20Sopenharmony_cienum {
658c2ecf20Sopenharmony_ci	VIDEO_INPUT_12BITS = 0,
668c2ecf20Sopenharmony_ci	VIDEO_INPUT_10BITS = 1,
678c2ecf20Sopenharmony_ci	VIDEO_INPUT_REVERT = 2,
688c2ecf20Sopenharmony_ci	VIDEO_INPUT_8BITS = 3,
698c2ecf20Sopenharmony_ci};
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define HDMI_VIDEO_CONTRL		0x03
728c2ecf20Sopenharmony_ci#define m_VIDEO_AUTO_CSC		(1 << 7)
738c2ecf20Sopenharmony_ci#define v_VIDEO_AUTO_CSC(n)		(n << 7)
748c2ecf20Sopenharmony_ci#define m_VIDEO_C0_C2_SWAP		(1 << 0)
758c2ecf20Sopenharmony_ci#define v_VIDEO_C0_C2_SWAP(n)		(n << 0)
768c2ecf20Sopenharmony_cienum {
778c2ecf20Sopenharmony_ci	C0_C2_CHANGE_ENABLE = 0,
788c2ecf20Sopenharmony_ci	C0_C2_CHANGE_DISABLE = 1,
798c2ecf20Sopenharmony_ci	AUTO_CSC_DISABLE = 0,
808c2ecf20Sopenharmony_ci	AUTO_CSC_ENABLE = 1,
818c2ecf20Sopenharmony_ci};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define HDMI_VIDEO_CONTRL3		0x04
848c2ecf20Sopenharmony_ci#define m_COLOR_DEPTH_NOT_INDICATED	(1 << 4)
858c2ecf20Sopenharmony_ci#define m_SOF				(1 << 3)
868c2ecf20Sopenharmony_ci#define m_COLOR_RANGE			(1 << 2)
878c2ecf20Sopenharmony_ci#define m_CSC				(1 << 0)
888c2ecf20Sopenharmony_ci#define v_COLOR_DEPTH_NOT_INDICATED(n)	((n) << 4)
898c2ecf20Sopenharmony_ci#define v_SOF_ENABLE			(0 << 3)
908c2ecf20Sopenharmony_ci#define v_SOF_DISABLE			(1 << 3)
918c2ecf20Sopenharmony_ci#define v_COLOR_RANGE_FULL		(1 << 2)
928c2ecf20Sopenharmony_ci#define v_COLOR_RANGE_LIMITED		(0 << 2)
938c2ecf20Sopenharmony_ci#define v_CSC_ENABLE			1
948c2ecf20Sopenharmony_ci#define v_CSC_DISABLE			0
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define HDMI_AV_MUTE			0x05
978c2ecf20Sopenharmony_ci#define m_AVMUTE_CLEAR			(1 << 7)
988c2ecf20Sopenharmony_ci#define m_AVMUTE_ENABLE			(1 << 6)
998c2ecf20Sopenharmony_ci#define m_AUDIO_MUTE			(1 << 1)
1008c2ecf20Sopenharmony_ci#define m_VIDEO_BLACK			(1 << 0)
1018c2ecf20Sopenharmony_ci#define v_AVMUTE_CLEAR(n)		(n << 7)
1028c2ecf20Sopenharmony_ci#define v_AVMUTE_ENABLE(n)		(n << 6)
1038c2ecf20Sopenharmony_ci#define v_AUDIO_MUTE(n)			(n << 1)
1048c2ecf20Sopenharmony_ci#define v_VIDEO_MUTE(n)			(n << 0)
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#define HDMI_VIDEO_TIMING_CTL		0x08
1078c2ecf20Sopenharmony_ci#define v_HSYNC_POLARITY(n)		(n << 3)
1088c2ecf20Sopenharmony_ci#define v_VSYNC_POLARITY(n)		(n << 2)
1098c2ecf20Sopenharmony_ci#define v_INETLACE(n)			(n << 1)
1108c2ecf20Sopenharmony_ci#define v_EXTERANL_VIDEO(n)		(n << 0)
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HTOTAL_L		0x09
1138c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HTOTAL_H		0x0a
1148c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HBLANK_L		0x0b
1158c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HBLANK_H		0x0c
1168c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HDELAY_L		0x0d
1178c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HDELAY_H		0x0e
1188c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HDURATION_L	0x0f
1198c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_HDURATION_H	0x10
1208c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_VTOTAL_L		0x11
1218c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_VTOTAL_H		0x12
1228c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_VBLANK		0x13
1238c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_VDELAY		0x14
1248c2ecf20Sopenharmony_ci#define HDMI_VIDEO_EXT_VDURATION	0x15
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define HDMI_VIDEO_CSC_COEF		0x18
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define HDMI_AUDIO_CTRL1		0x35
1298c2ecf20Sopenharmony_cienum {
1308c2ecf20Sopenharmony_ci	CTS_SOURCE_INTERNAL = 0,
1318c2ecf20Sopenharmony_ci	CTS_SOURCE_EXTERNAL = 1,
1328c2ecf20Sopenharmony_ci};
1338c2ecf20Sopenharmony_ci#define v_CTS_SOURCE(n)			(n << 7)
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_cienum {
1368c2ecf20Sopenharmony_ci	DOWNSAMPLE_DISABLE = 0,
1378c2ecf20Sopenharmony_ci	DOWNSAMPLE_1_2 = 1,
1388c2ecf20Sopenharmony_ci	DOWNSAMPLE_1_4 = 2,
1398c2ecf20Sopenharmony_ci};
1408c2ecf20Sopenharmony_ci#define v_DOWN_SAMPLE(n)		(n << 5)
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_cienum {
1438c2ecf20Sopenharmony_ci	AUDIO_SOURCE_IIS = 0,
1448c2ecf20Sopenharmony_ci	AUDIO_SOURCE_SPDIF = 1,
1458c2ecf20Sopenharmony_ci};
1468c2ecf20Sopenharmony_ci#define v_AUDIO_SOURCE(n)		(n << 3)
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#define v_MCLK_ENABLE(n)		(n << 2)
1498c2ecf20Sopenharmony_cienum {
1508c2ecf20Sopenharmony_ci	MCLK_128FS = 0,
1518c2ecf20Sopenharmony_ci	MCLK_256FS = 1,
1528c2ecf20Sopenharmony_ci	MCLK_384FS = 2,
1538c2ecf20Sopenharmony_ci	MCLK_512FS = 3,
1548c2ecf20Sopenharmony_ci};
1558c2ecf20Sopenharmony_ci#define v_MCLK_RATIO(n)			(n)
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#define AUDIO_SAMPLE_RATE		0x37
1588c2ecf20Sopenharmony_cienum {
1598c2ecf20Sopenharmony_ci	AUDIO_32K = 0x3,
1608c2ecf20Sopenharmony_ci	AUDIO_441K = 0x0,
1618c2ecf20Sopenharmony_ci	AUDIO_48K = 0x2,
1628c2ecf20Sopenharmony_ci	AUDIO_882K = 0x8,
1638c2ecf20Sopenharmony_ci	AUDIO_96K = 0xa,
1648c2ecf20Sopenharmony_ci	AUDIO_1764K = 0xc,
1658c2ecf20Sopenharmony_ci	AUDIO_192K = 0xe,
1668c2ecf20Sopenharmony_ci};
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define AUDIO_I2S_MODE			0x38
1698c2ecf20Sopenharmony_cienum {
1708c2ecf20Sopenharmony_ci	I2S_CHANNEL_1_2 = 1,
1718c2ecf20Sopenharmony_ci	I2S_CHANNEL_3_4 = 3,
1728c2ecf20Sopenharmony_ci	I2S_CHANNEL_5_6 = 7,
1738c2ecf20Sopenharmony_ci	I2S_CHANNEL_7_8 = 0xf
1748c2ecf20Sopenharmony_ci};
1758c2ecf20Sopenharmony_ci#define v_I2S_CHANNEL(n)		((n) << 2)
1768c2ecf20Sopenharmony_cienum {
1778c2ecf20Sopenharmony_ci	I2S_STANDARD = 0,
1788c2ecf20Sopenharmony_ci	I2S_LEFT_JUSTIFIED = 1,
1798c2ecf20Sopenharmony_ci	I2S_RIGHT_JUSTIFIED = 2,
1808c2ecf20Sopenharmony_ci};
1818c2ecf20Sopenharmony_ci#define v_I2S_MODE(n)			(n)
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define AUDIO_I2S_MAP			0x39
1848c2ecf20Sopenharmony_ci#define AUDIO_I2S_SWAPS_SPDIF		0x3a
1858c2ecf20Sopenharmony_ci#define v_SPIDF_FREQ(n)			(n)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define N_32K				0x1000
1888c2ecf20Sopenharmony_ci#define N_441K				0x1880
1898c2ecf20Sopenharmony_ci#define N_882K				0x3100
1908c2ecf20Sopenharmony_ci#define N_1764K				0x6200
1918c2ecf20Sopenharmony_ci#define N_48K				0x1800
1928c2ecf20Sopenharmony_ci#define N_96K				0x3000
1938c2ecf20Sopenharmony_ci#define N_192K				0x6000
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define HDMI_AUDIO_CHANNEL_STATUS	0x3e
1968c2ecf20Sopenharmony_ci#define m_AUDIO_STATUS_NLPCM		(1 << 7)
1978c2ecf20Sopenharmony_ci#define m_AUDIO_STATUS_USE		(1 << 6)
1988c2ecf20Sopenharmony_ci#define m_AUDIO_STATUS_COPYRIGHT	(1 << 5)
1998c2ecf20Sopenharmony_ci#define m_AUDIO_STATUS_ADDITION		(3 << 2)
2008c2ecf20Sopenharmony_ci#define m_AUDIO_STATUS_CLK_ACCURACY	(2 << 0)
2018c2ecf20Sopenharmony_ci#define v_AUDIO_STATUS_NLPCM(n)		((n & 1) << 7)
2028c2ecf20Sopenharmony_ci#define AUDIO_N_H			0x3f
2038c2ecf20Sopenharmony_ci#define AUDIO_N_M			0x40
2048c2ecf20Sopenharmony_ci#define AUDIO_N_L			0x41
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci#define HDMI_AUDIO_CTS_H		0x45
2078c2ecf20Sopenharmony_ci#define HDMI_AUDIO_CTS_M		0x46
2088c2ecf20Sopenharmony_ci#define HDMI_AUDIO_CTS_L		0x47
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci#define HDMI_DDC_CLK_L			0x4b
2118c2ecf20Sopenharmony_ci#define HDMI_DDC_CLK_H			0x4c
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci#define HDMI_EDID_SEGMENT_POINTER	0x4d
2148c2ecf20Sopenharmony_ci#define HDMI_EDID_WORD_ADDR		0x4e
2158c2ecf20Sopenharmony_ci#define HDMI_EDID_FIFO_OFFSET		0x4f
2168c2ecf20Sopenharmony_ci#define HDMI_EDID_FIFO_ADDR		0x50
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define HDMI_PACKET_SEND_MANUAL		0x9c
2198c2ecf20Sopenharmony_ci#define HDMI_PACKET_SEND_AUTO		0x9d
2208c2ecf20Sopenharmony_ci#define m_PACKET_GCP_EN			(1 << 7)
2218c2ecf20Sopenharmony_ci#define m_PACKET_MSI_EN			(1 << 6)
2228c2ecf20Sopenharmony_ci#define m_PACKET_SDI_EN			(1 << 5)
2238c2ecf20Sopenharmony_ci#define m_PACKET_VSI_EN			(1 << 4)
2248c2ecf20Sopenharmony_ci#define v_PACKET_GCP_EN(n)		((n & 1) << 7)
2258c2ecf20Sopenharmony_ci#define v_PACKET_MSI_EN(n)		((n & 1) << 6)
2268c2ecf20Sopenharmony_ci#define v_PACKET_SDI_EN(n)		((n & 1) << 5)
2278c2ecf20Sopenharmony_ci#define v_PACKET_VSI_EN(n)		((n & 1) << 4)
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci#define HDMI_CONTROL_PACKET_BUF_INDEX	0x9f
2308c2ecf20Sopenharmony_cienum {
2318c2ecf20Sopenharmony_ci	INFOFRAME_VSI = 0x05,
2328c2ecf20Sopenharmony_ci	INFOFRAME_AVI = 0x06,
2338c2ecf20Sopenharmony_ci	INFOFRAME_AAI = 0x08,
2348c2ecf20Sopenharmony_ci};
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci#define HDMI_CONTROL_PACKET_ADDR	0xa0
2378c2ecf20Sopenharmony_ci#define HDMI_MAXIMUM_INFO_FRAME_SIZE	0x11
2388c2ecf20Sopenharmony_cienum {
2398c2ecf20Sopenharmony_ci	AVI_COLOR_MODE_RGB = 0,
2408c2ecf20Sopenharmony_ci	AVI_COLOR_MODE_YCBCR422 = 1,
2418c2ecf20Sopenharmony_ci	AVI_COLOR_MODE_YCBCR444 = 2,
2428c2ecf20Sopenharmony_ci	AVI_COLORIMETRY_NO_DATA = 0,
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci	AVI_COLORIMETRY_SMPTE_170M = 1,
2458c2ecf20Sopenharmony_ci	AVI_COLORIMETRY_ITU709 = 2,
2468c2ecf20Sopenharmony_ci	AVI_COLORIMETRY_EXTENDED = 3,
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci	AVI_CODED_FRAME_ASPECT_NO_DATA = 0,
2498c2ecf20Sopenharmony_ci	AVI_CODED_FRAME_ASPECT_4_3 = 1,
2508c2ecf20Sopenharmony_ci	AVI_CODED_FRAME_ASPECT_16_9 = 2,
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci	ACTIVE_ASPECT_RATE_SAME_AS_CODED_FRAME = 0x08,
2538c2ecf20Sopenharmony_ci	ACTIVE_ASPECT_RATE_4_3 = 0x09,
2548c2ecf20Sopenharmony_ci	ACTIVE_ASPECT_RATE_16_9 = 0x0A,
2558c2ecf20Sopenharmony_ci	ACTIVE_ASPECT_RATE_14_9 = 0x0B,
2568c2ecf20Sopenharmony_ci};
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci#define HDMI_HDCP_CTRL			0x52
2598c2ecf20Sopenharmony_ci#define m_HDMI_DVI			(1 << 1)
2608c2ecf20Sopenharmony_ci#define v_HDMI_DVI(n)			(n << 1)
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci#define HDMI_INTERRUPT_MASK1		0xc0
2638c2ecf20Sopenharmony_ci#define HDMI_INTERRUPT_STATUS1		0xc1
2648c2ecf20Sopenharmony_ci#define	m_INT_ACTIVE_VSYNC		(1 << 5)
2658c2ecf20Sopenharmony_ci#define m_INT_EDID_READY		(1 << 2)
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci#define HDMI_INTERRUPT_MASK2		0xc2
2688c2ecf20Sopenharmony_ci#define HDMI_INTERRUPT_STATUS2		0xc3
2698c2ecf20Sopenharmony_ci#define m_INT_HDCP_ERR			(1 << 7)
2708c2ecf20Sopenharmony_ci#define m_INT_BKSV_FLAG			(1 << 6)
2718c2ecf20Sopenharmony_ci#define m_INT_HDCP_OK			(1 << 4)
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci#define HDMI_STATUS			0xc8
2748c2ecf20Sopenharmony_ci#define m_HOTPLUG			(1 << 7)
2758c2ecf20Sopenharmony_ci#define m_MASK_INT_HOTPLUG		(1 << 5)
2768c2ecf20Sopenharmony_ci#define m_INT_HOTPLUG			(1 << 1)
2778c2ecf20Sopenharmony_ci#define v_MASK_INT_HOTPLUG(n)		((n & 0x1) << 5)
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci#define HDMI_COLORBAR                   0xc9
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci#define HDMI_PHY_SYNC			0xce
2828c2ecf20Sopenharmony_ci#define HDMI_PHY_SYS_CTL		0xe0
2838c2ecf20Sopenharmony_ci#define m_TMDS_CLK_SOURCE		(1 << 5)
2848c2ecf20Sopenharmony_ci#define v_TMDS_FROM_PLL			(0 << 5)
2858c2ecf20Sopenharmony_ci#define v_TMDS_FROM_GEN			(1 << 5)
2868c2ecf20Sopenharmony_ci#define m_PHASE_CLK			(1 << 4)
2878c2ecf20Sopenharmony_ci#define v_DEFAULT_PHASE			(0 << 4)
2888c2ecf20Sopenharmony_ci#define v_SYNC_PHASE			(1 << 4)
2898c2ecf20Sopenharmony_ci#define m_TMDS_CURRENT_PWR		(1 << 3)
2908c2ecf20Sopenharmony_ci#define v_TURN_ON_CURRENT		(0 << 3)
2918c2ecf20Sopenharmony_ci#define v_CAT_OFF_CURRENT		(1 << 3)
2928c2ecf20Sopenharmony_ci#define m_BANDGAP_PWR			(1 << 2)
2938c2ecf20Sopenharmony_ci#define v_BANDGAP_PWR_UP		(0 << 2)
2948c2ecf20Sopenharmony_ci#define v_BANDGAP_PWR_DOWN		(1 << 2)
2958c2ecf20Sopenharmony_ci#define m_PLL_PWR			(1 << 1)
2968c2ecf20Sopenharmony_ci#define v_PLL_PWR_UP			(0 << 1)
2978c2ecf20Sopenharmony_ci#define v_PLL_PWR_DOWN			(1 << 1)
2988c2ecf20Sopenharmony_ci#define m_TMDS_CHG_PWR			(1 << 0)
2998c2ecf20Sopenharmony_ci#define v_TMDS_CHG_PWR_UP		(0 << 0)
3008c2ecf20Sopenharmony_ci#define v_TMDS_CHG_PWR_DOWN		(1 << 0)
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci#define HDMI_PHY_CHG_PWR		0xe1
3038c2ecf20Sopenharmony_ci#define v_CLK_CHG_PWR(n)		((n & 1) << 3)
3048c2ecf20Sopenharmony_ci#define v_DATA_CHG_PWR(n)		((n & 7) << 0)
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define HDMI_PHY_DRIVER			0xe2
3078c2ecf20Sopenharmony_ci#define v_CLK_MAIN_DRIVER(n)		(n << 4)
3088c2ecf20Sopenharmony_ci#define v_DATA_MAIN_DRIVER(n)		(n << 0)
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci#define HDMI_PHY_PRE_EMPHASIS		0xe3
3118c2ecf20Sopenharmony_ci#define v_PRE_EMPHASIS(n)		((n & 7) << 4)
3128c2ecf20Sopenharmony_ci#define v_CLK_PRE_DRIVER(n)		((n & 3) << 2)
3138c2ecf20Sopenharmony_ci#define v_DATA_PRE_DRIVER(n)		((n & 3) << 0)
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#define HDMI_PHY_FEEDBACK_DIV_RATIO_LOW		0xe7
3168c2ecf20Sopenharmony_ci#define v_FEEDBACK_DIV_LOW(n)			(n & 0xff)
3178c2ecf20Sopenharmony_ci#define HDMI_PHY_FEEDBACK_DIV_RATIO_HIGH	0xe8
3188c2ecf20Sopenharmony_ci#define v_FEEDBACK_DIV_HIGH(n)			(n & 1)
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci#define HDMI_PHY_PRE_DIV_RATIO		0xed
3218c2ecf20Sopenharmony_ci#define v_PRE_DIV_RATIO(n)		(n & 0x1f)
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci#define HDMI_CEC_CTRL			0xd0
3248c2ecf20Sopenharmony_ci#define m_ADJUST_FOR_HISENSE		(1 << 6)
3258c2ecf20Sopenharmony_ci#define m_REJECT_RX_BROADCAST		(1 << 5)
3268c2ecf20Sopenharmony_ci#define m_BUSFREETIME_ENABLE		(1 << 2)
3278c2ecf20Sopenharmony_ci#define m_REJECT_RX			(1 << 1)
3288c2ecf20Sopenharmony_ci#define m_START_TX			(1 << 0)
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci#define HDMI_CEC_DATA			0xd1
3318c2ecf20Sopenharmony_ci#define HDMI_CEC_TX_OFFSET		0xd2
3328c2ecf20Sopenharmony_ci#define HDMI_CEC_RX_OFFSET		0xd3
3338c2ecf20Sopenharmony_ci#define HDMI_CEC_CLK_H			0xd4
3348c2ecf20Sopenharmony_ci#define HDMI_CEC_CLK_L			0xd5
3358c2ecf20Sopenharmony_ci#define HDMI_CEC_TX_LENGTH		0xd6
3368c2ecf20Sopenharmony_ci#define HDMI_CEC_RX_LENGTH		0xd7
3378c2ecf20Sopenharmony_ci#define HDMI_CEC_TX_INT_MASK		0xd8
3388c2ecf20Sopenharmony_ci#define m_TX_DONE			(1 << 3)
3398c2ecf20Sopenharmony_ci#define m_TX_NOACK			(1 << 2)
3408c2ecf20Sopenharmony_ci#define m_TX_BROADCAST_REJ		(1 << 1)
3418c2ecf20Sopenharmony_ci#define m_TX_BUSNOTFREE			(1 << 0)
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci#define HDMI_CEC_RX_INT_MASK		0xd9
3448c2ecf20Sopenharmony_ci#define m_RX_LA_ERR			(1 << 4)
3458c2ecf20Sopenharmony_ci#define m_RX_GLITCH			(1 << 3)
3468c2ecf20Sopenharmony_ci#define m_RX_DONE			(1 << 0)
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci#define HDMI_CEC_TX_INT			0xda
3498c2ecf20Sopenharmony_ci#define HDMI_CEC_RX_INT			0xdb
3508c2ecf20Sopenharmony_ci#define HDMI_CEC_BUSFREETIME_L		0xdc
3518c2ecf20Sopenharmony_ci#define HDMI_CEC_BUSFREETIME_H		0xdd
3528c2ecf20Sopenharmony_ci#define HDMI_CEC_LOGICADDR		0xde
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci#endif /* __INNO_HDMI_H__ */
355