Path: blob/master/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
26516 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright(c) 2016, Analogix Semiconductor. All rights reserved.3*/45#ifndef __ANX78xx_H6#define __ANX78xx_H78#include "analogix-i2c-dptx.h"9#include "analogix-i2c-txcommon.h"1011/***************************************************************/12/* Register definitions for RX_PO */13/***************************************************************/1415/*16* System Control and Status17*/1819/* Software Reset Register 1 */20#define SP_SOFTWARE_RESET1_REG 0x1121#define SP_VIDEO_RST BIT(4)22#define SP_HDCP_MAN_RST BIT(2)23#define SP_TMDS_RST BIT(1)24#define SP_SW_MAN_RST BIT(0)2526/* System Status Register */27#define SP_SYSTEM_STATUS_REG 0x1428#define SP_TMDS_CLOCK_DET BIT(1)29#define SP_TMDS_DE_DET BIT(0)3031/* HDMI Status Register */32#define SP_HDMI_STATUS_REG 0x1533#define SP_HDMI_AUD_LAYOUT BIT(3)34#define SP_HDMI_DET BIT(0)35# define SP_DVI_MODE 036# define SP_HDMI_MODE 13738/* HDMI Mute Control Register */39#define SP_HDMI_MUTE_CTRL_REG 0x1640#define SP_AUD_MUTE BIT(1)41#define SP_VID_MUTE BIT(0)4243/* System Power Down Register 1 */44#define SP_SYSTEM_POWER_DOWN1_REG 0x1845#define SP_PWDN_CTRL BIT(0)4647/*48* Audio and Video Auto Control49*/5051/* Auto Audio and Video Control register */52#define SP_AUDVID_CTRL_REG 0x2053#define SP_AVC_OE BIT(7)54#define SP_AAC_OE BIT(6)55#define SP_AVC_EN BIT(1)56#define SP_AAC_EN BIT(0)5758/* Audio Exception Enable Registers */59#define SP_AUD_EXCEPTION_ENABLE_BASE (0x24 - 1)60/* Bits for Audio Exception Enable Register 3 */61#define SP_AEC_EN21 BIT(5)6263/*64* Interrupt65*/6667/* Interrupt Status Register 1 */68#define SP_INT_STATUS1_REG 0x3169/* Bits for Interrupt Status Register 1 */70#define SP_HDMI_DVI BIT(7)71#define SP_CKDT_CHG BIT(6)72#define SP_SCDT_CHG BIT(5)73#define SP_PCLK_CHG BIT(4)74#define SP_PLL_UNLOCK BIT(3)75#define SP_CABLE_PLUG_CHG BIT(2)76#define SP_SET_MUTE BIT(1)77#define SP_SW_INTR BIT(0)78/* Bits for Interrupt Status Register 2 */79#define SP_HDCP_ERR BIT(5)80#define SP_AUDIO_SAMPLE_CHG BIT(0) /* undocumented */81/* Bits for Interrupt Status Register 3 */82#define SP_AUD_MODE_CHG BIT(0)83/* Bits for Interrupt Status Register 5 */84#define SP_AUDIO_RCV BIT(0)85/* Bits for Interrupt Status Register 6 */86#define SP_INT_STATUS6_REG 0x3687#define SP_CTS_RCV BIT(7)88#define SP_NEW_AUD_PKT BIT(4)89#define SP_NEW_AVI_PKT BIT(1)90#define SP_NEW_CP_PKT BIT(0)91/* Bits for Interrupt Status Register 7 */92#define SP_NO_VSI BIT(7)93#define SP_NEW_VS BIT(4)9495/* Interrupt Mask 1 Status Registers */96#define SP_INT_MASK1_REG 0x419798/* HDMI US TIMER Control Register */99#define SP_HDMI_US_TIMER_CTRL_REG 0x49100#define SP_MS_TIMER_MARGIN_10_8_MASK 0x07101102/*103* TMDS Control104*/105106/* TMDS Control Registers */107#define SP_TMDS_CTRL_BASE (0x50 - 1)108/* Bits for TMDS Control Register 7 */109#define SP_PD_RT BIT(0)110111/*112* Video Control113*/114115/* Video Status Register */116#define SP_VIDEO_STATUS_REG 0x70117#define SP_COLOR_DEPTH_MASK 0xf0118#define SP_COLOR_DEPTH_SHIFT 4119# define SP_COLOR_DEPTH_MODE_LEGACY 0x00120# define SP_COLOR_DEPTH_MODE_24BIT 0x04121# define SP_COLOR_DEPTH_MODE_30BIT 0x05122# define SP_COLOR_DEPTH_MODE_36BIT 0x06123# define SP_COLOR_DEPTH_MODE_48BIT 0x07124125/* Video Data Range Control Register */126#define SP_VID_DATA_RANGE_CTRL_REG 0x83127#define SP_R2Y_INPUT_LIMIT BIT(1)128129/* Pixel Clock High Resolution Counter Registers */130#define SP_PCLK_HIGHRES_CNT_BASE (0x8c - 1)131132/*133* Audio Control134*/135136/* Number of Audio Channels Status Registers */137#define SP_AUD_CH_STATUS_REG_NUM 6138139/* Audio IN S/PDIF Channel Status Registers */140#define SP_AUD_SPDIF_CH_STATUS_BASE 0xc7141142/* Audio IN S/PDIF Channel Status Register 4 */143#define SP_FS_FREQ_MASK 0x0f144# define SP_FS_FREQ_44100HZ 0x00145# define SP_FS_FREQ_48000HZ 0x02146# define SP_FS_FREQ_32000HZ 0x03147# define SP_FS_FREQ_88200HZ 0x08148# define SP_FS_FREQ_96000HZ 0x0a149# define SP_FS_FREQ_176400HZ 0x0c150# define SP_FS_FREQ_192000HZ 0x0e151152/*153* Micellaneous Control Block154*/155156/* CHIP Control Register */157#define SP_CHIP_CTRL_REG 0xe3158#define SP_MAN_HDMI5V_DET BIT(3)159#define SP_PLLLOCK_CKDT_EN BIT(2)160#define SP_ANALOG_CKDT_EN BIT(1)161#define SP_DIGITAL_CKDT_EN BIT(0)162163/* Packet Receiving Status Register */164#define SP_PACKET_RECEIVING_STATUS_REG 0xf3165#define SP_AVI_RCVD BIT(5)166#define SP_VSI_RCVD BIT(1)167168/***************************************************************/169/* Register definitions for RX_P1 */170/***************************************************************/171172/* HDCP BCAPS Shadow Register */173#define SP_HDCP_BCAPS_SHADOW_REG 0x2a174#define SP_BCAPS_REPEATER BIT(5)175176/* HDCP Status Register */177#define SP_RX_HDCP_STATUS_REG 0x3f178#define SP_AUTH_EN BIT(4)179180/*181* InfoFrame and Control Packet Registers182*/183184/* AVI InfoFrame packet checksum */185#define SP_AVI_INFOFRAME_CHECKSUM 0xa3186187/* AVI InfoFrame Registers */188#define SP_AVI_INFOFRAME_DATA_BASE 0xa4189190#define SP_AVI_COLOR_F_MASK 0x60191#define SP_AVI_COLOR_F_SHIFT 5192193/* Audio InfoFrame Registers */194#define SP_AUD_INFOFRAME_DATA_BASE 0xc4195#define SP_AUD_INFOFRAME_LAYOUT_MASK 0x0f196197/* MPEG/HDMI Vendor Specific InfoFrame Packet type code */198#define SP_MPEG_VS_INFOFRAME_TYPE_REG 0xe0199200/* MPEG/HDMI Vendor Specific InfoFrame Packet length */201#define SP_MPEG_VS_INFOFRAME_LEN_REG 0xe2202203/* MPEG/HDMI Vendor Specific InfoFrame Packet version number */204#define SP_MPEG_VS_INFOFRAME_VER_REG 0xe1205206/* MPEG/HDMI Vendor Specific InfoFrame Packet content */207#define SP_MPEG_VS_INFOFRAME_DATA_BASE 0xe4208209/* General Control Packet Register */210#define SP_GENERAL_CTRL_PACKET_REG 0x9f211#define SP_CLEAR_AVMUTE BIT(4)212#define SP_SET_AVMUTE BIT(0)213214/***************************************************************/215/* Register definitions for TX_P1 */216/***************************************************************/217218/* DP TX Link Training Control Register */219#define SP_DP_TX_LT_CTRL0_REG 0x30220221/* PD 1.2 Lint Training 80bit Pattern Register */222#define SP_DP_LT_80BIT_PATTERN0_REG 0x80223#define SP_DP_LT_80BIT_PATTERN_REG_NUM 10224225/* Audio Interface Control Register 0 */226#define SP_AUD_INTERFACE_CTRL0_REG 0x5f227#define SP_AUD_INTERFACE_DISABLE 0x80228229/* Audio Interface Control Register 2 */230#define SP_AUD_INTERFACE_CTRL2_REG 0x60231#define SP_M_AUD_ADJUST_ST 0x04232233/* Audio Interface Control Register 3 */234#define SP_AUD_INTERFACE_CTRL3_REG 0x62235236/* Audio Interface Control Register 4 */237#define SP_AUD_INTERFACE_CTRL4_REG 0x67238239/* Audio Interface Control Register 5 */240#define SP_AUD_INTERFACE_CTRL5_REG 0x68241242/* Audio Interface Control Register 6 */243#define SP_AUD_INTERFACE_CTRL6_REG 0x69244245/* Firmware Version Register */246#define SP_FW_VER_REG 0xb7247248#endif249250251