xref: /dragonfly/sys/dev/drm/i915/intel_sdvo_regs.h (revision c0e85e96)
1e3adcf8fSFrançois Tigeot /*
2e3adcf8fSFrançois Tigeot  * Copyright © 2006-2007 Intel Corporation
3e3adcf8fSFrançois Tigeot  *
4e3adcf8fSFrançois Tigeot  * Permission is hereby granted, free of charge, to any person obtaining a
5e3adcf8fSFrançois Tigeot  * copy of this software and associated documentation files (the "Software"),
6e3adcf8fSFrançois Tigeot  * to deal in the Software without restriction, including without limitation
7e3adcf8fSFrançois Tigeot  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e3adcf8fSFrançois Tigeot  * and/or sell copies of the Software, and to permit persons to whom the
9e3adcf8fSFrançois Tigeot  * Software is furnished to do so, subject to the following conditions:
10e3adcf8fSFrançois Tigeot  *
11e3adcf8fSFrançois Tigeot  * The above copyright notice and this permission notice (including the next
12e3adcf8fSFrançois Tigeot  * paragraph) shall be included in all copies or substantial portions of the
13e3adcf8fSFrançois Tigeot  * Software.
14e3adcf8fSFrançois Tigeot  *
15e3adcf8fSFrançois Tigeot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16e3adcf8fSFrançois Tigeot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17e3adcf8fSFrançois Tigeot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18e3adcf8fSFrançois Tigeot  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19e3adcf8fSFrançois Tigeot  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20e3adcf8fSFrançois Tigeot  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21e3adcf8fSFrançois Tigeot  * DEALINGS IN THE SOFTWARE.
22e3adcf8fSFrançois Tigeot  *
23e3adcf8fSFrançois Tigeot  * Authors:
24e3adcf8fSFrançois Tigeot  *	Eric Anholt <eric@anholt.net>
25e3adcf8fSFrançois Tigeot  */
26e3adcf8fSFrançois Tigeot 
27*c0e85e96SFrançois Tigeot /*
28*c0e85e96SFrançois Tigeot  * SDVO command definitions and structures.
29e3adcf8fSFrançois Tigeot  */
30e3adcf8fSFrançois Tigeot 
31e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_FIRST   (0)
32e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_TMDS0   (1 << 0)
33e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_RGB0    (1 << 1)
34e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_CVBS0   (1 << 2)
35e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_SVID0   (1 << 3)
36e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_YPRPB0  (1 << 4)
37e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_SCART0  (1 << 5)
38e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_LVDS0   (1 << 6)
39e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_TMDS1   (1 << 8)
40e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_RGB1    (1 << 9)
41e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_CVBS1   (1 << 10)
42e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_SVID1   (1 << 11)
43e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_YPRPB1  (1 << 12)
44e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_SCART1  (1 << 13)
45e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_LVDS1   (1 << 14)
46e3adcf8fSFrançois Tigeot #define SDVO_OUTPUT_LAST    (14)
47e3adcf8fSFrançois Tigeot 
48e3adcf8fSFrançois Tigeot struct intel_sdvo_caps {
49e3adcf8fSFrançois Tigeot 	u8 vendor_id;
50e3adcf8fSFrançois Tigeot 	u8 device_id;
51e3adcf8fSFrançois Tigeot 	u8 device_rev_id;
52e3adcf8fSFrançois Tigeot 	u8 sdvo_version_major;
53e3adcf8fSFrançois Tigeot 	u8 sdvo_version_minor;
54e3adcf8fSFrançois Tigeot 	unsigned int sdvo_inputs_mask:2;
55e3adcf8fSFrançois Tigeot 	unsigned int smooth_scaling:1;
56e3adcf8fSFrançois Tigeot 	unsigned int sharp_scaling:1;
57e3adcf8fSFrançois Tigeot 	unsigned int up_scaling:1;
58e3adcf8fSFrançois Tigeot 	unsigned int down_scaling:1;
59e3adcf8fSFrançois Tigeot 	unsigned int stall_support:1;
60e3adcf8fSFrançois Tigeot 	unsigned int pad:1;
61e3adcf8fSFrançois Tigeot 	u16 output_flags;
629edbd4a0SFrançois Tigeot } __packed;
63e3adcf8fSFrançois Tigeot 
64ce3d36d7SFrançois Tigeot /* Note: SDVO detailed timing flags match EDID misc flags. */
65ce3d36d7SFrançois Tigeot #define DTD_FLAG_HSYNC_POSITIVE (1 << 1)
66ce3d36d7SFrançois Tigeot #define DTD_FLAG_VSYNC_POSITIVE (1 << 2)
67ce3d36d7SFrançois Tigeot #define DTD_FLAG_INTERLACE	(1 << 7)
68ce3d36d7SFrançois Tigeot 
69*c0e85e96SFrançois Tigeot /* This matches the EDID DTD structure, more or less */
70e3adcf8fSFrançois Tigeot struct intel_sdvo_dtd {
71e3adcf8fSFrançois Tigeot 	struct {
72*c0e85e96SFrançois Tigeot 		u16 clock;	/* pixel clock, in 10kHz units */
73*c0e85e96SFrançois Tigeot 		u8 h_active;	/* lower 8 bits (pixels) */
74*c0e85e96SFrançois Tigeot 		u8 h_blank;	/* lower 8 bits (pixels) */
75*c0e85e96SFrançois Tigeot 		u8 h_high;	/* upper 4 bits each h_active, h_blank */
76*c0e85e96SFrançois Tigeot 		u8 v_active;	/* lower 8 bits (lines) */
77*c0e85e96SFrançois Tigeot 		u8 v_blank;	/* lower 8 bits (lines) */
78*c0e85e96SFrançois Tigeot 		u8 v_high;	/* upper 4 bits each v_active, v_blank */
79e3adcf8fSFrançois Tigeot 	} part1;
80e3adcf8fSFrançois Tigeot 
81e3adcf8fSFrançois Tigeot 	struct {
82*c0e85e96SFrançois Tigeot 		u8 h_sync_off;	/* lower 8 bits, from hblank start */
83*c0e85e96SFrançois Tigeot 		u8 h_sync_width;	/* lower 8 bits (pixels) */
84*c0e85e96SFrançois Tigeot 		/* lower 4 bits each vsync offset, vsync width */
85e3adcf8fSFrançois Tigeot 		u8 v_sync_off_width;
86*c0e85e96SFrançois Tigeot 		/*
87e3adcf8fSFrançois Tigeot 		* 2 high bits of hsync offset, 2 high bits of hsync width,
88e3adcf8fSFrançois Tigeot 		* bits 4-5 of vsync offset, and 2 high bits of vsync width.
89e3adcf8fSFrançois Tigeot 		*/
90e3adcf8fSFrançois Tigeot 		u8 sync_off_width_high;
91e3adcf8fSFrançois Tigeot 		u8 dtd_flags;
92e3adcf8fSFrançois Tigeot 		u8 sdvo_flags;
93*c0e85e96SFrançois Tigeot 		/* bits 6-7 of vsync offset at bits 6-7 */
94e3adcf8fSFrançois Tigeot 		u8 v_sync_off_high;
95e3adcf8fSFrançois Tigeot 		u8 reserved;
96e3adcf8fSFrançois Tigeot 	} part2;
979edbd4a0SFrançois Tigeot } __packed;
98e3adcf8fSFrançois Tigeot 
99e3adcf8fSFrançois Tigeot struct intel_sdvo_pixel_clock_range {
100*c0e85e96SFrançois Tigeot 	u16 min;	/* pixel clock, in 10kHz units */
101*c0e85e96SFrançois Tigeot 	u16 max;	/* pixel clock, in 10kHz units */
1029edbd4a0SFrançois Tigeot } __packed;
103e3adcf8fSFrançois Tigeot 
104e3adcf8fSFrançois Tigeot struct intel_sdvo_preferred_input_timing_args {
105e3adcf8fSFrançois Tigeot 	u16 clock;
106e3adcf8fSFrançois Tigeot 	u16 width;
107e3adcf8fSFrançois Tigeot 	u16 height;
108e3adcf8fSFrançois Tigeot 	u8	interlace:1;
109e3adcf8fSFrançois Tigeot 	u8	scaled:1;
110e3adcf8fSFrançois Tigeot 	u8	pad:6;
1119edbd4a0SFrançois Tigeot } __packed;
112e3adcf8fSFrançois Tigeot 
113e3adcf8fSFrançois Tigeot /* I2C registers for SDVO */
114e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_0				0x07
115e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_1				0x06
116e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_2				0x05
117e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_3				0x04
118e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_4				0x03
119e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_5				0x02
120e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_6				0x01
121e3adcf8fSFrançois Tigeot #define SDVO_I2C_ARG_7				0x00
122e3adcf8fSFrançois Tigeot #define SDVO_I2C_OPCODE				0x08
123e3adcf8fSFrançois Tigeot #define SDVO_I2C_CMD_STATUS			0x09
124e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_0			0x0a
125e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_1			0x0b
126e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_2			0x0c
127e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_3			0x0d
128e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_4			0x0e
129e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_5			0x0f
130e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_6			0x10
131e3adcf8fSFrançois Tigeot #define SDVO_I2C_RETURN_7			0x11
132e3adcf8fSFrançois Tigeot #define SDVO_I2C_VENDOR_BEGIN			0x20
133e3adcf8fSFrançois Tigeot 
134e3adcf8fSFrançois Tigeot /* Status results */
135e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_POWER_ON		0x0
136e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_SUCCESS			0x1
137e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_NOTSUPP			0x2
138e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_INVALID_ARG		0x3
139e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_PENDING			0x4
140e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED	0x5
141e3adcf8fSFrançois Tigeot #define SDVO_CMD_STATUS_SCALING_NOT_SUPP	0x6
142e3adcf8fSFrançois Tigeot 
143e3adcf8fSFrançois Tigeot /* SDVO commands, argument/result registers */
144e3adcf8fSFrançois Tigeot 
145e3adcf8fSFrançois Tigeot #define SDVO_CMD_RESET					0x01
146e3adcf8fSFrançois Tigeot 
147*c0e85e96SFrançois Tigeot /* Returns a struct intel_sdvo_caps */
148e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_DEVICE_CAPS			0x02
149e3adcf8fSFrançois Tigeot 
150e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_FIRMWARE_REV			0x86
151e3adcf8fSFrançois Tigeot # define SDVO_DEVICE_FIRMWARE_MINOR			SDVO_I2C_RETURN_0
152e3adcf8fSFrançois Tigeot # define SDVO_DEVICE_FIRMWARE_MAJOR			SDVO_I2C_RETURN_1
153e3adcf8fSFrançois Tigeot # define SDVO_DEVICE_FIRMWARE_PATCH			SDVO_I2C_RETURN_2
154e3adcf8fSFrançois Tigeot 
155*c0e85e96SFrançois Tigeot /*
156e3adcf8fSFrançois Tigeot  * Reports which inputs are trained (managed to sync).
157e3adcf8fSFrançois Tigeot  *
158e3adcf8fSFrançois Tigeot  * Devices must have trained within 2 vsyncs of a mode change.
159e3adcf8fSFrançois Tigeot  */
160e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_TRAINED_INPUTS			0x03
161e3adcf8fSFrançois Tigeot struct intel_sdvo_get_trained_inputs_response {
162e3adcf8fSFrançois Tigeot 	unsigned int input0_trained:1;
163e3adcf8fSFrançois Tigeot 	unsigned int input1_trained:1;
164e3adcf8fSFrançois Tigeot 	unsigned int pad:6;
1659edbd4a0SFrançois Tigeot } __packed;
166e3adcf8fSFrançois Tigeot 
167*c0e85e96SFrançois Tigeot /* Returns a struct intel_sdvo_output_flags of active outputs. */
168e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_ACTIVE_OUTPUTS			0x04
169e3adcf8fSFrançois Tigeot 
170*c0e85e96SFrançois Tigeot /*
171e3adcf8fSFrançois Tigeot  * Sets the current set of active outputs.
172e3adcf8fSFrançois Tigeot  *
173e3adcf8fSFrançois Tigeot  * Takes a struct intel_sdvo_output_flags.  Must be preceded by a SET_IN_OUT_MAP
174e3adcf8fSFrançois Tigeot  * on multi-output devices.
175e3adcf8fSFrançois Tigeot  */
176e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_ACTIVE_OUTPUTS			0x05
177e3adcf8fSFrançois Tigeot 
178*c0e85e96SFrançois Tigeot /*
179e3adcf8fSFrançois Tigeot  * Returns the current mapping of SDVO inputs to outputs on the device.
180e3adcf8fSFrançois Tigeot  *
181e3adcf8fSFrançois Tigeot  * Returns two struct intel_sdvo_output_flags structures.
182e3adcf8fSFrançois Tigeot  */
183e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_IN_OUT_MAP				0x06
184e3adcf8fSFrançois Tigeot struct intel_sdvo_in_out_map {
185e3adcf8fSFrançois Tigeot 	u16 in0, in1;
186e3adcf8fSFrançois Tigeot };
187e3adcf8fSFrançois Tigeot 
188*c0e85e96SFrançois Tigeot /*
189e3adcf8fSFrançois Tigeot  * Sets the current mapping of SDVO inputs to outputs on the device.
190e3adcf8fSFrançois Tigeot  *
191e3adcf8fSFrançois Tigeot  * Takes two struct i380_sdvo_output_flags structures.
192e3adcf8fSFrançois Tigeot  */
193e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_IN_OUT_MAP				0x07
194e3adcf8fSFrançois Tigeot 
195*c0e85e96SFrançois Tigeot /*
196e3adcf8fSFrançois Tigeot  * Returns a struct intel_sdvo_output_flags of attached displays.
197e3adcf8fSFrançois Tigeot  */
198e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_ATTACHED_DISPLAYS			0x0b
199e3adcf8fSFrançois Tigeot 
200*c0e85e96SFrançois Tigeot /*
201e3adcf8fSFrançois Tigeot  * Returns a struct intel_sdvo_ouptut_flags of displays supporting hot plugging.
202e3adcf8fSFrançois Tigeot  */
203e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HOT_PLUG_SUPPORT			0x0c
204e3adcf8fSFrançois Tigeot 
205*c0e85e96SFrançois Tigeot /*
206e3adcf8fSFrançois Tigeot  * Takes a struct intel_sdvo_output_flags.
207e3adcf8fSFrançois Tigeot  */
208e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_ACTIVE_HOT_PLUG			0x0d
209e3adcf8fSFrançois Tigeot 
210*c0e85e96SFrançois Tigeot /*
211e3adcf8fSFrançois Tigeot  * Returns a struct intel_sdvo_output_flags of displays with hot plug
212e3adcf8fSFrançois Tigeot  * interrupts enabled.
213e3adcf8fSFrançois Tigeot  */
214e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_ACTIVE_HOT_PLUG			0x0e
215e3adcf8fSFrançois Tigeot 
216e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_INTERRUPT_EVENT_SOURCE		0x0f
217e3adcf8fSFrançois Tigeot struct intel_sdvo_get_interrupt_event_source_response {
218e3adcf8fSFrançois Tigeot 	u16 interrupt_status;
219e3adcf8fSFrançois Tigeot 	unsigned int ambient_light_interrupt:1;
220e3adcf8fSFrançois Tigeot 	unsigned int hdmi_audio_encrypt_change:1;
221e3adcf8fSFrançois Tigeot 	unsigned int pad:6;
2229edbd4a0SFrançois Tigeot } __packed;
223e3adcf8fSFrançois Tigeot 
224*c0e85e96SFrançois Tigeot /*
225e3adcf8fSFrançois Tigeot  * Selects which input is affected by future input commands.
226e3adcf8fSFrançois Tigeot  *
227e3adcf8fSFrançois Tigeot  * Commands affected include SET_INPUT_TIMINGS_PART[12],
228e3adcf8fSFrançois Tigeot  * GET_INPUT_TIMINGS_PART[12], GET_PREFERRED_INPUT_TIMINGS_PART[12],
229e3adcf8fSFrançois Tigeot  * GET_INPUT_PIXEL_CLOCK_RANGE, and CREATE_PREFERRED_INPUT_TIMINGS.
230e3adcf8fSFrançois Tigeot  */
231e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_TARGET_INPUT			0x10
232e3adcf8fSFrançois Tigeot struct intel_sdvo_set_target_input_args {
233e3adcf8fSFrançois Tigeot 	unsigned int target_1:1;
234e3adcf8fSFrançois Tigeot 	unsigned int pad:7;
2359edbd4a0SFrançois Tigeot } __packed;
236e3adcf8fSFrançois Tigeot 
237*c0e85e96SFrançois Tigeot /*
238e3adcf8fSFrançois Tigeot  * Takes a struct intel_sdvo_output_flags of which outputs are targeted by
239e3adcf8fSFrançois Tigeot  * future output commands.
240e3adcf8fSFrançois Tigeot  *
241e3adcf8fSFrançois Tigeot  * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12],
242e3adcf8fSFrançois Tigeot  * GET_OUTPUT_TIMINGS_PART[12], and GET_OUTPUT_PIXEL_CLOCK_RANGE.
243e3adcf8fSFrançois Tigeot  */
244e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_TARGET_OUTPUT			0x11
245e3adcf8fSFrançois Tigeot 
246e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_INPUT_TIMINGS_PART1		0x12
247e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_INPUT_TIMINGS_PART2		0x13
248e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_INPUT_TIMINGS_PART1		0x14
249e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_INPUT_TIMINGS_PART2		0x15
250e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART1		0x16
251e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART2		0x17
252e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART1		0x18
253e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART2		0x19
254e3adcf8fSFrançois Tigeot /* Part 1 */
255e3adcf8fSFrançois Tigeot # define SDVO_DTD_CLOCK_LOW				SDVO_I2C_ARG_0
256e3adcf8fSFrançois Tigeot # define SDVO_DTD_CLOCK_HIGH				SDVO_I2C_ARG_1
257e3adcf8fSFrançois Tigeot # define SDVO_DTD_H_ACTIVE				SDVO_I2C_ARG_2
258e3adcf8fSFrançois Tigeot # define SDVO_DTD_H_BLANK				SDVO_I2C_ARG_3
259e3adcf8fSFrançois Tigeot # define SDVO_DTD_H_HIGH				SDVO_I2C_ARG_4
260e3adcf8fSFrançois Tigeot # define SDVO_DTD_V_ACTIVE				SDVO_I2C_ARG_5
261e3adcf8fSFrançois Tigeot # define SDVO_DTD_V_BLANK				SDVO_I2C_ARG_6
262e3adcf8fSFrançois Tigeot # define SDVO_DTD_V_HIGH				SDVO_I2C_ARG_7
263e3adcf8fSFrançois Tigeot /* Part 2 */
264e3adcf8fSFrançois Tigeot # define SDVO_DTD_HSYNC_OFF				SDVO_I2C_ARG_0
265e3adcf8fSFrançois Tigeot # define SDVO_DTD_HSYNC_WIDTH				SDVO_I2C_ARG_1
266e3adcf8fSFrançois Tigeot # define SDVO_DTD_VSYNC_OFF_WIDTH			SDVO_I2C_ARG_2
267e3adcf8fSFrançois Tigeot # define SDVO_DTD_SYNC_OFF_WIDTH_HIGH			SDVO_I2C_ARG_3
268e3adcf8fSFrançois Tigeot # define SDVO_DTD_DTD_FLAGS				SDVO_I2C_ARG_4
269e3adcf8fSFrançois Tigeot # define SDVO_DTD_DTD_FLAG_INTERLACED				(1 << 7)
270e3adcf8fSFrançois Tigeot # define SDVO_DTD_DTD_FLAG_STEREO_MASK				(3 << 5)
271e3adcf8fSFrançois Tigeot # define SDVO_DTD_DTD_FLAG_INPUT_MASK				(3 << 3)
272e3adcf8fSFrançois Tigeot # define SDVO_DTD_DTD_FLAG_SYNC_MASK				(3 << 1)
273e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAS				SDVO_I2C_ARG_5
274e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_STALL				(1 << 7)
275e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_CENTERED				(0 << 6)
276e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_UPPER_LEFT				(1 << 6)
277e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_SCALING_MASK			(3 << 4)
278e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_SCALING_NONE			(0 << 4)
279e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_SCALING_SHARP			(1 << 4)
280e3adcf8fSFrançois Tigeot # define SDVO_DTD_SDVO_FLAG_SCALING_SMOOTH			(2 << 4)
281e3adcf8fSFrançois Tigeot # define SDVO_DTD_VSYNC_OFF_HIGH			SDVO_I2C_ARG_6
282e3adcf8fSFrançois Tigeot 
283*c0e85e96SFrançois Tigeot /*
284e3adcf8fSFrançois Tigeot  * Generates a DTD based on the given width, height, and flags.
285e3adcf8fSFrançois Tigeot  *
286e3adcf8fSFrançois Tigeot  * This will be supported by any device supporting scaling or interlaced
287e3adcf8fSFrançois Tigeot  * modes.
288e3adcf8fSFrançois Tigeot  */
289e3adcf8fSFrançois Tigeot #define SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING		0x1a
290e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_LOW		SDVO_I2C_ARG_0
291e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_HIGH		SDVO_I2C_ARG_1
292e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_LOW		SDVO_I2C_ARG_2
293e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_HIGH		SDVO_I2C_ARG_3
294e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_LOW		SDVO_I2C_ARG_4
295e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_HIGH	SDVO_I2C_ARG_5
296e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_FLAGS		SDVO_I2C_ARG_6
297e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_INTERLACED		(1 << 0)
298e3adcf8fSFrançois Tigeot # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_SCALED		(1 << 1)
299e3adcf8fSFrançois Tigeot 
300e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1	0x1b
301e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2	0x1c
302e3adcf8fSFrançois Tigeot 
303*c0e85e96SFrançois Tigeot /* Returns a struct intel_sdvo_pixel_clock_range */
304e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE		0x1d
305*c0e85e96SFrançois Tigeot /* Returns a struct intel_sdvo_pixel_clock_range */
306e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE		0x1e
307e3adcf8fSFrançois Tigeot 
308*c0e85e96SFrançois Tigeot /* Returns a byte bitfield containing SDVO_CLOCK_RATE_MULT_* flags */
309e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SUPPORTED_CLOCK_RATE_MULTS		0x1f
310e3adcf8fSFrançois Tigeot 
311*c0e85e96SFrançois Tigeot /* Returns a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
312e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_CLOCK_RATE_MULT			0x20
313*c0e85e96SFrançois Tigeot /* Takes a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
314e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_CLOCK_RATE_MULT			0x21
315e3adcf8fSFrançois Tigeot # define SDVO_CLOCK_RATE_MULT_1X				(1 << 0)
316e3adcf8fSFrançois Tigeot # define SDVO_CLOCK_RATE_MULT_2X				(1 << 1)
317e3adcf8fSFrançois Tigeot # define SDVO_CLOCK_RATE_MULT_4X				(1 << 3)
318e3adcf8fSFrançois Tigeot 
319e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SUPPORTED_TV_FORMATS		0x27
320*c0e85e96SFrançois Tigeot /* 6 bytes of bit flags for TV formats shared by all TV format functions */
321e3adcf8fSFrançois Tigeot struct intel_sdvo_tv_format {
322e3adcf8fSFrançois Tigeot 	unsigned int ntsc_m:1;
323e3adcf8fSFrançois Tigeot 	unsigned int ntsc_j:1;
324e3adcf8fSFrançois Tigeot 	unsigned int ntsc_443:1;
325e3adcf8fSFrançois Tigeot 	unsigned int pal_b:1;
326e3adcf8fSFrançois Tigeot 	unsigned int pal_d:1;
327e3adcf8fSFrançois Tigeot 	unsigned int pal_g:1;
328e3adcf8fSFrançois Tigeot 	unsigned int pal_h:1;
329e3adcf8fSFrançois Tigeot 	unsigned int pal_i:1;
330e3adcf8fSFrançois Tigeot 
331e3adcf8fSFrançois Tigeot 	unsigned int pal_m:1;
332e3adcf8fSFrançois Tigeot 	unsigned int pal_n:1;
333e3adcf8fSFrançois Tigeot 	unsigned int pal_nc:1;
334e3adcf8fSFrançois Tigeot 	unsigned int pal_60:1;
335e3adcf8fSFrançois Tigeot 	unsigned int secam_b:1;
336e3adcf8fSFrançois Tigeot 	unsigned int secam_d:1;
337e3adcf8fSFrançois Tigeot 	unsigned int secam_g:1;
338e3adcf8fSFrançois Tigeot 	unsigned int secam_k:1;
339e3adcf8fSFrançois Tigeot 
340e3adcf8fSFrançois Tigeot 	unsigned int secam_k1:1;
341e3adcf8fSFrançois Tigeot 	unsigned int secam_l:1;
342e3adcf8fSFrançois Tigeot 	unsigned int secam_60:1;
343e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_240m_1080i_59:1;
344e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_240m_1080i_60:1;
345e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_260m_1080i_59:1;
346e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_260m_1080i_60:1;
347e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_50:1;
348e3adcf8fSFrançois Tigeot 
349e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_59:1;
350e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_60:1;
351e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_23:1;
352e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_24:1;
353e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_25:1;
354e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_29:1;
355e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_30:1;
356e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_50:1;
357e3adcf8fSFrançois Tigeot 
358e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_59:1;
359e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_60:1;
360e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_295m_1080i_50:1;
361e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_295m_1080p_50:1;
362e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_59:1;
363e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_60:1;
364e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_50:1;
365e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_293m_480p_59:1;
366e3adcf8fSFrançois Tigeot 
367e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_170m_480i_59:1;
368e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_iturbt601_576i_50:1;
369e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_iturbt601_576p_50:1;
370e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_eia_7702a_480i_60:1;
371e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_eia_7702a_480p_60:1;
372e3adcf8fSFrançois Tigeot 	unsigned int pad:3;
3739edbd4a0SFrançois Tigeot } __packed;
374e3adcf8fSFrançois Tigeot 
375e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_TV_FORMAT				0x28
376e3adcf8fSFrançois Tigeot 
377e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_TV_FORMAT				0x29
378e3adcf8fSFrançois Tigeot 
379*c0e85e96SFrançois Tigeot /* Returns the resolutiosn that can be used with the given TV format */
380e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT		0x83
381e3adcf8fSFrançois Tigeot struct intel_sdvo_sdtv_resolution_request {
382e3adcf8fSFrançois Tigeot 	unsigned int ntsc_m:1;
383e3adcf8fSFrançois Tigeot 	unsigned int ntsc_j:1;
384e3adcf8fSFrançois Tigeot 	unsigned int ntsc_443:1;
385e3adcf8fSFrançois Tigeot 	unsigned int pal_b:1;
386e3adcf8fSFrançois Tigeot 	unsigned int pal_d:1;
387e3adcf8fSFrançois Tigeot 	unsigned int pal_g:1;
388e3adcf8fSFrançois Tigeot 	unsigned int pal_h:1;
389e3adcf8fSFrançois Tigeot 	unsigned int pal_i:1;
390e3adcf8fSFrançois Tigeot 
391e3adcf8fSFrançois Tigeot 	unsigned int pal_m:1;
392e3adcf8fSFrançois Tigeot 	unsigned int pal_n:1;
393e3adcf8fSFrançois Tigeot 	unsigned int pal_nc:1;
394e3adcf8fSFrançois Tigeot 	unsigned int pal_60:1;
395e3adcf8fSFrançois Tigeot 	unsigned int secam_b:1;
396e3adcf8fSFrançois Tigeot 	unsigned int secam_d:1;
397e3adcf8fSFrançois Tigeot 	unsigned int secam_g:1;
398e3adcf8fSFrançois Tigeot 	unsigned int secam_k:1;
399e3adcf8fSFrançois Tigeot 
400e3adcf8fSFrançois Tigeot 	unsigned int secam_k1:1;
401e3adcf8fSFrançois Tigeot 	unsigned int secam_l:1;
402e3adcf8fSFrançois Tigeot 	unsigned int secam_60:1;
403e3adcf8fSFrançois Tigeot 	unsigned int pad:5;
4049edbd4a0SFrançois Tigeot } __packed;
405e3adcf8fSFrançois Tigeot 
406e3adcf8fSFrançois Tigeot struct intel_sdvo_sdtv_resolution_reply {
407e3adcf8fSFrançois Tigeot 	unsigned int res_320x200:1;
408e3adcf8fSFrançois Tigeot 	unsigned int res_320x240:1;
409e3adcf8fSFrançois Tigeot 	unsigned int res_400x300:1;
410e3adcf8fSFrançois Tigeot 	unsigned int res_640x350:1;
411e3adcf8fSFrançois Tigeot 	unsigned int res_640x400:1;
412e3adcf8fSFrançois Tigeot 	unsigned int res_640x480:1;
413e3adcf8fSFrançois Tigeot 	unsigned int res_704x480:1;
414e3adcf8fSFrançois Tigeot 	unsigned int res_704x576:1;
415e3adcf8fSFrançois Tigeot 
416e3adcf8fSFrançois Tigeot 	unsigned int res_720x350:1;
417e3adcf8fSFrançois Tigeot 	unsigned int res_720x400:1;
418e3adcf8fSFrançois Tigeot 	unsigned int res_720x480:1;
419e3adcf8fSFrançois Tigeot 	unsigned int res_720x540:1;
420e3adcf8fSFrançois Tigeot 	unsigned int res_720x576:1;
421e3adcf8fSFrançois Tigeot 	unsigned int res_768x576:1;
422e3adcf8fSFrançois Tigeot 	unsigned int res_800x600:1;
423e3adcf8fSFrançois Tigeot 	unsigned int res_832x624:1;
424e3adcf8fSFrançois Tigeot 
425e3adcf8fSFrançois Tigeot 	unsigned int res_920x766:1;
426e3adcf8fSFrançois Tigeot 	unsigned int res_1024x768:1;
427e3adcf8fSFrançois Tigeot 	unsigned int res_1280x1024:1;
428e3adcf8fSFrançois Tigeot 	unsigned int pad:5;
4299edbd4a0SFrançois Tigeot } __packed;
430e3adcf8fSFrançois Tigeot 
431e3adcf8fSFrançois Tigeot /* Get supported resolution with squire pixel aspect ratio that can be
432e3adcf8fSFrançois Tigeot    scaled for the requested HDTV format */
433e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT		0x85
434e3adcf8fSFrançois Tigeot 
435e3adcf8fSFrançois Tigeot struct intel_sdvo_hdtv_resolution_request {
436e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_240m_1080i_59:1;
437e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_240m_1080i_60:1;
438e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_260m_1080i_59:1;
439e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_260m_1080i_60:1;
440e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_50:1;
441e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_59:1;
442e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080i_60:1;
443e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_23:1;
444e3adcf8fSFrançois Tigeot 
445e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_24:1;
446e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_25:1;
447e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_29:1;
448e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_30:1;
449e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_50:1;
450e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_59:1;
451e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_274m_1080p_60:1;
452e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_295m_1080i_50:1;
453e3adcf8fSFrançois Tigeot 
454e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_295m_1080p_50:1;
455e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_59:1;
456e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_60:1;
457e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_296m_720p_50:1;
458e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_293m_480p_59:1;
459e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_smpte_170m_480i_59:1;
460e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_iturbt601_576i_50:1;
461e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_iturbt601_576p_50:1;
462e3adcf8fSFrançois Tigeot 
463e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_eia_7702a_480i_60:1;
464e3adcf8fSFrançois Tigeot 	unsigned int hdtv_std_eia_7702a_480p_60:1;
465e3adcf8fSFrançois Tigeot 	unsigned int pad:6;
4669edbd4a0SFrançois Tigeot } __packed;
467e3adcf8fSFrançois Tigeot 
468e3adcf8fSFrançois Tigeot struct intel_sdvo_hdtv_resolution_reply {
469e3adcf8fSFrançois Tigeot 	unsigned int res_640x480:1;
470e3adcf8fSFrançois Tigeot 	unsigned int res_800x600:1;
471e3adcf8fSFrançois Tigeot 	unsigned int res_1024x768:1;
472e3adcf8fSFrançois Tigeot 	unsigned int res_1280x960:1;
473e3adcf8fSFrançois Tigeot 	unsigned int res_1400x1050:1;
474e3adcf8fSFrançois Tigeot 	unsigned int res_1600x1200:1;
475e3adcf8fSFrançois Tigeot 	unsigned int res_1920x1440:1;
476e3adcf8fSFrançois Tigeot 	unsigned int res_2048x1536:1;
477e3adcf8fSFrançois Tigeot 
478e3adcf8fSFrançois Tigeot 	unsigned int res_2560x1920:1;
479e3adcf8fSFrançois Tigeot 	unsigned int res_3200x2400:1;
480e3adcf8fSFrançois Tigeot 	unsigned int res_3840x2880:1;
481e3adcf8fSFrançois Tigeot 	unsigned int pad1:5;
482e3adcf8fSFrançois Tigeot 
483e3adcf8fSFrançois Tigeot 	unsigned int res_848x480:1;
484e3adcf8fSFrançois Tigeot 	unsigned int res_1064x600:1;
485e3adcf8fSFrançois Tigeot 	unsigned int res_1280x720:1;
486e3adcf8fSFrançois Tigeot 	unsigned int res_1360x768:1;
487e3adcf8fSFrançois Tigeot 	unsigned int res_1704x960:1;
488e3adcf8fSFrançois Tigeot 	unsigned int res_1864x1050:1;
489e3adcf8fSFrançois Tigeot 	unsigned int res_1920x1080:1;
490e3adcf8fSFrançois Tigeot 	unsigned int res_2128x1200:1;
491e3adcf8fSFrançois Tigeot 
492e3adcf8fSFrançois Tigeot 	unsigned int res_2560x1400:1;
493e3adcf8fSFrançois Tigeot 	unsigned int res_2728x1536:1;
494e3adcf8fSFrançois Tigeot 	unsigned int res_3408x1920:1;
495e3adcf8fSFrançois Tigeot 	unsigned int res_4264x2400:1;
496e3adcf8fSFrançois Tigeot 	unsigned int res_5120x2880:1;
497e3adcf8fSFrançois Tigeot 	unsigned int pad2:3;
498e3adcf8fSFrançois Tigeot 
499e3adcf8fSFrançois Tigeot 	unsigned int res_768x480:1;
500e3adcf8fSFrançois Tigeot 	unsigned int res_960x600:1;
501e3adcf8fSFrançois Tigeot 	unsigned int res_1152x720:1;
502e3adcf8fSFrançois Tigeot 	unsigned int res_1124x768:1;
503e3adcf8fSFrançois Tigeot 	unsigned int res_1536x960:1;
504e3adcf8fSFrançois Tigeot 	unsigned int res_1680x1050:1;
505e3adcf8fSFrançois Tigeot 	unsigned int res_1728x1080:1;
506e3adcf8fSFrançois Tigeot 	unsigned int res_1920x1200:1;
507e3adcf8fSFrançois Tigeot 
508e3adcf8fSFrançois Tigeot 	unsigned int res_2304x1440:1;
509e3adcf8fSFrançois Tigeot 	unsigned int res_2456x1536:1;
510e3adcf8fSFrançois Tigeot 	unsigned int res_3072x1920:1;
511e3adcf8fSFrançois Tigeot 	unsigned int res_3840x2400:1;
512e3adcf8fSFrançois Tigeot 	unsigned int res_4608x2880:1;
513e3adcf8fSFrançois Tigeot 	unsigned int pad3:3;
514e3adcf8fSFrançois Tigeot 
515e3adcf8fSFrançois Tigeot 	unsigned int res_1280x1024:1;
516e3adcf8fSFrançois Tigeot 	unsigned int pad4:7;
517e3adcf8fSFrançois Tigeot 
518e3adcf8fSFrançois Tigeot 	unsigned int res_1280x768:1;
519e3adcf8fSFrançois Tigeot 	unsigned int pad5:7;
5209edbd4a0SFrançois Tigeot } __packed;
521e3adcf8fSFrançois Tigeot 
522e3adcf8fSFrançois Tigeot /* Get supported power state returns info for encoder and monitor, rely on
523e3adcf8fSFrançois Tigeot    last SetTargetInput and SetTargetOutput calls */
524e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SUPPORTED_POWER_STATES		0x2a
525e3adcf8fSFrançois Tigeot /* Get power state returns info for encoder and monitor, rely on last
526e3adcf8fSFrançois Tigeot    SetTargetInput and SetTargetOutput calls */
527e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_POWER_STATE			0x2b
528e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_ENCODER_POWER_STATE		0x2b
529e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_ENCODER_POWER_STATE		0x2c
530e3adcf8fSFrançois Tigeot # define SDVO_ENCODER_STATE_ON					(1 << 0)
531e3adcf8fSFrançois Tigeot # define SDVO_ENCODER_STATE_STANDBY				(1 << 1)
532e3adcf8fSFrançois Tigeot # define SDVO_ENCODER_STATE_SUSPEND				(1 << 2)
533e3adcf8fSFrançois Tigeot # define SDVO_ENCODER_STATE_OFF					(1 << 3)
534e3adcf8fSFrançois Tigeot # define SDVO_MONITOR_STATE_ON					(1 << 4)
535e3adcf8fSFrançois Tigeot # define SDVO_MONITOR_STATE_STANDBY				(1 << 5)
536e3adcf8fSFrançois Tigeot # define SDVO_MONITOR_STATE_SUSPEND				(1 << 6)
537e3adcf8fSFrançois Tigeot # define SDVO_MONITOR_STATE_OFF					(1 << 7)
538e3adcf8fSFrançois Tigeot 
539e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING		0x2d
540e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_PANEL_POWER_SEQUENCING		0x2e
541e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_PANEL_POWER_SEQUENCING		0x2f
542*c0e85e96SFrançois Tigeot /*
543e3adcf8fSFrançois Tigeot  * The panel power sequencing parameters are in units of milliseconds.
544e3adcf8fSFrançois Tigeot  * The high fields are bits 8:9 of the 10-bit values.
545e3adcf8fSFrançois Tigeot  */
546e3adcf8fSFrançois Tigeot struct sdvo_panel_power_sequencing {
547e3adcf8fSFrançois Tigeot 	u8 t0;
548e3adcf8fSFrançois Tigeot 	u8 t1;
549e3adcf8fSFrançois Tigeot 	u8 t2;
550e3adcf8fSFrançois Tigeot 	u8 t3;
551e3adcf8fSFrançois Tigeot 	u8 t4;
552e3adcf8fSFrançois Tigeot 
553e3adcf8fSFrançois Tigeot 	unsigned int t0_high:2;
554e3adcf8fSFrançois Tigeot 	unsigned int t1_high:2;
555e3adcf8fSFrançois Tigeot 	unsigned int t2_high:2;
556e3adcf8fSFrançois Tigeot 	unsigned int t3_high:2;
557e3adcf8fSFrançois Tigeot 
558e3adcf8fSFrançois Tigeot 	unsigned int t4_high:2;
559e3adcf8fSFrançois Tigeot 	unsigned int pad:6;
5609edbd4a0SFrançois Tigeot } __packed;
561e3adcf8fSFrançois Tigeot 
562e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL		0x30
563e3adcf8fSFrançois Tigeot struct sdvo_max_backlight_reply {
564e3adcf8fSFrançois Tigeot 	u8 max_value;
565e3adcf8fSFrançois Tigeot 	u8 default_value;
5669edbd4a0SFrançois Tigeot } __packed;
567e3adcf8fSFrançois Tigeot 
568e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_BACKLIGHT_LEVEL			0x31
569e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_BACKLIGHT_LEVEL			0x32
570e3adcf8fSFrançois Tigeot 
571e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_AMBIENT_LIGHT			0x33
572e3adcf8fSFrançois Tigeot struct sdvo_get_ambient_light_reply {
573e3adcf8fSFrançois Tigeot 	u16 trip_low;
574e3adcf8fSFrançois Tigeot 	u16 trip_high;
575e3adcf8fSFrançois Tigeot 	u16 value;
5769edbd4a0SFrançois Tigeot } __packed;
577e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_AMBIENT_LIGHT			0x34
578e3adcf8fSFrançois Tigeot struct sdvo_set_ambient_light_reply {
579e3adcf8fSFrançois Tigeot 	u16 trip_low;
580e3adcf8fSFrançois Tigeot 	u16 trip_high;
581e3adcf8fSFrançois Tigeot 	unsigned int enable:1;
582e3adcf8fSFrançois Tigeot 	unsigned int pad:7;
5839edbd4a0SFrançois Tigeot } __packed;
584e3adcf8fSFrançois Tigeot 
585e3adcf8fSFrançois Tigeot /* Set display power state */
586e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_DISPLAY_POWER_STATE		0x7d
587e3adcf8fSFrançois Tigeot # define SDVO_DISPLAY_STATE_ON				(1 << 0)
588e3adcf8fSFrançois Tigeot # define SDVO_DISPLAY_STATE_STANDBY			(1 << 1)
589e3adcf8fSFrançois Tigeot # define SDVO_DISPLAY_STATE_SUSPEND			(1 << 2)
590e3adcf8fSFrançois Tigeot # define SDVO_DISPLAY_STATE_OFF				(1 << 3)
591e3adcf8fSFrançois Tigeot 
592e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS		0x84
593e3adcf8fSFrançois Tigeot struct intel_sdvo_enhancements_reply {
594e3adcf8fSFrançois Tigeot 	unsigned int flicker_filter:1;
595e3adcf8fSFrançois Tigeot 	unsigned int flicker_filter_adaptive:1;
596e3adcf8fSFrançois Tigeot 	unsigned int flicker_filter_2d:1;
597e3adcf8fSFrançois Tigeot 	unsigned int saturation:1;
598e3adcf8fSFrançois Tigeot 	unsigned int hue:1;
599e3adcf8fSFrançois Tigeot 	unsigned int brightness:1;
600e3adcf8fSFrançois Tigeot 	unsigned int contrast:1;
601e3adcf8fSFrançois Tigeot 	unsigned int overscan_h:1;
602e3adcf8fSFrançois Tigeot 
603e3adcf8fSFrançois Tigeot 	unsigned int overscan_v:1;
604e3adcf8fSFrançois Tigeot 	unsigned int hpos:1;
605e3adcf8fSFrançois Tigeot 	unsigned int vpos:1;
606e3adcf8fSFrançois Tigeot 	unsigned int sharpness:1;
607e3adcf8fSFrançois Tigeot 	unsigned int dot_crawl:1;
608e3adcf8fSFrançois Tigeot 	unsigned int dither:1;
609e3adcf8fSFrançois Tigeot 	unsigned int tv_chroma_filter:1;
610e3adcf8fSFrançois Tigeot 	unsigned int tv_luma_filter:1;
6119edbd4a0SFrançois Tigeot } __packed;
612e3adcf8fSFrançois Tigeot 
613e3adcf8fSFrançois Tigeot /* Picture enhancement limits below are dependent on the current TV format,
614e3adcf8fSFrançois Tigeot  * and thus need to be queried and set after it.
615e3adcf8fSFrançois Tigeot  */
616e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_FLICKER_FILTER			0x4d
617e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_FLICKER_FILTER_ADAPTIVE	0x7b
618e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_FLICKER_FILTER_2D		0x52
619e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_SATURATION			0x55
620e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_HUE				0x58
621e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_BRIGHTNESS			0x5b
622e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_CONTRAST			0x5e
623e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_OVERSCAN_H			0x61
624e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_OVERSCAN_V			0x64
625e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_HPOS				0x67
626e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_VPOS				0x6a
627e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_SHARPNESS			0x6d
628e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_TV_CHROMA_FILTER		0x74
629e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_MAX_TV_LUMA_FILTER			0x77
630e3adcf8fSFrançois Tigeot struct intel_sdvo_enhancement_limits_reply {
631e3adcf8fSFrançois Tigeot 	u16 max_value;
632e3adcf8fSFrançois Tigeot 	u16 default_value;
6339edbd4a0SFrançois Tigeot } __packed;
634e3adcf8fSFrançois Tigeot 
635e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_LVDS_PANEL_INFORMATION		0x7f
636e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_LVDS_PANEL_INFORMATION		0x80
637e3adcf8fSFrançois Tigeot # define SDVO_LVDS_COLOR_DEPTH_18			(0 << 0)
638e3adcf8fSFrançois Tigeot # define SDVO_LVDS_COLOR_DEPTH_24			(1 << 0)
639e3adcf8fSFrançois Tigeot # define SDVO_LVDS_CONNECTOR_SPWG			(0 << 2)
640e3adcf8fSFrançois Tigeot # define SDVO_LVDS_CONNECTOR_OPENLDI			(1 << 2)
641e3adcf8fSFrançois Tigeot # define SDVO_LVDS_SINGLE_CHANNEL			(0 << 4)
642e3adcf8fSFrançois Tigeot # define SDVO_LVDS_DUAL_CHANNEL				(1 << 4)
643e3adcf8fSFrançois Tigeot 
644e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_FLICKER_FILTER			0x4e
645e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_FLICKER_FILTER			0x4f
646e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_FLICKER_FILTER_ADAPTIVE		0x50
647e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_FLICKER_FILTER_ADAPTIVE		0x51
648e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_FLICKER_FILTER_2D			0x53
649e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_FLICKER_FILTER_2D			0x54
650e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SATURATION				0x56
651e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_SATURATION				0x57
652e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HUE				0x59
653e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HUE				0x5a
654e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_BRIGHTNESS				0x5c
655e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_BRIGHTNESS				0x5d
656e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_CONTRAST				0x5f
657e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_CONTRAST				0x60
658e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_OVERSCAN_H				0x62
659e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_OVERSCAN_H				0x63
660e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_OVERSCAN_V				0x65
661e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_OVERSCAN_V				0x66
662e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HPOS				0x68
663e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HPOS				0x69
664e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_VPOS				0x6b
665e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_VPOS				0x6c
666e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SHARPNESS				0x6e
667e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_SHARPNESS				0x6f
668e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_TV_CHROMA_FILTER			0x75
669e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_TV_CHROMA_FILTER			0x76
670e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_TV_LUMA_FILTER			0x78
671e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_TV_LUMA_FILTER			0x79
672e3adcf8fSFrançois Tigeot struct intel_sdvo_enhancements_arg {
673e3adcf8fSFrançois Tigeot 	u16 value;
6749edbd4a0SFrançois Tigeot } __packed;
675e3adcf8fSFrançois Tigeot 
676e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_DOT_CRAWL				0x70
677e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_DOT_CRAWL				0x71
678e3adcf8fSFrançois Tigeot # define SDVO_DOT_CRAWL_ON					(1 << 0)
679e3adcf8fSFrançois Tigeot # define SDVO_DOT_CRAWL_DEFAULT_ON				(1 << 1)
680e3adcf8fSFrançois Tigeot 
681e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_DITHER				0x72
682e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_DITHER				0x73
683e3adcf8fSFrançois Tigeot # define SDVO_DITHER_ON						(1 << 0)
684e3adcf8fSFrançois Tigeot # define SDVO_DITHER_DEFAULT_ON					(1 << 1)
685e3adcf8fSFrançois Tigeot 
686e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_CONTROL_BUS_SWITCH			0x7a
687e3adcf8fSFrançois Tigeot # define SDVO_CONTROL_BUS_PROM				(1 << 0)
688e3adcf8fSFrançois Tigeot # define SDVO_CONTROL_BUS_DDC1				(1 << 1)
689e3adcf8fSFrançois Tigeot # define SDVO_CONTROL_BUS_DDC2				(1 << 2)
690e3adcf8fSFrançois Tigeot # define SDVO_CONTROL_BUS_DDC3				(1 << 3)
691e3adcf8fSFrançois Tigeot 
692e3adcf8fSFrançois Tigeot /* HDMI op codes */
693e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_SUPP_ENCODE	0x9d
694e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_ENCODE		0x9e
695e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_ENCODE		0x9f
696e3adcf8fSFrançois Tigeot   #define SDVO_ENCODE_DVI	0x0
697e3adcf8fSFrançois Tigeot   #define SDVO_ENCODE_HDMI	0x1
698e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_PIXEL_REPLI	0x8b
699e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_PIXEL_REPLI	0x8c
700e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_COLORIMETRY_CAP	0x8d
701e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_COLORIMETRY	0x8e
702e3adcf8fSFrançois Tigeot   #define SDVO_COLORIMETRY_RGB256   0x0
703e3adcf8fSFrançois Tigeot   #define SDVO_COLORIMETRY_RGB220   0x1
704e3adcf8fSFrançois Tigeot   #define SDVO_COLORIMETRY_YCrCb422 0x3
705e3adcf8fSFrançois Tigeot   #define SDVO_COLORIMETRY_YCrCb444 0x4
706e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_COLORIMETRY	0x8f
707e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER 0x90
708e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_AUDIO_STAT		0x91
709e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_AUDIO_STAT		0x92
710e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HBUF_INDEX		0x93
711ce3d36d7SFrançois Tigeot   #define SDVO_HBUF_INDEX_ELD		0
712ce3d36d7SFrançois Tigeot   #define SDVO_HBUF_INDEX_AVI_IF	1
713e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HBUF_INDEX		0x94
714e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HBUF_INFO		0x95
715e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HBUF_AV_SPLIT	0x96
716e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HBUF_AV_SPLIT	0x97
717e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HBUF_DATA		0x98
718e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HBUF_DATA		0x99
719e3adcf8fSFrançois Tigeot #define SDVO_CMD_SET_HBUF_TXRATE	0x9a
720e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_HBUF_TXRATE	0x9b
721e3adcf8fSFrançois Tigeot   #define SDVO_HBUF_TX_DISABLED	(0 << 6)
722e3adcf8fSFrançois Tigeot   #define SDVO_HBUF_TX_ONCE	(2 << 6)
723e3adcf8fSFrançois Tigeot   #define SDVO_HBUF_TX_VSYNC	(3 << 6)
724e3adcf8fSFrançois Tigeot #define SDVO_CMD_GET_AUDIO_TX_INFO	0x9c
725e3adcf8fSFrançois Tigeot #define SDVO_NEED_TO_STALL  (1 << 7)
726e3adcf8fSFrançois Tigeot 
727e3adcf8fSFrançois Tigeot struct intel_sdvo_encode {
728e3adcf8fSFrançois Tigeot 	u8 dvi_rev;
729e3adcf8fSFrançois Tigeot 	u8 hdmi_rev;
7309edbd4a0SFrançois Tigeot } __packed;
731