Path: blob/master/drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h
26516 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright(c) 2016, Analogix Semiconductor. All rights reserved.3*/4#ifndef _ANALOGIX_I2C_TXCOMMON_H_5#define _ANALOGIX_I2C_TXCOMMON_H_67/***************************************************************/8/* Register definitions for TX_P2 */9/***************************************************************/1011/*12* Core Register Definitions13*/1415/* Device ID Low Byte Register */16#define SP_DEVICE_IDL_REG 0x021718/* Device ID High Byte Register */19#define SP_DEVICE_IDH_REG 0x032021/* Device version register */22#define SP_DEVICE_VERSION_REG 0x042324/* Power Down Control Register */25#define SP_POWERDOWN_CTRL_REG 0x0526#define SP_REGISTER_PD BIT(7)27#define SP_HDCP_PD BIT(5)28#define SP_AUDIO_PD BIT(4)29#define SP_VIDEO_PD BIT(3)30#define SP_LINK_PD BIT(2)31#define SP_TOTAL_PD BIT(1)3233/* Reset Control Register 1 */34#define SP_RESET_CTRL1_REG 0x0635#define SP_MISC_RST BIT(7)36#define SP_VIDCAP_RST BIT(6)37#define SP_VIDFIF_RST BIT(5)38#define SP_AUDFIF_RST BIT(4)39#define SP_AUDCAP_RST BIT(3)40#define SP_HDCP_RST BIT(2)41#define SP_SW_RST BIT(1)42#define SP_HW_RST BIT(0)4344/* Reset Control Register 2 */45#define SP_RESET_CTRL2_REG 0x0746#define SP_AUX_RST BIT(2)47#define SP_SERDES_FIFO_RST BIT(1)48#define SP_I2C_REG_RST BIT(0)4950/* Video Control Register 1 */51#define SP_VID_CTRL1_REG 0x0852#define SP_VIDEO_EN BIT(7)53#define SP_VIDEO_MUTE BIT(2)54#define SP_DE_GEN BIT(1)55#define SP_DEMUX BIT(0)5657/* Video Control Register 2 */58#define SP_VID_CTRL2_REG 0x0959#define SP_IN_COLOR_F_MASK 0x0360#define SP_IN_YC_BIT_SEL BIT(2)61#define SP_IN_BPC_MASK 0x7062#define SP_IN_BPC_SHIFT 463# define SP_IN_BPC_12BIT 0x0364# define SP_IN_BPC_10BIT 0x0265# define SP_IN_BPC_8BIT 0x0166# define SP_IN_BPC_6BIT 0x0067#define SP_IN_D_RANGE BIT(7)6869/* Video Control Register 3 */70#define SP_VID_CTRL3_REG 0x0a71#define SP_HPD_OUT BIT(6)7273/* Video Control Register 5 */74#define SP_VID_CTRL5_REG 0x0c75#define SP_CSC_STD_SEL BIT(7)76#define SP_XVYCC_RNG_LMT BIT(6)77#define SP_RANGE_Y2R BIT(5)78#define SP_CSPACE_Y2R BIT(4)79#define SP_RGB_RNG_LMT BIT(3)80#define SP_Y_RNG_LMT BIT(2)81#define SP_RANGE_R2Y BIT(1)82#define SP_CSPACE_R2Y BIT(0)8384/* Video Control Register 6 */85#define SP_VID_CTRL6_REG 0x0d86#define SP_TEST_PATTERN_EN BIT(7)87#define SP_VIDEO_PROCESS_EN BIT(6)88#define SP_VID_US_MODE BIT(3)89#define SP_VID_DS_MODE BIT(2)90#define SP_UP_SAMPLE BIT(1)91#define SP_DOWN_SAMPLE BIT(0)9293/* Video Control Register 8 */94#define SP_VID_CTRL8_REG 0x0f95#define SP_VID_VRES_TH BIT(0)9697/* Total Line Status Low Byte Register */98#define SP_TOTAL_LINE_STAL_REG 0x2499100/* Total Line Status High Byte Register */101#define SP_TOTAL_LINE_STAH_REG 0x25102103/* Active Line Status Low Byte Register */104#define SP_ACT_LINE_STAL_REG 0x26105106/* Active Line Status High Byte Register */107#define SP_ACT_LINE_STAH_REG 0x27108109/* Vertical Front Porch Status Register */110#define SP_V_F_PORCH_STA_REG 0x28111112/* Vertical SYNC Width Status Register */113#define SP_V_SYNC_STA_REG 0x29114115/* Vertical Back Porch Status Register */116#define SP_V_B_PORCH_STA_REG 0x2a117118/* Total Pixel Status Low Byte Register */119#define SP_TOTAL_PIXEL_STAL_REG 0x2b120121/* Total Pixel Status High Byte Register */122#define SP_TOTAL_PIXEL_STAH_REG 0x2c123124/* Active Pixel Status Low Byte Register */125#define SP_ACT_PIXEL_STAL_REG 0x2d126127/* Active Pixel Status High Byte Register */128#define SP_ACT_PIXEL_STAH_REG 0x2e129130/* Horizontal Front Porch Status Low Byte Register */131#define SP_H_F_PORCH_STAL_REG 0x2f132133/* Horizontal Front Porch Statys High Byte Register */134#define SP_H_F_PORCH_STAH_REG 0x30135136/* Horizontal SYNC Width Status Low Byte Register */137#define SP_H_SYNC_STAL_REG 0x31138139/* Horizontal SYNC Width Status High Byte Register */140#define SP_H_SYNC_STAH_REG 0x32141142/* Horizontal Back Porch Status Low Byte Register */143#define SP_H_B_PORCH_STAL_REG 0x33144145/* Horizontal Back Porch Status High Byte Register */146#define SP_H_B_PORCH_STAH_REG 0x34147148/* InfoFrame AVI Packet DB1 Register */149#define SP_INFOFRAME_AVI_DB1_REG 0x70150151/* Bit Control Specific Register */152#define SP_BIT_CTRL_SPECIFIC_REG 0x80153#define SP_BIT_CTRL_SELECT_SHIFT 1154#define SP_ENABLE_BIT_CTRL BIT(0)155156/* InfoFrame Audio Packet DB1 Register */157#define SP_INFOFRAME_AUD_DB1_REG 0x83158159/* InfoFrame MPEG Packet DB1 Register */160#define SP_INFOFRAME_MPEG_DB1_REG 0xb0161162/* Audio Channel Status Registers */163#define SP_AUD_CH_STATUS_BASE 0xd0164165/* Audio Channel Num Register 5 */166#define SP_I2S_CHANNEL_NUM_MASK 0xe0167# define SP_I2S_CH_NUM_1 (0x00 << 5)168# define SP_I2S_CH_NUM_2 (0x01 << 5)169# define SP_I2S_CH_NUM_3 (0x02 << 5)170# define SP_I2S_CH_NUM_4 (0x03 << 5)171# define SP_I2S_CH_NUM_5 (0x04 << 5)172# define SP_I2S_CH_NUM_6 (0x05 << 5)173# define SP_I2S_CH_NUM_7 (0x06 << 5)174# define SP_I2S_CH_NUM_8 (0x07 << 5)175#define SP_EXT_VUCP BIT(2)176#define SP_VBIT BIT(1)177#define SP_AUDIO_LAYOUT BIT(0)178179/* Analog Debug Register 1 */180#define SP_ANALOG_DEBUG1_REG 0xdc181182/* Analog Debug Register 2 */183#define SP_ANALOG_DEBUG2_REG 0xdd184#define SP_FORCE_SW_OFF_BYPASS 0x20185#define SP_XTAL_FRQ 0x1c186# define SP_XTAL_FRQ_19M2 (0x00 << 2)187# define SP_XTAL_FRQ_24M (0x01 << 2)188# define SP_XTAL_FRQ_25M (0x02 << 2)189# define SP_XTAL_FRQ_26M (0x03 << 2)190# define SP_XTAL_FRQ_27M (0x04 << 2)191# define SP_XTAL_FRQ_38M4 (0x05 << 2)192# define SP_XTAL_FRQ_52M (0x06 << 2)193#define SP_POWERON_TIME_1P5MS 0x03194195/* Analog Control 0 Register */196#define SP_ANALOG_CTRL0_REG 0xe1197198/* Common Interrupt Status Register 1 */199#define SP_COMMON_INT_STATUS_BASE (0xf1 - 1)200#define SP_PLL_LOCK_CHG 0x40201202/* Common Interrupt Status Register 2 */203#define SP_COMMON_INT_STATUS2 0xf2204#define SP_HDCP_AUTH_CHG BIT(1)205#define SP_HDCP_AUTH_DONE BIT(0)206207#define SP_HDCP_LINK_CHECK_FAIL BIT(0)208209/* Common Interrupt Status Register 4 */210#define SP_COMMON_INT_STATUS4_REG 0xf4211#define SP_HPD_IRQ BIT(6)212#define SP_HPD_ESYNC_ERR BIT(4)213#define SP_HPD_CHG BIT(2)214#define SP_HPD_LOST BIT(1)215#define SP_HPD_PLUG BIT(0)216217/* DP Interrupt Status Register */218#define SP_DP_INT_STATUS1_REG 0xf7219#define SP_TRAINING_FINISH BIT(5)220#define SP_POLLING_ERR BIT(4)221222/* Common Interrupt Mask Register */223#define SP_COMMON_INT_MASK_BASE (0xf8 - 1)224225#define SP_COMMON_INT_MASK4_REG 0xfb226227/* DP Interrupts Mask Register */228#define SP_DP_INT_MASK1_REG 0xfe229230/* Interrupt Control Register */231#define SP_INT_CTRL_REG 0xff232233#endif /* _ANALOGIX_I2C_TXCOMMON_H_ */234235236