1379bc100SJani Nikula /* 2379bc100SJani Nikula * Copyright © 2006-2007 Intel Corporation 3379bc100SJani Nikula * 4379bc100SJani Nikula * Permission is hereby granted, free of charge, to any person obtaining a 5379bc100SJani Nikula * copy of this software and associated documentation files (the "Software"), 6379bc100SJani Nikula * to deal in the Software without restriction, including without limitation 7379bc100SJani Nikula * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8379bc100SJani Nikula * and/or sell copies of the Software, and to permit persons to whom the 9379bc100SJani Nikula * Software is furnished to do so, subject to the following conditions: 10379bc100SJani Nikula * 11379bc100SJani Nikula * The above copyright notice and this permission notice (including the next 12379bc100SJani Nikula * paragraph) shall be included in all copies or substantial portions of the 13379bc100SJani Nikula * Software. 14379bc100SJani Nikula * 15379bc100SJani Nikula * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16379bc100SJani Nikula * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17379bc100SJani Nikula * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18379bc100SJani Nikula * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19379bc100SJani Nikula * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20379bc100SJani Nikula * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21379bc100SJani Nikula * DEALINGS IN THE SOFTWARE. 22379bc100SJani Nikula * 23379bc100SJani Nikula * Authors: 24379bc100SJani Nikula * Eric Anholt <eric@anholt.net> 25379bc100SJani Nikula */ 26379bc100SJani Nikula 27379bc100SJani Nikula #ifndef __INTEL_SDVO_REGS_H__ 28379bc100SJani Nikula #define __INTEL_SDVO_REGS_H__ 29379bc100SJani Nikula 30379bc100SJani Nikula #include <linux/compiler.h> 31379bc100SJani Nikula #include <linux/types.h> 32379bc100SJani Nikula 33379bc100SJani Nikula /* 34379bc100SJani Nikula * SDVO command definitions and structures. 35379bc100SJani Nikula */ 36379bc100SJani Nikula 37379bc100SJani Nikula #define SDVO_OUTPUT_FIRST (0) 38379bc100SJani Nikula #define SDVO_OUTPUT_TMDS0 (1 << 0) 39379bc100SJani Nikula #define SDVO_OUTPUT_RGB0 (1 << 1) 40379bc100SJani Nikula #define SDVO_OUTPUT_CVBS0 (1 << 2) 41379bc100SJani Nikula #define SDVO_OUTPUT_SVID0 (1 << 3) 42379bc100SJani Nikula #define SDVO_OUTPUT_YPRPB0 (1 << 4) 43379bc100SJani Nikula #define SDVO_OUTPUT_SCART0 (1 << 5) 44379bc100SJani Nikula #define SDVO_OUTPUT_LVDS0 (1 << 6) 45379bc100SJani Nikula #define SDVO_OUTPUT_TMDS1 (1 << 8) 46379bc100SJani Nikula #define SDVO_OUTPUT_RGB1 (1 << 9) 47379bc100SJani Nikula #define SDVO_OUTPUT_CVBS1 (1 << 10) 48379bc100SJani Nikula #define SDVO_OUTPUT_SVID1 (1 << 11) 49379bc100SJani Nikula #define SDVO_OUTPUT_YPRPB1 (1 << 12) 50379bc100SJani Nikula #define SDVO_OUTPUT_SCART1 (1 << 13) 51379bc100SJani Nikula #define SDVO_OUTPUT_LVDS1 (1 << 14) 52379bc100SJani Nikula #define SDVO_OUTPUT_LAST (14) 53379bc100SJani Nikula 54379bc100SJani Nikula struct intel_sdvo_caps { 55379bc100SJani Nikula u8 vendor_id; 56379bc100SJani Nikula u8 device_id; 57379bc100SJani Nikula u8 device_rev_id; 58379bc100SJani Nikula u8 sdvo_version_major; 59379bc100SJani Nikula u8 sdvo_version_minor; 60*469c0962SVille Syrjälä unsigned int sdvo_num_inputs:2; 61379bc100SJani Nikula unsigned int smooth_scaling:1; 62379bc100SJani Nikula unsigned int sharp_scaling:1; 63379bc100SJani Nikula unsigned int up_scaling:1; 64379bc100SJani Nikula unsigned int down_scaling:1; 65379bc100SJani Nikula unsigned int stall_support:1; 66379bc100SJani Nikula unsigned int pad:1; 67379bc100SJani Nikula u16 output_flags; 68379bc100SJani Nikula } __packed; 69379bc100SJani Nikula 70379bc100SJani Nikula /* Note: SDVO detailed timing flags match EDID misc flags. */ 71379bc100SJani Nikula #define DTD_FLAG_HSYNC_POSITIVE (1 << 1) 72379bc100SJani Nikula #define DTD_FLAG_VSYNC_POSITIVE (1 << 2) 73379bc100SJani Nikula #define DTD_FLAG_INTERLACE (1 << 7) 74379bc100SJani Nikula 75379bc100SJani Nikula /* This matches the EDID DTD structure, more or less */ 76379bc100SJani Nikula struct intel_sdvo_dtd { 77379bc100SJani Nikula struct { 78379bc100SJani Nikula u16 clock; /* pixel clock, in 10kHz units */ 79379bc100SJani Nikula u8 h_active; /* lower 8 bits (pixels) */ 80379bc100SJani Nikula u8 h_blank; /* lower 8 bits (pixels) */ 81379bc100SJani Nikula u8 h_high; /* upper 4 bits each h_active, h_blank */ 82379bc100SJani Nikula u8 v_active; /* lower 8 bits (lines) */ 83379bc100SJani Nikula u8 v_blank; /* lower 8 bits (lines) */ 84379bc100SJani Nikula u8 v_high; /* upper 4 bits each v_active, v_blank */ 85379bc100SJani Nikula } part1; 86379bc100SJani Nikula 87379bc100SJani Nikula struct { 88379bc100SJani Nikula u8 h_sync_off; /* lower 8 bits, from hblank start */ 89379bc100SJani Nikula u8 h_sync_width; /* lower 8 bits (pixels) */ 90379bc100SJani Nikula /* lower 4 bits each vsync offset, vsync width */ 91379bc100SJani Nikula u8 v_sync_off_width; 92379bc100SJani Nikula /* 93379bc100SJani Nikula * 2 high bits of hsync offset, 2 high bits of hsync width, 94379bc100SJani Nikula * bits 4-5 of vsync offset, and 2 high bits of vsync width. 95379bc100SJani Nikula */ 96379bc100SJani Nikula u8 sync_off_width_high; 97379bc100SJani Nikula u8 dtd_flags; 98379bc100SJani Nikula u8 sdvo_flags; 99379bc100SJani Nikula /* bits 6-7 of vsync offset at bits 6-7 */ 100379bc100SJani Nikula u8 v_sync_off_high; 101379bc100SJani Nikula u8 reserved; 102379bc100SJani Nikula } part2; 103379bc100SJani Nikula } __packed; 104379bc100SJani Nikula 105379bc100SJani Nikula struct intel_sdvo_pixel_clock_range { 106379bc100SJani Nikula u16 min; /* pixel clock, in 10kHz units */ 107379bc100SJani Nikula u16 max; /* pixel clock, in 10kHz units */ 108379bc100SJani Nikula } __packed; 109379bc100SJani Nikula 110379bc100SJani Nikula struct intel_sdvo_preferred_input_timing_args { 111379bc100SJani Nikula u16 clock; 112379bc100SJani Nikula u16 width; 113379bc100SJani Nikula u16 height; 114379bc100SJani Nikula u8 interlace:1; 115379bc100SJani Nikula u8 scaled:1; 116379bc100SJani Nikula u8 pad:6; 117379bc100SJani Nikula } __packed; 118379bc100SJani Nikula 119379bc100SJani Nikula /* I2C registers for SDVO */ 120379bc100SJani Nikula #define SDVO_I2C_ARG_0 0x07 121379bc100SJani Nikula #define SDVO_I2C_ARG_1 0x06 122379bc100SJani Nikula #define SDVO_I2C_ARG_2 0x05 123379bc100SJani Nikula #define SDVO_I2C_ARG_3 0x04 124379bc100SJani Nikula #define SDVO_I2C_ARG_4 0x03 125379bc100SJani Nikula #define SDVO_I2C_ARG_5 0x02 126379bc100SJani Nikula #define SDVO_I2C_ARG_6 0x01 127379bc100SJani Nikula #define SDVO_I2C_ARG_7 0x00 128379bc100SJani Nikula #define SDVO_I2C_OPCODE 0x08 129379bc100SJani Nikula #define SDVO_I2C_CMD_STATUS 0x09 130379bc100SJani Nikula #define SDVO_I2C_RETURN_0 0x0a 131379bc100SJani Nikula #define SDVO_I2C_RETURN_1 0x0b 132379bc100SJani Nikula #define SDVO_I2C_RETURN_2 0x0c 133379bc100SJani Nikula #define SDVO_I2C_RETURN_3 0x0d 134379bc100SJani Nikula #define SDVO_I2C_RETURN_4 0x0e 135379bc100SJani Nikula #define SDVO_I2C_RETURN_5 0x0f 136379bc100SJani Nikula #define SDVO_I2C_RETURN_6 0x10 137379bc100SJani Nikula #define SDVO_I2C_RETURN_7 0x11 138379bc100SJani Nikula #define SDVO_I2C_VENDOR_BEGIN 0x20 139379bc100SJani Nikula 140379bc100SJani Nikula /* Status results */ 141379bc100SJani Nikula #define SDVO_CMD_STATUS_POWER_ON 0x0 142379bc100SJani Nikula #define SDVO_CMD_STATUS_SUCCESS 0x1 143379bc100SJani Nikula #define SDVO_CMD_STATUS_NOTSUPP 0x2 144379bc100SJani Nikula #define SDVO_CMD_STATUS_INVALID_ARG 0x3 145379bc100SJani Nikula #define SDVO_CMD_STATUS_PENDING 0x4 146379bc100SJani Nikula #define SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED 0x5 147379bc100SJani Nikula #define SDVO_CMD_STATUS_SCALING_NOT_SUPP 0x6 148379bc100SJani Nikula 149379bc100SJani Nikula /* SDVO commands, argument/result registers */ 150379bc100SJani Nikula 151379bc100SJani Nikula #define SDVO_CMD_RESET 0x01 152379bc100SJani Nikula 153379bc100SJani Nikula /* Returns a struct intel_sdvo_caps */ 154379bc100SJani Nikula #define SDVO_CMD_GET_DEVICE_CAPS 0x02 155379bc100SJani Nikula 156379bc100SJani Nikula #define SDVO_CMD_GET_FIRMWARE_REV 0x86 157379bc100SJani Nikula # define SDVO_DEVICE_FIRMWARE_MINOR SDVO_I2C_RETURN_0 158379bc100SJani Nikula # define SDVO_DEVICE_FIRMWARE_MAJOR SDVO_I2C_RETURN_1 159379bc100SJani Nikula # define SDVO_DEVICE_FIRMWARE_PATCH SDVO_I2C_RETURN_2 160379bc100SJani Nikula 161379bc100SJani Nikula /* 162379bc100SJani Nikula * Reports which inputs are trained (managed to sync). 163379bc100SJani Nikula * 164379bc100SJani Nikula * Devices must have trained within 2 vsyncs of a mode change. 165379bc100SJani Nikula */ 166379bc100SJani Nikula #define SDVO_CMD_GET_TRAINED_INPUTS 0x03 167379bc100SJani Nikula struct intel_sdvo_get_trained_inputs_response { 168379bc100SJani Nikula unsigned int input0_trained:1; 169379bc100SJani Nikula unsigned int input1_trained:1; 170379bc100SJani Nikula unsigned int pad:6; 171379bc100SJani Nikula } __packed; 172379bc100SJani Nikula 173379bc100SJani Nikula /* Returns a struct intel_sdvo_output_flags of active outputs. */ 174379bc100SJani Nikula #define SDVO_CMD_GET_ACTIVE_OUTPUTS 0x04 175379bc100SJani Nikula 176379bc100SJani Nikula /* 177379bc100SJani Nikula * Sets the current set of active outputs. 178379bc100SJani Nikula * 179379bc100SJani Nikula * Takes a struct intel_sdvo_output_flags. Must be preceded by a SET_IN_OUT_MAP 180379bc100SJani Nikula * on multi-output devices. 181379bc100SJani Nikula */ 182379bc100SJani Nikula #define SDVO_CMD_SET_ACTIVE_OUTPUTS 0x05 183379bc100SJani Nikula 184379bc100SJani Nikula /* 185379bc100SJani Nikula * Returns the current mapping of SDVO inputs to outputs on the device. 186379bc100SJani Nikula * 187379bc100SJani Nikula * Returns two struct intel_sdvo_output_flags structures. 188379bc100SJani Nikula */ 189379bc100SJani Nikula #define SDVO_CMD_GET_IN_OUT_MAP 0x06 190379bc100SJani Nikula struct intel_sdvo_in_out_map { 191379bc100SJani Nikula u16 in0, in1; 192379bc100SJani Nikula }; 193379bc100SJani Nikula 194379bc100SJani Nikula /* 195379bc100SJani Nikula * Sets the current mapping of SDVO inputs to outputs on the device. 196379bc100SJani Nikula * 197379bc100SJani Nikula * Takes two struct i380_sdvo_output_flags structures. 198379bc100SJani Nikula */ 199379bc100SJani Nikula #define SDVO_CMD_SET_IN_OUT_MAP 0x07 200379bc100SJani Nikula 201379bc100SJani Nikula /* 202379bc100SJani Nikula * Returns a struct intel_sdvo_output_flags of attached displays. 203379bc100SJani Nikula */ 204379bc100SJani Nikula #define SDVO_CMD_GET_ATTACHED_DISPLAYS 0x0b 205379bc100SJani Nikula 206379bc100SJani Nikula /* 207379bc100SJani Nikula * Returns a struct intel_sdvo_ouptut_flags of displays supporting hot plugging. 208379bc100SJani Nikula */ 209379bc100SJani Nikula #define SDVO_CMD_GET_HOT_PLUG_SUPPORT 0x0c 210379bc100SJani Nikula 211379bc100SJani Nikula /* 212379bc100SJani Nikula * Takes a struct intel_sdvo_output_flags. 213379bc100SJani Nikula */ 214379bc100SJani Nikula #define SDVO_CMD_SET_ACTIVE_HOT_PLUG 0x0d 215379bc100SJani Nikula 216379bc100SJani Nikula /* 217379bc100SJani Nikula * Returns a struct intel_sdvo_output_flags of displays with hot plug 218379bc100SJani Nikula * interrupts enabled. 219379bc100SJani Nikula */ 220379bc100SJani Nikula #define SDVO_CMD_GET_ACTIVE_HOT_PLUG 0x0e 221379bc100SJani Nikula 222379bc100SJani Nikula #define SDVO_CMD_GET_INTERRUPT_EVENT_SOURCE 0x0f 223379bc100SJani Nikula struct intel_sdvo_get_interrupt_event_source_response { 224379bc100SJani Nikula u16 interrupt_status; 225379bc100SJani Nikula unsigned int ambient_light_interrupt:1; 226379bc100SJani Nikula unsigned int hdmi_audio_encrypt_change:1; 227379bc100SJani Nikula unsigned int pad:6; 228379bc100SJani Nikula } __packed; 229379bc100SJani Nikula 230379bc100SJani Nikula /* 231379bc100SJani Nikula * Selects which input is affected by future input commands. 232379bc100SJani Nikula * 233379bc100SJani Nikula * Commands affected include SET_INPUT_TIMINGS_PART[12], 234379bc100SJani Nikula * GET_INPUT_TIMINGS_PART[12], GET_PREFERRED_INPUT_TIMINGS_PART[12], 235379bc100SJani Nikula * GET_INPUT_PIXEL_CLOCK_RANGE, and CREATE_PREFERRED_INPUT_TIMINGS. 236379bc100SJani Nikula */ 237379bc100SJani Nikula #define SDVO_CMD_SET_TARGET_INPUT 0x10 238379bc100SJani Nikula struct intel_sdvo_set_target_input_args { 239379bc100SJani Nikula unsigned int target_1:1; 240379bc100SJani Nikula unsigned int pad:7; 241379bc100SJani Nikula } __packed; 242379bc100SJani Nikula 243379bc100SJani Nikula /* 244379bc100SJani Nikula * Takes a struct intel_sdvo_output_flags of which outputs are targeted by 245379bc100SJani Nikula * future output commands. 246379bc100SJani Nikula * 247379bc100SJani Nikula * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12], 248379bc100SJani Nikula * GET_OUTPUT_TIMINGS_PART[12], and GET_OUTPUT_PIXEL_CLOCK_RANGE. 249379bc100SJani Nikula */ 250379bc100SJani Nikula #define SDVO_CMD_SET_TARGET_OUTPUT 0x11 251379bc100SJani Nikula 252379bc100SJani Nikula #define SDVO_CMD_GET_INPUT_TIMINGS_PART1 0x12 253379bc100SJani Nikula #define SDVO_CMD_GET_INPUT_TIMINGS_PART2 0x13 254379bc100SJani Nikula #define SDVO_CMD_SET_INPUT_TIMINGS_PART1 0x14 255379bc100SJani Nikula #define SDVO_CMD_SET_INPUT_TIMINGS_PART2 0x15 256379bc100SJani Nikula #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART1 0x16 257379bc100SJani Nikula #define SDVO_CMD_SET_OUTPUT_TIMINGS_PART2 0x17 258379bc100SJani Nikula #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART1 0x18 259379bc100SJani Nikula #define SDVO_CMD_GET_OUTPUT_TIMINGS_PART2 0x19 260379bc100SJani Nikula /* Part 1 */ 261379bc100SJani Nikula # define SDVO_DTD_CLOCK_LOW SDVO_I2C_ARG_0 262379bc100SJani Nikula # define SDVO_DTD_CLOCK_HIGH SDVO_I2C_ARG_1 263379bc100SJani Nikula # define SDVO_DTD_H_ACTIVE SDVO_I2C_ARG_2 264379bc100SJani Nikula # define SDVO_DTD_H_BLANK SDVO_I2C_ARG_3 265379bc100SJani Nikula # define SDVO_DTD_H_HIGH SDVO_I2C_ARG_4 266379bc100SJani Nikula # define SDVO_DTD_V_ACTIVE SDVO_I2C_ARG_5 267379bc100SJani Nikula # define SDVO_DTD_V_BLANK SDVO_I2C_ARG_6 268379bc100SJani Nikula # define SDVO_DTD_V_HIGH SDVO_I2C_ARG_7 269379bc100SJani Nikula /* Part 2 */ 270379bc100SJani Nikula # define SDVO_DTD_HSYNC_OFF SDVO_I2C_ARG_0 271379bc100SJani Nikula # define SDVO_DTD_HSYNC_WIDTH SDVO_I2C_ARG_1 272379bc100SJani Nikula # define SDVO_DTD_VSYNC_OFF_WIDTH SDVO_I2C_ARG_2 273379bc100SJani Nikula # define SDVO_DTD_SYNC_OFF_WIDTH_HIGH SDVO_I2C_ARG_3 274379bc100SJani Nikula # define SDVO_DTD_DTD_FLAGS SDVO_I2C_ARG_4 275379bc100SJani Nikula # define SDVO_DTD_DTD_FLAG_INTERLACED (1 << 7) 276379bc100SJani Nikula # define SDVO_DTD_DTD_FLAG_STEREO_MASK (3 << 5) 277379bc100SJani Nikula # define SDVO_DTD_DTD_FLAG_INPUT_MASK (3 << 3) 278379bc100SJani Nikula # define SDVO_DTD_DTD_FLAG_SYNC_MASK (3 << 1) 279379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAS SDVO_I2C_ARG_5 280379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_STALL (1 << 7) 281379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_CENTERED (0 << 6) 282379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_UPPER_LEFT (1 << 6) 283379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_SCALING_MASK (3 << 4) 284379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_SCALING_NONE (0 << 4) 285379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_SCALING_SHARP (1 << 4) 286379bc100SJani Nikula # define SDVO_DTD_SDVO_FLAG_SCALING_SMOOTH (2 << 4) 287379bc100SJani Nikula # define SDVO_DTD_VSYNC_OFF_HIGH SDVO_I2C_ARG_6 288379bc100SJani Nikula 289379bc100SJani Nikula /* 290379bc100SJani Nikula * Generates a DTD based on the given width, height, and flags. 291379bc100SJani Nikula * 292379bc100SJani Nikula * This will be supported by any device supporting scaling or interlaced 293379bc100SJani Nikula * modes. 294379bc100SJani Nikula */ 295379bc100SJani Nikula #define SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING 0x1a 296379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_LOW SDVO_I2C_ARG_0 297379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_CLOCK_HIGH SDVO_I2C_ARG_1 298379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_LOW SDVO_I2C_ARG_2 299379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_WIDTH_HIGH SDVO_I2C_ARG_3 300379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_LOW SDVO_I2C_ARG_4 301379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_HIGH SDVO_I2C_ARG_5 302379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_FLAGS SDVO_I2C_ARG_6 303379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_INTERLACED (1 << 0) 304379bc100SJani Nikula # define SDVO_PREFERRED_INPUT_TIMING_FLAGS_SCALED (1 << 1) 305379bc100SJani Nikula 306379bc100SJani Nikula #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1 0x1b 307379bc100SJani Nikula #define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2 0x1c 308379bc100SJani Nikula 309379bc100SJani Nikula /* Returns a struct intel_sdvo_pixel_clock_range */ 310379bc100SJani Nikula #define SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE 0x1d 311379bc100SJani Nikula /* Returns a struct intel_sdvo_pixel_clock_range */ 312379bc100SJani Nikula #define SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE 0x1e 313379bc100SJani Nikula 314379bc100SJani Nikula /* Returns a byte bitfield containing SDVO_CLOCK_RATE_MULT_* flags */ 315379bc100SJani Nikula #define SDVO_CMD_GET_SUPPORTED_CLOCK_RATE_MULTS 0x1f 316379bc100SJani Nikula 317379bc100SJani Nikula /* Returns a byte containing a SDVO_CLOCK_RATE_MULT_* flag */ 318379bc100SJani Nikula #define SDVO_CMD_GET_CLOCK_RATE_MULT 0x20 319379bc100SJani Nikula /* Takes a byte containing a SDVO_CLOCK_RATE_MULT_* flag */ 320379bc100SJani Nikula #define SDVO_CMD_SET_CLOCK_RATE_MULT 0x21 321379bc100SJani Nikula # define SDVO_CLOCK_RATE_MULT_1X (1 << 0) 322379bc100SJani Nikula # define SDVO_CLOCK_RATE_MULT_2X (1 << 1) 323379bc100SJani Nikula # define SDVO_CLOCK_RATE_MULT_4X (1 << 3) 324379bc100SJani Nikula 325379bc100SJani Nikula #define SDVO_CMD_GET_SUPPORTED_TV_FORMATS 0x27 326379bc100SJani Nikula /* 6 bytes of bit flags for TV formats shared by all TV format functions */ 327379bc100SJani Nikula struct intel_sdvo_tv_format { 328379bc100SJani Nikula unsigned int ntsc_m:1; 329379bc100SJani Nikula unsigned int ntsc_j:1; 330379bc100SJani Nikula unsigned int ntsc_443:1; 331379bc100SJani Nikula unsigned int pal_b:1; 332379bc100SJani Nikula unsigned int pal_d:1; 333379bc100SJani Nikula unsigned int pal_g:1; 334379bc100SJani Nikula unsigned int pal_h:1; 335379bc100SJani Nikula unsigned int pal_i:1; 336379bc100SJani Nikula 337379bc100SJani Nikula unsigned int pal_m:1; 338379bc100SJani Nikula unsigned int pal_n:1; 339379bc100SJani Nikula unsigned int pal_nc:1; 340379bc100SJani Nikula unsigned int pal_60:1; 341379bc100SJani Nikula unsigned int secam_b:1; 342379bc100SJani Nikula unsigned int secam_d:1; 343379bc100SJani Nikula unsigned int secam_g:1; 344379bc100SJani Nikula unsigned int secam_k:1; 345379bc100SJani Nikula 346379bc100SJani Nikula unsigned int secam_k1:1; 347379bc100SJani Nikula unsigned int secam_l:1; 348379bc100SJani Nikula unsigned int secam_60:1; 349379bc100SJani Nikula unsigned int hdtv_std_smpte_240m_1080i_59:1; 350379bc100SJani Nikula unsigned int hdtv_std_smpte_240m_1080i_60:1; 351379bc100SJani Nikula unsigned int hdtv_std_smpte_260m_1080i_59:1; 352379bc100SJani Nikula unsigned int hdtv_std_smpte_260m_1080i_60:1; 353379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_50:1; 354379bc100SJani Nikula 355379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_59:1; 356379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_60:1; 357379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_23:1; 358379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_24:1; 359379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_25:1; 360379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_29:1; 361379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_30:1; 362379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_50:1; 363379bc100SJani Nikula 364379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_59:1; 365379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_60:1; 366379bc100SJani Nikula unsigned int hdtv_std_smpte_295m_1080i_50:1; 367379bc100SJani Nikula unsigned int hdtv_std_smpte_295m_1080p_50:1; 368379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_59:1; 369379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_60:1; 370379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_50:1; 371379bc100SJani Nikula unsigned int hdtv_std_smpte_293m_480p_59:1; 372379bc100SJani Nikula 373379bc100SJani Nikula unsigned int hdtv_std_smpte_170m_480i_59:1; 374379bc100SJani Nikula unsigned int hdtv_std_iturbt601_576i_50:1; 375379bc100SJani Nikula unsigned int hdtv_std_iturbt601_576p_50:1; 376379bc100SJani Nikula unsigned int hdtv_std_eia_7702a_480i_60:1; 377379bc100SJani Nikula unsigned int hdtv_std_eia_7702a_480p_60:1; 378379bc100SJani Nikula unsigned int pad:3; 379379bc100SJani Nikula } __packed; 380379bc100SJani Nikula 381379bc100SJani Nikula #define SDVO_CMD_GET_TV_FORMAT 0x28 382379bc100SJani Nikula 383379bc100SJani Nikula #define SDVO_CMD_SET_TV_FORMAT 0x29 384379bc100SJani Nikula 385379bc100SJani Nikula /* Returns the resolutiosn that can be used with the given TV format */ 386379bc100SJani Nikula #define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT 0x83 387379bc100SJani Nikula struct intel_sdvo_sdtv_resolution_request { 388379bc100SJani Nikula unsigned int ntsc_m:1; 389379bc100SJani Nikula unsigned int ntsc_j:1; 390379bc100SJani Nikula unsigned int ntsc_443:1; 391379bc100SJani Nikula unsigned int pal_b:1; 392379bc100SJani Nikula unsigned int pal_d:1; 393379bc100SJani Nikula unsigned int pal_g:1; 394379bc100SJani Nikula unsigned int pal_h:1; 395379bc100SJani Nikula unsigned int pal_i:1; 396379bc100SJani Nikula 397379bc100SJani Nikula unsigned int pal_m:1; 398379bc100SJani Nikula unsigned int pal_n:1; 399379bc100SJani Nikula unsigned int pal_nc:1; 400379bc100SJani Nikula unsigned int pal_60:1; 401379bc100SJani Nikula unsigned int secam_b:1; 402379bc100SJani Nikula unsigned int secam_d:1; 403379bc100SJani Nikula unsigned int secam_g:1; 404379bc100SJani Nikula unsigned int secam_k:1; 405379bc100SJani Nikula 406379bc100SJani Nikula unsigned int secam_k1:1; 407379bc100SJani Nikula unsigned int secam_l:1; 408379bc100SJani Nikula unsigned int secam_60:1; 409379bc100SJani Nikula unsigned int pad:5; 410379bc100SJani Nikula } __packed; 411379bc100SJani Nikula 412379bc100SJani Nikula struct intel_sdvo_sdtv_resolution_reply { 413379bc100SJani Nikula unsigned int res_320x200:1; 414379bc100SJani Nikula unsigned int res_320x240:1; 415379bc100SJani Nikula unsigned int res_400x300:1; 416379bc100SJani Nikula unsigned int res_640x350:1; 417379bc100SJani Nikula unsigned int res_640x400:1; 418379bc100SJani Nikula unsigned int res_640x480:1; 419379bc100SJani Nikula unsigned int res_704x480:1; 420379bc100SJani Nikula unsigned int res_704x576:1; 421379bc100SJani Nikula 422379bc100SJani Nikula unsigned int res_720x350:1; 423379bc100SJani Nikula unsigned int res_720x400:1; 424379bc100SJani Nikula unsigned int res_720x480:1; 425379bc100SJani Nikula unsigned int res_720x540:1; 426379bc100SJani Nikula unsigned int res_720x576:1; 427379bc100SJani Nikula unsigned int res_768x576:1; 428379bc100SJani Nikula unsigned int res_800x600:1; 429379bc100SJani Nikula unsigned int res_832x624:1; 430379bc100SJani Nikula 431379bc100SJani Nikula unsigned int res_920x766:1; 432379bc100SJani Nikula unsigned int res_1024x768:1; 433379bc100SJani Nikula unsigned int res_1280x1024:1; 434379bc100SJani Nikula unsigned int pad:5; 435379bc100SJani Nikula } __packed; 436379bc100SJani Nikula 437379bc100SJani Nikula /* Get supported resolution with squire pixel aspect ratio that can be 438379bc100SJani Nikula scaled for the requested HDTV format */ 439379bc100SJani Nikula #define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT 0x85 440379bc100SJani Nikula 441379bc100SJani Nikula struct intel_sdvo_hdtv_resolution_request { 442379bc100SJani Nikula unsigned int hdtv_std_smpte_240m_1080i_59:1; 443379bc100SJani Nikula unsigned int hdtv_std_smpte_240m_1080i_60:1; 444379bc100SJani Nikula unsigned int hdtv_std_smpte_260m_1080i_59:1; 445379bc100SJani Nikula unsigned int hdtv_std_smpte_260m_1080i_60:1; 446379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_50:1; 447379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_59:1; 448379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080i_60:1; 449379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_23:1; 450379bc100SJani Nikula 451379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_24:1; 452379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_25:1; 453379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_29:1; 454379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_30:1; 455379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_50:1; 456379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_59:1; 457379bc100SJani Nikula unsigned int hdtv_std_smpte_274m_1080p_60:1; 458379bc100SJani Nikula unsigned int hdtv_std_smpte_295m_1080i_50:1; 459379bc100SJani Nikula 460379bc100SJani Nikula unsigned int hdtv_std_smpte_295m_1080p_50:1; 461379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_59:1; 462379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_60:1; 463379bc100SJani Nikula unsigned int hdtv_std_smpte_296m_720p_50:1; 464379bc100SJani Nikula unsigned int hdtv_std_smpte_293m_480p_59:1; 465379bc100SJani Nikula unsigned int hdtv_std_smpte_170m_480i_59:1; 466379bc100SJani Nikula unsigned int hdtv_std_iturbt601_576i_50:1; 467379bc100SJani Nikula unsigned int hdtv_std_iturbt601_576p_50:1; 468379bc100SJani Nikula 469379bc100SJani Nikula unsigned int hdtv_std_eia_7702a_480i_60:1; 470379bc100SJani Nikula unsigned int hdtv_std_eia_7702a_480p_60:1; 471379bc100SJani Nikula unsigned int pad:6; 472379bc100SJani Nikula } __packed; 473379bc100SJani Nikula 474379bc100SJani Nikula struct intel_sdvo_hdtv_resolution_reply { 475379bc100SJani Nikula unsigned int res_640x480:1; 476379bc100SJani Nikula unsigned int res_800x600:1; 477379bc100SJani Nikula unsigned int res_1024x768:1; 478379bc100SJani Nikula unsigned int res_1280x960:1; 479379bc100SJani Nikula unsigned int res_1400x1050:1; 480379bc100SJani Nikula unsigned int res_1600x1200:1; 481379bc100SJani Nikula unsigned int res_1920x1440:1; 482379bc100SJani Nikula unsigned int res_2048x1536:1; 483379bc100SJani Nikula 484379bc100SJani Nikula unsigned int res_2560x1920:1; 485379bc100SJani Nikula unsigned int res_3200x2400:1; 486379bc100SJani Nikula unsigned int res_3840x2880:1; 487379bc100SJani Nikula unsigned int pad1:5; 488379bc100SJani Nikula 489379bc100SJani Nikula unsigned int res_848x480:1; 490379bc100SJani Nikula unsigned int res_1064x600:1; 491379bc100SJani Nikula unsigned int res_1280x720:1; 492379bc100SJani Nikula unsigned int res_1360x768:1; 493379bc100SJani Nikula unsigned int res_1704x960:1; 494379bc100SJani Nikula unsigned int res_1864x1050:1; 495379bc100SJani Nikula unsigned int res_1920x1080:1; 496379bc100SJani Nikula unsigned int res_2128x1200:1; 497379bc100SJani Nikula 498379bc100SJani Nikula unsigned int res_2560x1400:1; 499379bc100SJani Nikula unsigned int res_2728x1536:1; 500379bc100SJani Nikula unsigned int res_3408x1920:1; 501379bc100SJani Nikula unsigned int res_4264x2400:1; 502379bc100SJani Nikula unsigned int res_5120x2880:1; 503379bc100SJani Nikula unsigned int pad2:3; 504379bc100SJani Nikula 505379bc100SJani Nikula unsigned int res_768x480:1; 506379bc100SJani Nikula unsigned int res_960x600:1; 507379bc100SJani Nikula unsigned int res_1152x720:1; 508379bc100SJani Nikula unsigned int res_1124x768:1; 509379bc100SJani Nikula unsigned int res_1536x960:1; 510379bc100SJani Nikula unsigned int res_1680x1050:1; 511379bc100SJani Nikula unsigned int res_1728x1080:1; 512379bc100SJani Nikula unsigned int res_1920x1200:1; 513379bc100SJani Nikula 514379bc100SJani Nikula unsigned int res_2304x1440:1; 515379bc100SJani Nikula unsigned int res_2456x1536:1; 516379bc100SJani Nikula unsigned int res_3072x1920:1; 517379bc100SJani Nikula unsigned int res_3840x2400:1; 518379bc100SJani Nikula unsigned int res_4608x2880:1; 519379bc100SJani Nikula unsigned int pad3:3; 520379bc100SJani Nikula 521379bc100SJani Nikula unsigned int res_1280x1024:1; 522379bc100SJani Nikula unsigned int pad4:7; 523379bc100SJani Nikula 524379bc100SJani Nikula unsigned int res_1280x768:1; 525379bc100SJani Nikula unsigned int pad5:7; 526379bc100SJani Nikula } __packed; 527379bc100SJani Nikula 528379bc100SJani Nikula /* Get supported power state returns info for encoder and monitor, rely on 529379bc100SJani Nikula last SetTargetInput and SetTargetOutput calls */ 530379bc100SJani Nikula #define SDVO_CMD_GET_SUPPORTED_POWER_STATES 0x2a 531379bc100SJani Nikula /* Get power state returns info for encoder and monitor, rely on last 532379bc100SJani Nikula SetTargetInput and SetTargetOutput calls */ 533379bc100SJani Nikula #define SDVO_CMD_GET_POWER_STATE 0x2b 534379bc100SJani Nikula #define SDVO_CMD_GET_ENCODER_POWER_STATE 0x2b 535379bc100SJani Nikula #define SDVO_CMD_SET_ENCODER_POWER_STATE 0x2c 536379bc100SJani Nikula # define SDVO_ENCODER_STATE_ON (1 << 0) 537379bc100SJani Nikula # define SDVO_ENCODER_STATE_STANDBY (1 << 1) 538379bc100SJani Nikula # define SDVO_ENCODER_STATE_SUSPEND (1 << 2) 539379bc100SJani Nikula # define SDVO_ENCODER_STATE_OFF (1 << 3) 540379bc100SJani Nikula # define SDVO_MONITOR_STATE_ON (1 << 4) 541379bc100SJani Nikula # define SDVO_MONITOR_STATE_STANDBY (1 << 5) 542379bc100SJani Nikula # define SDVO_MONITOR_STATE_SUSPEND (1 << 6) 543379bc100SJani Nikula # define SDVO_MONITOR_STATE_OFF (1 << 7) 544379bc100SJani Nikula 545379bc100SJani Nikula #define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING 0x2d 546379bc100SJani Nikula #define SDVO_CMD_GET_PANEL_POWER_SEQUENCING 0x2e 547379bc100SJani Nikula #define SDVO_CMD_SET_PANEL_POWER_SEQUENCING 0x2f 548379bc100SJani Nikula /* 549379bc100SJani Nikula * The panel power sequencing parameters are in units of milliseconds. 550379bc100SJani Nikula * The high fields are bits 8:9 of the 10-bit values. 551379bc100SJani Nikula */ 552379bc100SJani Nikula struct sdvo_panel_power_sequencing { 553379bc100SJani Nikula u8 t0; 554379bc100SJani Nikula u8 t1; 555379bc100SJani Nikula u8 t2; 556379bc100SJani Nikula u8 t3; 557379bc100SJani Nikula u8 t4; 558379bc100SJani Nikula 559379bc100SJani Nikula unsigned int t0_high:2; 560379bc100SJani Nikula unsigned int t1_high:2; 561379bc100SJani Nikula unsigned int t2_high:2; 562379bc100SJani Nikula unsigned int t3_high:2; 563379bc100SJani Nikula 564379bc100SJani Nikula unsigned int t4_high:2; 565379bc100SJani Nikula unsigned int pad:6; 566379bc100SJani Nikula } __packed; 567379bc100SJani Nikula 568379bc100SJani Nikula #define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL 0x30 569379bc100SJani Nikula struct sdvo_max_backlight_reply { 570379bc100SJani Nikula u8 max_value; 571379bc100SJani Nikula u8 default_value; 572379bc100SJani Nikula } __packed; 573379bc100SJani Nikula 574379bc100SJani Nikula #define SDVO_CMD_GET_BACKLIGHT_LEVEL 0x31 575379bc100SJani Nikula #define SDVO_CMD_SET_BACKLIGHT_LEVEL 0x32 576379bc100SJani Nikula 577379bc100SJani Nikula #define SDVO_CMD_GET_AMBIENT_LIGHT 0x33 578379bc100SJani Nikula struct sdvo_get_ambient_light_reply { 579379bc100SJani Nikula u16 trip_low; 580379bc100SJani Nikula u16 trip_high; 581379bc100SJani Nikula u16 value; 582379bc100SJani Nikula } __packed; 583379bc100SJani Nikula #define SDVO_CMD_SET_AMBIENT_LIGHT 0x34 584379bc100SJani Nikula struct sdvo_set_ambient_light_reply { 585379bc100SJani Nikula u16 trip_low; 586379bc100SJani Nikula u16 trip_high; 587379bc100SJani Nikula unsigned int enable:1; 588379bc100SJani Nikula unsigned int pad:7; 589379bc100SJani Nikula } __packed; 590379bc100SJani Nikula 591379bc100SJani Nikula /* Set display power state */ 592379bc100SJani Nikula #define SDVO_CMD_SET_DISPLAY_POWER_STATE 0x7d 593379bc100SJani Nikula # define SDVO_DISPLAY_STATE_ON (1 << 0) 594379bc100SJani Nikula # define SDVO_DISPLAY_STATE_STANDBY (1 << 1) 595379bc100SJani Nikula # define SDVO_DISPLAY_STATE_SUSPEND (1 << 2) 596379bc100SJani Nikula # define SDVO_DISPLAY_STATE_OFF (1 << 3) 597379bc100SJani Nikula 598379bc100SJani Nikula #define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS 0x84 599379bc100SJani Nikula struct intel_sdvo_enhancements_reply { 600379bc100SJani Nikula unsigned int flicker_filter:1; 601379bc100SJani Nikula unsigned int flicker_filter_adaptive:1; 602379bc100SJani Nikula unsigned int flicker_filter_2d:1; 603379bc100SJani Nikula unsigned int saturation:1; 604379bc100SJani Nikula unsigned int hue:1; 605379bc100SJani Nikula unsigned int brightness:1; 606379bc100SJani Nikula unsigned int contrast:1; 607379bc100SJani Nikula unsigned int overscan_h:1; 608379bc100SJani Nikula 609379bc100SJani Nikula unsigned int overscan_v:1; 610379bc100SJani Nikula unsigned int hpos:1; 611379bc100SJani Nikula unsigned int vpos:1; 612379bc100SJani Nikula unsigned int sharpness:1; 613379bc100SJani Nikula unsigned int dot_crawl:1; 614379bc100SJani Nikula unsigned int dither:1; 615379bc100SJani Nikula unsigned int tv_chroma_filter:1; 616379bc100SJani Nikula unsigned int tv_luma_filter:1; 617379bc100SJani Nikula } __packed; 618379bc100SJani Nikula 619379bc100SJani Nikula /* Picture enhancement limits below are dependent on the current TV format, 620379bc100SJani Nikula * and thus need to be queried and set after it. 621379bc100SJani Nikula */ 622379bc100SJani Nikula #define SDVO_CMD_GET_MAX_FLICKER_FILTER 0x4d 623379bc100SJani Nikula #define SDVO_CMD_GET_MAX_FLICKER_FILTER_ADAPTIVE 0x7b 624379bc100SJani Nikula #define SDVO_CMD_GET_MAX_FLICKER_FILTER_2D 0x52 625379bc100SJani Nikula #define SDVO_CMD_GET_MAX_SATURATION 0x55 626379bc100SJani Nikula #define SDVO_CMD_GET_MAX_HUE 0x58 627379bc100SJani Nikula #define SDVO_CMD_GET_MAX_BRIGHTNESS 0x5b 628379bc100SJani Nikula #define SDVO_CMD_GET_MAX_CONTRAST 0x5e 629379bc100SJani Nikula #define SDVO_CMD_GET_MAX_OVERSCAN_H 0x61 630379bc100SJani Nikula #define SDVO_CMD_GET_MAX_OVERSCAN_V 0x64 631379bc100SJani Nikula #define SDVO_CMD_GET_MAX_HPOS 0x67 632379bc100SJani Nikula #define SDVO_CMD_GET_MAX_VPOS 0x6a 633379bc100SJani Nikula #define SDVO_CMD_GET_MAX_SHARPNESS 0x6d 634379bc100SJani Nikula #define SDVO_CMD_GET_MAX_TV_CHROMA_FILTER 0x74 635379bc100SJani Nikula #define SDVO_CMD_GET_MAX_TV_LUMA_FILTER 0x77 636379bc100SJani Nikula struct intel_sdvo_enhancement_limits_reply { 637379bc100SJani Nikula u16 max_value; 638379bc100SJani Nikula u16 default_value; 639379bc100SJani Nikula } __packed; 640379bc100SJani Nikula 641379bc100SJani Nikula #define SDVO_CMD_GET_LVDS_PANEL_INFORMATION 0x7f 642379bc100SJani Nikula #define SDVO_CMD_SET_LVDS_PANEL_INFORMATION 0x80 643379bc100SJani Nikula # define SDVO_LVDS_COLOR_DEPTH_18 (0 << 0) 644379bc100SJani Nikula # define SDVO_LVDS_COLOR_DEPTH_24 (1 << 0) 645379bc100SJani Nikula # define SDVO_LVDS_CONNECTOR_SPWG (0 << 2) 646379bc100SJani Nikula # define SDVO_LVDS_CONNECTOR_OPENLDI (1 << 2) 647379bc100SJani Nikula # define SDVO_LVDS_SINGLE_CHANNEL (0 << 4) 648379bc100SJani Nikula # define SDVO_LVDS_DUAL_CHANNEL (1 << 4) 649379bc100SJani Nikula 650379bc100SJani Nikula #define SDVO_CMD_GET_FLICKER_FILTER 0x4e 651379bc100SJani Nikula #define SDVO_CMD_SET_FLICKER_FILTER 0x4f 652379bc100SJani Nikula #define SDVO_CMD_GET_FLICKER_FILTER_ADAPTIVE 0x50 653379bc100SJani Nikula #define SDVO_CMD_SET_FLICKER_FILTER_ADAPTIVE 0x51 654379bc100SJani Nikula #define SDVO_CMD_GET_FLICKER_FILTER_2D 0x53 655379bc100SJani Nikula #define SDVO_CMD_SET_FLICKER_FILTER_2D 0x54 656379bc100SJani Nikula #define SDVO_CMD_GET_SATURATION 0x56 657379bc100SJani Nikula #define SDVO_CMD_SET_SATURATION 0x57 658379bc100SJani Nikula #define SDVO_CMD_GET_HUE 0x59 659379bc100SJani Nikula #define SDVO_CMD_SET_HUE 0x5a 660379bc100SJani Nikula #define SDVO_CMD_GET_BRIGHTNESS 0x5c 661379bc100SJani Nikula #define SDVO_CMD_SET_BRIGHTNESS 0x5d 662379bc100SJani Nikula #define SDVO_CMD_GET_CONTRAST 0x5f 663379bc100SJani Nikula #define SDVO_CMD_SET_CONTRAST 0x60 664379bc100SJani Nikula #define SDVO_CMD_GET_OVERSCAN_H 0x62 665379bc100SJani Nikula #define SDVO_CMD_SET_OVERSCAN_H 0x63 666379bc100SJani Nikula #define SDVO_CMD_GET_OVERSCAN_V 0x65 667379bc100SJani Nikula #define SDVO_CMD_SET_OVERSCAN_V 0x66 668379bc100SJani Nikula #define SDVO_CMD_GET_HPOS 0x68 669379bc100SJani Nikula #define SDVO_CMD_SET_HPOS 0x69 670379bc100SJani Nikula #define SDVO_CMD_GET_VPOS 0x6b 671379bc100SJani Nikula #define SDVO_CMD_SET_VPOS 0x6c 672379bc100SJani Nikula #define SDVO_CMD_GET_SHARPNESS 0x6e 673379bc100SJani Nikula #define SDVO_CMD_SET_SHARPNESS 0x6f 674379bc100SJani Nikula #define SDVO_CMD_GET_TV_CHROMA_FILTER 0x75 675379bc100SJani Nikula #define SDVO_CMD_SET_TV_CHROMA_FILTER 0x76 676379bc100SJani Nikula #define SDVO_CMD_GET_TV_LUMA_FILTER 0x78 677379bc100SJani Nikula #define SDVO_CMD_SET_TV_LUMA_FILTER 0x79 678379bc100SJani Nikula struct intel_sdvo_enhancements_arg { 679379bc100SJani Nikula u16 value; 680379bc100SJani Nikula } __packed; 681379bc100SJani Nikula 682379bc100SJani Nikula #define SDVO_CMD_GET_DOT_CRAWL 0x70 683379bc100SJani Nikula #define SDVO_CMD_SET_DOT_CRAWL 0x71 684379bc100SJani Nikula # define SDVO_DOT_CRAWL_ON (1 << 0) 685379bc100SJani Nikula # define SDVO_DOT_CRAWL_DEFAULT_ON (1 << 1) 686379bc100SJani Nikula 687379bc100SJani Nikula #define SDVO_CMD_GET_DITHER 0x72 688379bc100SJani Nikula #define SDVO_CMD_SET_DITHER 0x73 689379bc100SJani Nikula # define SDVO_DITHER_ON (1 << 0) 690379bc100SJani Nikula # define SDVO_DITHER_DEFAULT_ON (1 << 1) 691379bc100SJani Nikula 692379bc100SJani Nikula #define SDVO_CMD_SET_CONTROL_BUS_SWITCH 0x7a 693379bc100SJani Nikula # define SDVO_CONTROL_BUS_PROM (1 << 0) 694379bc100SJani Nikula # define SDVO_CONTROL_BUS_DDC1 (1 << 1) 695379bc100SJani Nikula # define SDVO_CONTROL_BUS_DDC2 (1 << 2) 696379bc100SJani Nikula # define SDVO_CONTROL_BUS_DDC3 (1 << 3) 697379bc100SJani Nikula 698379bc100SJani Nikula /* HDMI op codes */ 699379bc100SJani Nikula #define SDVO_CMD_GET_SUPP_ENCODE 0x9d 700379bc100SJani Nikula #define SDVO_CMD_GET_ENCODE 0x9e 701379bc100SJani Nikula #define SDVO_CMD_SET_ENCODE 0x9f 702379bc100SJani Nikula #define SDVO_ENCODE_DVI 0x0 703379bc100SJani Nikula #define SDVO_ENCODE_HDMI 0x1 704379bc100SJani Nikula #define SDVO_CMD_SET_PIXEL_REPLI 0x8b 705379bc100SJani Nikula #define SDVO_CMD_GET_PIXEL_REPLI 0x8c 706379bc100SJani Nikula #define SDVO_CMD_GET_COLORIMETRY_CAP 0x8d 707379bc100SJani Nikula #define SDVO_CMD_SET_COLORIMETRY 0x8e 70880f5ad62SVille Syrjälä #define SDVO_COLORIMETRY_RGB256 (1 << 0) 70980f5ad62SVille Syrjälä #define SDVO_COLORIMETRY_RGB220 (1 << 1) 71080f5ad62SVille Syrjälä #define SDVO_COLORIMETRY_YCrCb422 (1 << 2) 71180f5ad62SVille Syrjälä #define SDVO_COLORIMETRY_YCrCb444 (1 << 3) 712379bc100SJani Nikula #define SDVO_CMD_GET_COLORIMETRY 0x8f 713379bc100SJani Nikula #define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER 0x90 714379bc100SJani Nikula #define SDVO_CMD_SET_AUDIO_STAT 0x91 715379bc100SJani Nikula #define SDVO_CMD_GET_AUDIO_STAT 0x92 716379bc100SJani Nikula #define SDVO_AUDIO_ELD_VALID (1 << 0) 717379bc100SJani Nikula #define SDVO_AUDIO_PRESENCE_DETECT (1 << 1) 718379bc100SJani Nikula #define SDVO_AUDIO_CP_READY (1 << 2) 719379bc100SJani Nikula #define SDVO_CMD_SET_HBUF_INDEX 0x93 720379bc100SJani Nikula #define SDVO_HBUF_INDEX_ELD 0 721379bc100SJani Nikula #define SDVO_HBUF_INDEX_AVI_IF 1 722379bc100SJani Nikula #define SDVO_CMD_GET_HBUF_INDEX 0x94 723379bc100SJani Nikula #define SDVO_CMD_GET_HBUF_INFO 0x95 724379bc100SJani Nikula #define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96 725379bc100SJani Nikula #define SDVO_CMD_GET_HBUF_AV_SPLIT 0x97 726379bc100SJani Nikula #define SDVO_CMD_SET_HBUF_DATA 0x98 727379bc100SJani Nikula #define SDVO_CMD_GET_HBUF_DATA 0x99 728379bc100SJani Nikula #define SDVO_CMD_SET_HBUF_TXRATE 0x9a 729379bc100SJani Nikula #define SDVO_CMD_GET_HBUF_TXRATE 0x9b 730379bc100SJani Nikula #define SDVO_HBUF_TX_DISABLED (0 << 6) 731379bc100SJani Nikula #define SDVO_HBUF_TX_ONCE (2 << 6) 732379bc100SJani Nikula #define SDVO_HBUF_TX_VSYNC (3 << 6) 733379bc100SJani Nikula #define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c 734379bc100SJani Nikula #define SDVO_NEED_TO_STALL (1 << 7) 735379bc100SJani Nikula 736379bc100SJani Nikula struct intel_sdvo_encode { 737379bc100SJani Nikula u8 dvi_rev; 738379bc100SJani Nikula u8 hdmi_rev; 739379bc100SJani Nikula } __packed; 740379bc100SJani Nikula 741379bc100SJani Nikula #endif /* __INTEL_SDVO_REGS_H__ */ 742