2 * drivers/video/tegra/dc/hdmi.h
4 * non-tegra specific HDMI declarations
6 * Copyright (C) 2010 Google, Inc.
7 * Author: Erik Gilling <konkers@android.com>
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
20 #ifndef __DRIVERS_VIDEO_TEGRA_DC_HDMI_H
21 #define __DRIVERS_VIDEO_TEGRA_DC_HDMI_H
23 #define HDMI_INFOFRAME_TYPE_VENDOR 0x81
24 #define HDMI_INFOFRAME_TYPE_AVI 0x82
25 #define HDMI_INFOFRAME_TYPE_SPD 0x83
26 #define HDMI_INFOFRAME_TYPE_AUDIO 0x84
27 #define HDMI_INFOFRAME_TYPE_MPEG_SRC 0x85
28 #define HDMI_INFOFRAME_TYPE_NTSC_VBI 0x86
30 /* all fields little endian */
31 struct hdmi_avi_infoframe {
36 unsigned s:2; /* scan information */
37 unsigned b:2; /* bar info data valid */
38 unsigned a:1; /* active info present */
39 unsigned y:2; /* RGB or YCbCr */
43 unsigned r:4; /* active format aspect ratio */
44 unsigned m:2; /* picture aspect ratio */
45 unsigned c:2; /* colorimetry */
48 unsigned sc:2; /* scan information */
49 unsigned q:2; /* quantization range */
50 unsigned ec:3; /* extended colorimetry */
51 unsigned itc:1; /* it content */
54 unsigned vic:7; /* video format id code */
58 unsigned pr:4; /* pixel repetition factor */
59 unsigned cn:2; /* it content type*/
60 unsigned yq:2; /* ycc quantization range */
66 u16 bot_bar_start_line;
69 u16 left_bar_end_pixel;
72 u16 right_bar_start_pixel;
73 } __attribute__((packed));
75 #define HDMI_AVI_VERSION 0x02
77 #define HDMI_AVI_Y_RGB 0x0
78 #define HDMI_AVI_Y_YCBCR_422 0x1
79 #define HDMI_AVI_Y_YCBCR_444 0x2
81 #define HDMI_AVI_B_VERT 0x1
82 #define HDMI_AVI_B_HORIZ 0x2
84 #define HDMI_AVI_S_NONE 0x0
85 #define HDMI_AVI_S_OVERSCAN 0x1
86 #define HDMI_AVI_S_UNDERSCAN 0x2
88 #define HDMI_AVI_C_NONE 0x0
89 #define HDMI_AVI_C_SMPTE 0x1
90 #define HDMI_AVI_C_ITU_R 0x2
91 #define HDMI_AVI_C_EXTENDED 0x4
93 #define HDMI_AVI_M_4_3 0x1
94 #define HDMI_AVI_M_16_9 0x2
96 #define HDMI_AVI_R_SAME 0x8
97 #define HDMI_AVI_R_4_3_CENTER 0x9
98 #define HDMI_AVI_R_16_9_CENTER 0xa
99 #define HDMI_AVI_R_14_9_CENTER 0xb
101 /* all fields little endian */
102 struct hdmi_audio_infoframe {
107 unsigned cc:3; /* channel count */
109 unsigned ct:4; /* coding type */
112 unsigned ss:2; /* sample size */
113 unsigned sf:3; /* sample frequency */
117 unsigned cxt:5; /* coding extention type */
121 u8 ca; /* channel/speaker allocation */
125 unsigned lsv:4; /* level shift value */
126 unsigned dm_inh:1; /* downmix inhibit */
128 /* PB6-10 reserved */
134 } __attribute__((packed));
136 #define HDMI_AUDIO_VERSION 0x01
138 #define HDMI_AUDIO_CC_STREAM 0x0 /* specified by audio stream */
139 #define HDMI_AUDIO_CC_2 0x1
140 #define HDMI_AUDIO_CC_3 0x2
141 #define HDMI_AUDIO_CC_4 0x3
142 #define HDMI_AUDIO_CC_5 0x4
143 #define HDMI_AUDIO_CC_6 0x5
144 #define HDMI_AUDIO_CC_7 0x6
145 #define HDMI_AUDIO_CC_8 0x7
147 #define HDMI_AUDIO_CT_STREAM 0x0 /* specified by audio stream */
148 #define HDMI_AUDIO_CT_PCM 0x1
149 #define HDMI_AUDIO_CT_AC3 0x2
150 #define HDMI_AUDIO_CT_MPEG1 0x3
151 #define HDMI_AUDIO_CT_MP3 0x4
152 #define HDMI_AUDIO_CT_MPEG2 0x5
153 #define HDMI_AUDIO_CT_AAC_LC 0x6
154 #define HDMI_AUDIO_CT_DTS 0x7
155 #define HDMI_AUDIO_CT_ATRAC 0x8
156 #define HDMI_AUDIO_CT_DSD 0x9
157 #define HDMI_AUDIO_CT_E_AC3 0xa
158 #define HDMI_AUDIO_CT_DTS_HD 0xb
159 #define HDMI_AUDIO_CT_MLP 0xc
160 #define HDMI_AUDIO_CT_DST 0xd
161 #define HDMI_AUDIO_CT_WMA_PRO 0xe
162 #define HDMI_AUDIO_CT_CXT 0xf
164 #define HDMI_AUDIO_SF_STREAM 0x0 /* specified by audio stream */
165 #define HDMI_AUIDO_SF_32K 0x1
166 #define HDMI_AUDIO_SF_44_1K 0x2
167 #define HDMI_AUDIO_SF_48K 0x3
168 #define HDMI_AUDIO_SF_88_2K 0x4
169 #define HDMI_AUDIO_SF_96K 0x5
170 #define HDMI_AUDIO_SF_176_4K 0x6
171 #define HDMI_AUDIO_SF_192K 0x7
173 #define HDMI_AUDIO_SS_STREAM 0x0 /* specified by audio stream */
174 #define HDMI_AUDIO_SS_16BIT 0x1
175 #define HDMI_AUDIO_SS_20BIT 0x2
176 #define HDMI_AUDIO_SS_24BIT 0x3
178 #define HDMI_AUDIO_CXT_CT 0x0 /* refer to coding in CT */
179 #define HDMI_AUDIO_CXT_HE_AAC 0x1
180 #define HDMI_AUDIO_CXT_HE_AAC_V2 0x2
181 #define HDMI_AUDIO_CXT_MPEG_SURROUND 0x3
183 struct tegra_dc_hdmi_data;
185 unsigned long tegra_hdmi_readl(struct tegra_dc_hdmi_data *hdmi,
187 void tegra_hdmi_writel(struct tegra_dc_hdmi_data *hdmi,
188 unsigned long val, unsigned long reg);