Path: blob/master/drivers/gpu/drm/i915/intel_sdvo_regs.h
15113 views
/*1* Copyright � 2006-2007 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER20* DEALINGS IN THE SOFTWARE.21*22* Authors:23* Eric Anholt <[email protected]>24*/2526/**27* @file SDVO command definitions and structures.28*/2930#define SDVO_OUTPUT_FIRST (0)31#define SDVO_OUTPUT_TMDS0 (1 << 0)32#define SDVO_OUTPUT_RGB0 (1 << 1)33#define SDVO_OUTPUT_CVBS0 (1 << 2)34#define SDVO_OUTPUT_SVID0 (1 << 3)35#define SDVO_OUTPUT_YPRPB0 (1 << 4)36#define SDVO_OUTPUT_SCART0 (1 << 5)37#define SDVO_OUTPUT_LVDS0 (1 << 6)38#define SDVO_OUTPUT_TMDS1 (1 << 8)39#define SDVO_OUTPUT_RGB1 (1 << 9)40#define SDVO_OUTPUT_CVBS1 (1 << 10)41#define SDVO_OUTPUT_SVID1 (1 << 11)42#define SDVO_OUTPUT_YPRPB1 (1 << 12)43#define SDVO_OUTPUT_SCART1 (1 << 13)44#define SDVO_OUTPUT_LVDS1 (1 << 14)45#define SDVO_OUTPUT_LAST (14)4647struct intel_sdvo_caps {48u8 vendor_id;49u8 device_id;50u8 device_rev_id;51u8 sdvo_version_major;52u8 sdvo_version_minor;53unsigned int sdvo_inputs_mask:2;54unsigned int smooth_scaling:1;55unsigned int sharp_scaling:1;56unsigned int up_scaling:1;57unsigned int down_scaling:1;58unsigned int stall_support:1;59unsigned int pad:1;60u16 output_flags;61} __attribute__((packed));6263/** This matches the EDID DTD structure, more or less */64struct intel_sdvo_dtd {65struct {66u16 clock; /**< pixel clock, in 10kHz units */67u8 h_active; /**< lower 8 bits (pixels) */68u8 h_blank; /**< lower 8 bits (pixels) */69u8 h_high; /**< upper 4 bits each h_active, h_blank */70u8 v_active; /**< lower 8 bits (lines) */71u8 v_blank; /**< lower 8 bits (lines) */72u8 v_high; /**< upper 4 bits each v_active, v_blank */73} part1;7475struct {76u8 h_sync_off; /**< lower 8 bits, from hblank start */77u8 h_sync_width; /**< lower 8 bits (pixels) */78/** lower 4 bits each vsync offset, vsync width */79u8 v_sync_off_width;80/**81* 2 high bits of hsync offset, 2 high bits of hsync width,82* bits 4-5 of vsync offset, and 2 high bits of vsync width.83*/84u8 sync_off_width_high;85u8 dtd_flags;86u8 sdvo_flags;87/** bits 6-7 of vsync offset at bits 6-7 */88u8 v_sync_off_high;89u8 reserved;90} part2;91} __attribute__((packed));9293struct intel_sdvo_pixel_clock_range {94u16 min; /**< pixel clock, in 10kHz units */95u16 max; /**< pixel clock, in 10kHz units */96} __attribute__((packed));9798struct intel_sdvo_preferred_input_timing_args {99u16 clock;100u16 width;101u16 height;102u8 interlace:1;103u8 scaled:1;104u8 pad:6;105} __attribute__((packed));106107/* I2C registers for SDVO */108#define SDVO_I2C_ARG_0 0x07109#define SDVO_I2C_ARG_1 0x06110#define SDVO_I2C_ARG_2 0x05111#define SDVO_I2C_ARG_3 0x04112#define SDVO_I2C_ARG_4 0x03113#define SDVO_I2C_ARG_5 0x02114#define SDVO_I2C_ARG_6 0x01115#define SDVO_I2C_ARG_7 0x00116#define SDVO_I2C_OPCODE 0x08117#define SDVO_I2C_CMD_STATUS 0x09118#define SDVO_I2C_RETURN_0 0x0a119#define SDVO_I2C_RETURN_1 0x0b120#define SDVO_I2C_RETURN_2 0x0c121#define SDVO_I2C_RETURN_3 0x0d122#define SDVO_I2C_RETURN_4 0x0e123#define SDVO_I2C_RETURN_5 0x0f124#define SDVO_I2C_RETURN_6 0x10125#define SDVO_I2C_RETURN_7 0x11126#define SDVO_I2C_VENDOR_BEGIN 0x20127128/* Status results */129#define SDVO_CMD_STATUS_POWER_ON 0x0130#define SDVO_CMD_STATUS_SUCCESS 0x1131#define SDVO_CMD_STATUS_NOTSUPP 0x2132#define SDVO_CMD_STATUS_INVALID_ARG 0x3133#define SDVO_CMD_STATUS_PENDING 0x4134#define SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED 0x5135#define SDVO_CMD_STATUS_SCALING_NOT_SUPP 0x6136137/* SDVO commands, argument/result registers */138139#define SDVO_CMD_RESET 0x01140141/** Returns a struct intel_sdvo_caps */142#define SDVO_CMD_GET_DEVICE_CAPS 0x02143144#define SDVO_CMD_GET_FIRMWARE_REV 0x86145# define SDVO_DEVICE_FIRMWARE_MINOR SDVO_I2C_RETURN_0146# define SDVO_DEVICE_FIRMWARE_MAJOR SDVO_I2C_RETURN_1147# define SDVO_DEVICE_FIRMWARE_PATCH SDVO_I2C_RETURN_2148149/**150* Reports which inputs are trained (managed to sync).151*152* Devices must have trained within 2 vsyncs of a mode change.153*/154#define SDVO_CMD_GET_TRAINED_INPUTS 0x03155struct intel_sdvo_get_trained_inputs_response {156unsigned int input0_trained:1;157unsigned int input1_trained:1;158unsigned int pad:6;159} __attribute__((packed));160161/** Returns a struct intel_sdvo_output_flags of active outputs. */162#define SDVO_CMD_GET_ACTIVE_OUTPUTS 0x04163164/**165* Sets the current set of active outputs.166*167* Takes a struct intel_sdvo_output_flags. Must be preceded by a SET_IN_OUT_MAP168* on multi-output devices.169*/170#define SDVO_CMD_SET_ACTIVE_OUTPUTS 0x05171172/**173* Returns the current mapping of SDVO inputs to outputs on the device.174*175* Returns two struct intel_sdvo_output_flags structures.176*/177#define SDVO_CMD_GET_IN_OUT_MAP 0x06178struct intel_sdvo_in_out_map {179u16 in0, in1;180};181182/**183* Sets the current mapping of SDVO inputs to outputs on the device.184*185* Takes two struct i380_sdvo_output_flags structures.186*/187#define SDVO_CMD_SET_IN_OUT_MAP 0x07188189/**190* Returns a struct intel_sdvo_output_flags of attached displays.191*/192#define SDVO_CMD_GET_ATTACHED_DISPLAYS 0x0b193194/**195* Returns a struct intel_sdvo_ouptut_flags of displays supporting hot plugging.196*/197#define SDVO_CMD_GET_HOT_PLUG_SUPPORT 0x0c198199/**200* Takes a struct intel_sdvo_output_flags.201*/202#define SDVO_CMD_SET_ACTIVE_HOT_PLUG 0x0d203204/**205* Returns a struct intel_sdvo_output_flags of displays with hot plug206* interrupts enabled.207*/208#define SDVO_CMD_GET_ACTIVE_HOT_PLUG 0x0e209210#define SDVO_CMD_GET_INTERRUPT_EVENT_SOURCE 0x0f211struct intel_sdvo_get_interrupt_event_source_response {212u16 interrupt_status;213unsigned int ambient_light_interrupt:1;214unsigned int hdmi_audio_encrypt_change:1;215unsigned int pad:6;216} __attribute__((packed));217218/**219* Selects which input is affected by future input commands.220*221* Commands affected include SET_INPUT_TIMINGS_PART[12],222* GET_INPUT_TIMINGS_PART[12], GET_PREFERRED_INPUT_TIMINGS_PART[12],223* GET_INPUT_PIXEL_CLOCK_RANGE, and CREATE_PREFERRED_INPUT_TIMINGS.224*/225#define SDVO_CMD_SET_TARGET_INPUT 0x10226struct intel_sdvo_set_target_input_args {227unsigned int target_1:1;228unsigned int pad:7;229} __attribute__((packed));230231/**232* Takes a struct intel_sdvo_output_flags of which outputs are targeted by233* future output commands.234*235* Affected commands inclue SET_OUTPUT_TIMINGS_PART[12],236* GET_OUTPUT_TIMINGS_PART[12], and GET_OUTPUT_PIXEL_CLOCK_RANGE.237*/238#define SDVO_CMD_SET_TARGET_OUTPUT 0x11239240#define SDVO_CMD_GET_INPUT_TIMINGS_PART1 0x12241#define SDVO_CMD_GET_INPUT_TIMINGS_PART2 0x13242#define SDVO_CMD_SET_INPUT_TIMINGS_PART1 0x14243#define SDVO_CMD_SET_INPUT_TIMINGS_PART2 0x15244#define SDVO_CMD_SET_OUTPUT_TIMINGS_PART1 0x16245#define SDVO_CMD_SET_OUTPUT_TIMINGS_PART2 0x17246#define SDVO_CMD_GET_OUTPUT_TIMINGS_PART1 0x18247#define SDVO_CMD_GET_OUTPUT_TIMINGS_PART2 0x19248/* Part 1 */249# define SDVO_DTD_CLOCK_LOW SDVO_I2C_ARG_0250# define SDVO_DTD_CLOCK_HIGH SDVO_I2C_ARG_1251# define SDVO_DTD_H_ACTIVE SDVO_I2C_ARG_2252# define SDVO_DTD_H_BLANK SDVO_I2C_ARG_3253# define SDVO_DTD_H_HIGH SDVO_I2C_ARG_4254# define SDVO_DTD_V_ACTIVE SDVO_I2C_ARG_5255# define SDVO_DTD_V_BLANK SDVO_I2C_ARG_6256# define SDVO_DTD_V_HIGH SDVO_I2C_ARG_7257/* Part 2 */258# define SDVO_DTD_HSYNC_OFF SDVO_I2C_ARG_0259# define SDVO_DTD_HSYNC_WIDTH SDVO_I2C_ARG_1260# define SDVO_DTD_VSYNC_OFF_WIDTH SDVO_I2C_ARG_2261# define SDVO_DTD_SYNC_OFF_WIDTH_HIGH SDVO_I2C_ARG_3262# define SDVO_DTD_DTD_FLAGS SDVO_I2C_ARG_4263# define SDVO_DTD_DTD_FLAG_INTERLACED (1 << 7)264# define SDVO_DTD_DTD_FLAG_STEREO_MASK (3 << 5)265# define SDVO_DTD_DTD_FLAG_INPUT_MASK (3 << 3)266# define SDVO_DTD_DTD_FLAG_SYNC_MASK (3 << 1)267# define SDVO_DTD_SDVO_FLAS SDVO_I2C_ARG_5268# define SDVO_DTD_SDVO_FLAG_STALL (1 << 7)269# define SDVO_DTD_SDVO_FLAG_CENTERED (0 << 6)270# define SDVO_DTD_SDVO_FLAG_UPPER_LEFT (1 << 6)271# define SDVO_DTD_SDVO_FLAG_SCALING_MASK (3 << 4)272# define SDVO_DTD_SDVO_FLAG_SCALING_NONE (0 << 4)273# define SDVO_DTD_SDVO_FLAG_SCALING_SHARP (1 << 4)274# define SDVO_DTD_SDVO_FLAG_SCALING_SMOOTH (2 << 4)275# define SDVO_DTD_VSYNC_OFF_HIGH SDVO_I2C_ARG_6276277/**278* Generates a DTD based on the given width, height, and flags.279*280* This will be supported by any device supporting scaling or interlaced281* modes.282*/283#define SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING 0x1a284# define SDVO_PREFERRED_INPUT_TIMING_CLOCK_LOW SDVO_I2C_ARG_0285# define SDVO_PREFERRED_INPUT_TIMING_CLOCK_HIGH SDVO_I2C_ARG_1286# define SDVO_PREFERRED_INPUT_TIMING_WIDTH_LOW SDVO_I2C_ARG_2287# define SDVO_PREFERRED_INPUT_TIMING_WIDTH_HIGH SDVO_I2C_ARG_3288# define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_LOW SDVO_I2C_ARG_4289# define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_HIGH SDVO_I2C_ARG_5290# define SDVO_PREFERRED_INPUT_TIMING_FLAGS SDVO_I2C_ARG_6291# define SDVO_PREFERRED_INPUT_TIMING_FLAGS_INTERLACED (1 << 0)292# define SDVO_PREFERRED_INPUT_TIMING_FLAGS_SCALED (1 << 1)293294#define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1 0x1b295#define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2 0x1c296297/** Returns a struct intel_sdvo_pixel_clock_range */298#define SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE 0x1d299/** Returns a struct intel_sdvo_pixel_clock_range */300#define SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE 0x1e301302/** Returns a byte bitfield containing SDVO_CLOCK_RATE_MULT_* flags */303#define SDVO_CMD_GET_SUPPORTED_CLOCK_RATE_MULTS 0x1f304305/** Returns a byte containing a SDVO_CLOCK_RATE_MULT_* flag */306#define SDVO_CMD_GET_CLOCK_RATE_MULT 0x20307/** Takes a byte containing a SDVO_CLOCK_RATE_MULT_* flag */308#define SDVO_CMD_SET_CLOCK_RATE_MULT 0x21309# define SDVO_CLOCK_RATE_MULT_1X (1 << 0)310# define SDVO_CLOCK_RATE_MULT_2X (1 << 1)311# define SDVO_CLOCK_RATE_MULT_4X (1 << 3)312313#define SDVO_CMD_GET_SUPPORTED_TV_FORMATS 0x27314/** 6 bytes of bit flags for TV formats shared by all TV format functions */315struct intel_sdvo_tv_format {316unsigned int ntsc_m:1;317unsigned int ntsc_j:1;318unsigned int ntsc_443:1;319unsigned int pal_b:1;320unsigned int pal_d:1;321unsigned int pal_g:1;322unsigned int pal_h:1;323unsigned int pal_i:1;324325unsigned int pal_m:1;326unsigned int pal_n:1;327unsigned int pal_nc:1;328unsigned int pal_60:1;329unsigned int secam_b:1;330unsigned int secam_d:1;331unsigned int secam_g:1;332unsigned int secam_k:1;333334unsigned int secam_k1:1;335unsigned int secam_l:1;336unsigned int secam_60:1;337unsigned int hdtv_std_smpte_240m_1080i_59:1;338unsigned int hdtv_std_smpte_240m_1080i_60:1;339unsigned int hdtv_std_smpte_260m_1080i_59:1;340unsigned int hdtv_std_smpte_260m_1080i_60:1;341unsigned int hdtv_std_smpte_274m_1080i_50:1;342343unsigned int hdtv_std_smpte_274m_1080i_59:1;344unsigned int hdtv_std_smpte_274m_1080i_60:1;345unsigned int hdtv_std_smpte_274m_1080p_23:1;346unsigned int hdtv_std_smpte_274m_1080p_24:1;347unsigned int hdtv_std_smpte_274m_1080p_25:1;348unsigned int hdtv_std_smpte_274m_1080p_29:1;349unsigned int hdtv_std_smpte_274m_1080p_30:1;350unsigned int hdtv_std_smpte_274m_1080p_50:1;351352unsigned int hdtv_std_smpte_274m_1080p_59:1;353unsigned int hdtv_std_smpte_274m_1080p_60:1;354unsigned int hdtv_std_smpte_295m_1080i_50:1;355unsigned int hdtv_std_smpte_295m_1080p_50:1;356unsigned int hdtv_std_smpte_296m_720p_59:1;357unsigned int hdtv_std_smpte_296m_720p_60:1;358unsigned int hdtv_std_smpte_296m_720p_50:1;359unsigned int hdtv_std_smpte_293m_480p_59:1;360361unsigned int hdtv_std_smpte_170m_480i_59:1;362unsigned int hdtv_std_iturbt601_576i_50:1;363unsigned int hdtv_std_iturbt601_576p_50:1;364unsigned int hdtv_std_eia_7702a_480i_60:1;365unsigned int hdtv_std_eia_7702a_480p_60:1;366unsigned int pad:3;367} __attribute__((packed));368369#define SDVO_CMD_GET_TV_FORMAT 0x28370371#define SDVO_CMD_SET_TV_FORMAT 0x29372373/** Returns the resolutiosn that can be used with the given TV format */374#define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT 0x83375struct intel_sdvo_sdtv_resolution_request {376unsigned int ntsc_m:1;377unsigned int ntsc_j:1;378unsigned int ntsc_443:1;379unsigned int pal_b:1;380unsigned int pal_d:1;381unsigned int pal_g:1;382unsigned int pal_h:1;383unsigned int pal_i:1;384385unsigned int pal_m:1;386unsigned int pal_n:1;387unsigned int pal_nc:1;388unsigned int pal_60:1;389unsigned int secam_b:1;390unsigned int secam_d:1;391unsigned int secam_g:1;392unsigned int secam_k:1;393394unsigned int secam_k1:1;395unsigned int secam_l:1;396unsigned int secam_60:1;397unsigned int pad:5;398} __attribute__((packed));399400struct intel_sdvo_sdtv_resolution_reply {401unsigned int res_320x200:1;402unsigned int res_320x240:1;403unsigned int res_400x300:1;404unsigned int res_640x350:1;405unsigned int res_640x400:1;406unsigned int res_640x480:1;407unsigned int res_704x480:1;408unsigned int res_704x576:1;409410unsigned int res_720x350:1;411unsigned int res_720x400:1;412unsigned int res_720x480:1;413unsigned int res_720x540:1;414unsigned int res_720x576:1;415unsigned int res_768x576:1;416unsigned int res_800x600:1;417unsigned int res_832x624:1;418419unsigned int res_920x766:1;420unsigned int res_1024x768:1;421unsigned int res_1280x1024:1;422unsigned int pad:5;423} __attribute__((packed));424425/* Get supported resolution with squire pixel aspect ratio that can be426scaled for the requested HDTV format */427#define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT 0x85428429struct intel_sdvo_hdtv_resolution_request {430unsigned int hdtv_std_smpte_240m_1080i_59:1;431unsigned int hdtv_std_smpte_240m_1080i_60:1;432unsigned int hdtv_std_smpte_260m_1080i_59:1;433unsigned int hdtv_std_smpte_260m_1080i_60:1;434unsigned int hdtv_std_smpte_274m_1080i_50:1;435unsigned int hdtv_std_smpte_274m_1080i_59:1;436unsigned int hdtv_std_smpte_274m_1080i_60:1;437unsigned int hdtv_std_smpte_274m_1080p_23:1;438439unsigned int hdtv_std_smpte_274m_1080p_24:1;440unsigned int hdtv_std_smpte_274m_1080p_25:1;441unsigned int hdtv_std_smpte_274m_1080p_29:1;442unsigned int hdtv_std_smpte_274m_1080p_30:1;443unsigned int hdtv_std_smpte_274m_1080p_50:1;444unsigned int hdtv_std_smpte_274m_1080p_59:1;445unsigned int hdtv_std_smpte_274m_1080p_60:1;446unsigned int hdtv_std_smpte_295m_1080i_50:1;447448unsigned int hdtv_std_smpte_295m_1080p_50:1;449unsigned int hdtv_std_smpte_296m_720p_59:1;450unsigned int hdtv_std_smpte_296m_720p_60:1;451unsigned int hdtv_std_smpte_296m_720p_50:1;452unsigned int hdtv_std_smpte_293m_480p_59:1;453unsigned int hdtv_std_smpte_170m_480i_59:1;454unsigned int hdtv_std_iturbt601_576i_50:1;455unsigned int hdtv_std_iturbt601_576p_50:1;456457unsigned int hdtv_std_eia_7702a_480i_60:1;458unsigned int hdtv_std_eia_7702a_480p_60:1;459unsigned int pad:6;460} __attribute__((packed));461462struct intel_sdvo_hdtv_resolution_reply {463unsigned int res_640x480:1;464unsigned int res_800x600:1;465unsigned int res_1024x768:1;466unsigned int res_1280x960:1;467unsigned int res_1400x1050:1;468unsigned int res_1600x1200:1;469unsigned int res_1920x1440:1;470unsigned int res_2048x1536:1;471472unsigned int res_2560x1920:1;473unsigned int res_3200x2400:1;474unsigned int res_3840x2880:1;475unsigned int pad1:5;476477unsigned int res_848x480:1;478unsigned int res_1064x600:1;479unsigned int res_1280x720:1;480unsigned int res_1360x768:1;481unsigned int res_1704x960:1;482unsigned int res_1864x1050:1;483unsigned int res_1920x1080:1;484unsigned int res_2128x1200:1;485486unsigned int res_2560x1400:1;487unsigned int res_2728x1536:1;488unsigned int res_3408x1920:1;489unsigned int res_4264x2400:1;490unsigned int res_5120x2880:1;491unsigned int pad2:3;492493unsigned int res_768x480:1;494unsigned int res_960x600:1;495unsigned int res_1152x720:1;496unsigned int res_1124x768:1;497unsigned int res_1536x960:1;498unsigned int res_1680x1050:1;499unsigned int res_1728x1080:1;500unsigned int res_1920x1200:1;501502unsigned int res_2304x1440:1;503unsigned int res_2456x1536:1;504unsigned int res_3072x1920:1;505unsigned int res_3840x2400:1;506unsigned int res_4608x2880:1;507unsigned int pad3:3;508509unsigned int res_1280x1024:1;510unsigned int pad4:7;511512unsigned int res_1280x768:1;513unsigned int pad5:7;514} __attribute__((packed));515516/* Get supported power state returns info for encoder and monitor, rely on517last SetTargetInput and SetTargetOutput calls */518#define SDVO_CMD_GET_SUPPORTED_POWER_STATES 0x2a519/* Get power state returns info for encoder and monitor, rely on last520SetTargetInput and SetTargetOutput calls */521#define SDVO_CMD_GET_POWER_STATE 0x2b522#define SDVO_CMD_GET_ENCODER_POWER_STATE 0x2b523#define SDVO_CMD_SET_ENCODER_POWER_STATE 0x2c524# define SDVO_ENCODER_STATE_ON (1 << 0)525# define SDVO_ENCODER_STATE_STANDBY (1 << 1)526# define SDVO_ENCODER_STATE_SUSPEND (1 << 2)527# define SDVO_ENCODER_STATE_OFF (1 << 3)528# define SDVO_MONITOR_STATE_ON (1 << 4)529# define SDVO_MONITOR_STATE_STANDBY (1 << 5)530# define SDVO_MONITOR_STATE_SUSPEND (1 << 6)531# define SDVO_MONITOR_STATE_OFF (1 << 7)532533#define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING 0x2d534#define SDVO_CMD_GET_PANEL_POWER_SEQUENCING 0x2e535#define SDVO_CMD_SET_PANEL_POWER_SEQUENCING 0x2f536/**537* The panel power sequencing parameters are in units of milliseconds.538* The high fields are bits 8:9 of the 10-bit values.539*/540struct sdvo_panel_power_sequencing {541u8 t0;542u8 t1;543u8 t2;544u8 t3;545u8 t4;546547unsigned int t0_high:2;548unsigned int t1_high:2;549unsigned int t2_high:2;550unsigned int t3_high:2;551552unsigned int t4_high:2;553unsigned int pad:6;554} __attribute__((packed));555556#define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL 0x30557struct sdvo_max_backlight_reply {558u8 max_value;559u8 default_value;560} __attribute__((packed));561562#define SDVO_CMD_GET_BACKLIGHT_LEVEL 0x31563#define SDVO_CMD_SET_BACKLIGHT_LEVEL 0x32564565#define SDVO_CMD_GET_AMBIENT_LIGHT 0x33566struct sdvo_get_ambient_light_reply {567u16 trip_low;568u16 trip_high;569u16 value;570} __attribute__((packed));571#define SDVO_CMD_SET_AMBIENT_LIGHT 0x34572struct sdvo_set_ambient_light_reply {573u16 trip_low;574u16 trip_high;575unsigned int enable:1;576unsigned int pad:7;577} __attribute__((packed));578579/* Set display power state */580#define SDVO_CMD_SET_DISPLAY_POWER_STATE 0x7d581# define SDVO_DISPLAY_STATE_ON (1 << 0)582# define SDVO_DISPLAY_STATE_STANDBY (1 << 1)583# define SDVO_DISPLAY_STATE_SUSPEND (1 << 2)584# define SDVO_DISPLAY_STATE_OFF (1 << 3)585586#define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS 0x84587struct intel_sdvo_enhancements_reply {588unsigned int flicker_filter:1;589unsigned int flicker_filter_adaptive:1;590unsigned int flicker_filter_2d:1;591unsigned int saturation:1;592unsigned int hue:1;593unsigned int brightness:1;594unsigned int contrast:1;595unsigned int overscan_h:1;596597unsigned int overscan_v:1;598unsigned int hpos:1;599unsigned int vpos:1;600unsigned int sharpness:1;601unsigned int dot_crawl:1;602unsigned int dither:1;603unsigned int tv_chroma_filter:1;604unsigned int tv_luma_filter:1;605} __attribute__((packed));606607/* Picture enhancement limits below are dependent on the current TV format,608* and thus need to be queried and set after it.609*/610#define SDVO_CMD_GET_MAX_FLICKER_FILTER 0x4d611#define SDVO_CMD_GET_MAX_FLICKER_FILTER_ADAPTIVE 0x7b612#define SDVO_CMD_GET_MAX_FLICKER_FILTER_2D 0x52613#define SDVO_CMD_GET_MAX_SATURATION 0x55614#define SDVO_CMD_GET_MAX_HUE 0x58615#define SDVO_CMD_GET_MAX_BRIGHTNESS 0x5b616#define SDVO_CMD_GET_MAX_CONTRAST 0x5e617#define SDVO_CMD_GET_MAX_OVERSCAN_H 0x61618#define SDVO_CMD_GET_MAX_OVERSCAN_V 0x64619#define SDVO_CMD_GET_MAX_HPOS 0x67620#define SDVO_CMD_GET_MAX_VPOS 0x6a621#define SDVO_CMD_GET_MAX_SHARPNESS 0x6d622#define SDVO_CMD_GET_MAX_TV_CHROMA_FILTER 0x74623#define SDVO_CMD_GET_MAX_TV_LUMA_FILTER 0x77624struct intel_sdvo_enhancement_limits_reply {625u16 max_value;626u16 default_value;627} __attribute__((packed));628629#define SDVO_CMD_GET_LVDS_PANEL_INFORMATION 0x7f630#define SDVO_CMD_SET_LVDS_PANEL_INFORMATION 0x80631# define SDVO_LVDS_COLOR_DEPTH_18 (0 << 0)632# define SDVO_LVDS_COLOR_DEPTH_24 (1 << 0)633# define SDVO_LVDS_CONNECTOR_SPWG (0 << 2)634# define SDVO_LVDS_CONNECTOR_OPENLDI (1 << 2)635# define SDVO_LVDS_SINGLE_CHANNEL (0 << 4)636# define SDVO_LVDS_DUAL_CHANNEL (1 << 4)637638#define SDVO_CMD_GET_FLICKER_FILTER 0x4e639#define SDVO_CMD_SET_FLICKER_FILTER 0x4f640#define SDVO_CMD_GET_FLICKER_FILTER_ADAPTIVE 0x50641#define SDVO_CMD_SET_FLICKER_FILTER_ADAPTIVE 0x51642#define SDVO_CMD_GET_FLICKER_FILTER_2D 0x53643#define SDVO_CMD_SET_FLICKER_FILTER_2D 0x54644#define SDVO_CMD_GET_SATURATION 0x56645#define SDVO_CMD_SET_SATURATION 0x57646#define SDVO_CMD_GET_HUE 0x59647#define SDVO_CMD_SET_HUE 0x5a648#define SDVO_CMD_GET_BRIGHTNESS 0x5c649#define SDVO_CMD_SET_BRIGHTNESS 0x5d650#define SDVO_CMD_GET_CONTRAST 0x5f651#define SDVO_CMD_SET_CONTRAST 0x60652#define SDVO_CMD_GET_OVERSCAN_H 0x62653#define SDVO_CMD_SET_OVERSCAN_H 0x63654#define SDVO_CMD_GET_OVERSCAN_V 0x65655#define SDVO_CMD_SET_OVERSCAN_V 0x66656#define SDVO_CMD_GET_HPOS 0x68657#define SDVO_CMD_SET_HPOS 0x69658#define SDVO_CMD_GET_VPOS 0x6b659#define SDVO_CMD_SET_VPOS 0x6c660#define SDVO_CMD_GET_SHARPNESS 0x6e661#define SDVO_CMD_SET_SHARPNESS 0x6f662#define SDVO_CMD_GET_TV_CHROMA_FILTER 0x75663#define SDVO_CMD_SET_TV_CHROMA_FILTER 0x76664#define SDVO_CMD_GET_TV_LUMA_FILTER 0x78665#define SDVO_CMD_SET_TV_LUMA_FILTER 0x79666struct intel_sdvo_enhancements_arg {667u16 value;668}__attribute__((packed));669670#define SDVO_CMD_GET_DOT_CRAWL 0x70671#define SDVO_CMD_SET_DOT_CRAWL 0x71672# define SDVO_DOT_CRAWL_ON (1 << 0)673# define SDVO_DOT_CRAWL_DEFAULT_ON (1 << 1)674675#define SDVO_CMD_GET_DITHER 0x72676#define SDVO_CMD_SET_DITHER 0x73677# define SDVO_DITHER_ON (1 << 0)678# define SDVO_DITHER_DEFAULT_ON (1 << 1)679680#define SDVO_CMD_SET_CONTROL_BUS_SWITCH 0x7a681# define SDVO_CONTROL_BUS_PROM (1 << 0)682# define SDVO_CONTROL_BUS_DDC1 (1 << 1)683# define SDVO_CONTROL_BUS_DDC2 (1 << 2)684# define SDVO_CONTROL_BUS_DDC3 (1 << 3)685686/* HDMI op codes */687#define SDVO_CMD_GET_SUPP_ENCODE 0x9d688#define SDVO_CMD_GET_ENCODE 0x9e689#define SDVO_CMD_SET_ENCODE 0x9f690#define SDVO_ENCODE_DVI 0x0691#define SDVO_ENCODE_HDMI 0x1692#define SDVO_CMD_SET_PIXEL_REPLI 0x8b693#define SDVO_CMD_GET_PIXEL_REPLI 0x8c694#define SDVO_CMD_GET_COLORIMETRY_CAP 0x8d695#define SDVO_CMD_SET_COLORIMETRY 0x8e696#define SDVO_COLORIMETRY_RGB256 0x0697#define SDVO_COLORIMETRY_RGB220 0x1698#define SDVO_COLORIMETRY_YCrCb422 0x3699#define SDVO_COLORIMETRY_YCrCb444 0x4700#define SDVO_CMD_GET_COLORIMETRY 0x8f701#define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER 0x90702#define SDVO_CMD_SET_AUDIO_STAT 0x91703#define SDVO_CMD_GET_AUDIO_STAT 0x92704#define SDVO_CMD_SET_HBUF_INDEX 0x93705#define SDVO_CMD_GET_HBUF_INDEX 0x94706#define SDVO_CMD_GET_HBUF_INFO 0x95707#define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96708#define SDVO_CMD_GET_HBUF_AV_SPLIT 0x97709#define SDVO_CMD_SET_HBUF_DATA 0x98710#define SDVO_CMD_GET_HBUF_DATA 0x99711#define SDVO_CMD_SET_HBUF_TXRATE 0x9a712#define SDVO_CMD_GET_HBUF_TXRATE 0x9b713#define SDVO_HBUF_TX_DISABLED (0 << 6)714#define SDVO_HBUF_TX_ONCE (2 << 6)715#define SDVO_HBUF_TX_VSYNC (3 << 6)716#define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c717#define SDVO_NEED_TO_STALL (1 << 7)718719struct intel_sdvo_encode{720u8 dvi_rev;721u8 hdmi_rev;722} __attribute__ ((packed));723724725