linux/drivers/gpu/drm/gma500/psb_intel_sdvo_regs.h

/*
 * Copyright ? 2006-2007 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * Authors:
 *	Eric Anholt <[email protected]>
 */

/**
 * @file SDVO command definitions and structures.
 */

#define SDVO_OUTPUT_FIRST
#define SDVO_OUTPUT_TMDS0
#define SDVO_OUTPUT_RGB0
#define SDVO_OUTPUT_CVBS0
#define SDVO_OUTPUT_SVID0
#define SDVO_OUTPUT_YPRPB0
#define SDVO_OUTPUT_SCART0
#define SDVO_OUTPUT_LVDS0
#define SDVO_OUTPUT_TMDS1
#define SDVO_OUTPUT_RGB1
#define SDVO_OUTPUT_CVBS1
#define SDVO_OUTPUT_SVID1
#define SDVO_OUTPUT_YPRPB1
#define SDVO_OUTPUT_SCART1
#define SDVO_OUTPUT_LVDS1
#define SDVO_OUTPUT_LAST

struct psb_intel_sdvo_caps {} __attribute__((packed));

/** This matches the EDID DTD structure, more or less */
struct psb_intel_sdvo_dtd {} __attribute__((packed));

struct psb_intel_sdvo_pixel_clock_range {} __attribute__((packed));

struct psb_intel_sdvo_preferred_input_timing_args {} __attribute__((packed));

/* I2C registers for SDVO */
#define SDVO_I2C_ARG_0
#define SDVO_I2C_ARG_1
#define SDVO_I2C_ARG_2
#define SDVO_I2C_ARG_3
#define SDVO_I2C_ARG_4
#define SDVO_I2C_ARG_5
#define SDVO_I2C_ARG_6
#define SDVO_I2C_ARG_7
#define SDVO_I2C_OPCODE
#define SDVO_I2C_CMD_STATUS
#define SDVO_I2C_RETURN_0
#define SDVO_I2C_RETURN_1
#define SDVO_I2C_RETURN_2
#define SDVO_I2C_RETURN_3
#define SDVO_I2C_RETURN_4
#define SDVO_I2C_RETURN_5
#define SDVO_I2C_RETURN_6
#define SDVO_I2C_RETURN_7
#define SDVO_I2C_VENDOR_BEGIN

/* Status results */
#define SDVO_CMD_STATUS_POWER_ON
#define SDVO_CMD_STATUS_SUCCESS
#define SDVO_CMD_STATUS_NOTSUPP
#define SDVO_CMD_STATUS_INVALID_ARG
#define SDVO_CMD_STATUS_PENDING
#define SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED
#define SDVO_CMD_STATUS_SCALING_NOT_SUPP

/* SDVO commands, argument/result registers */

#define SDVO_CMD_RESET

/** Returns a struct intel_sdvo_caps */
#define SDVO_CMD_GET_DEVICE_CAPS

#define SDVO_CMD_GET_FIRMWARE_REV
#define SDVO_DEVICE_FIRMWARE_MINOR
#define SDVO_DEVICE_FIRMWARE_MAJOR
#define SDVO_DEVICE_FIRMWARE_PATCH

/**
 * Reports which inputs are trained (managed to sync).
 *
 * Devices must have trained within 2 vsyncs of a mode change.
 */
#define SDVO_CMD_GET_TRAINED_INPUTS
struct psb_intel_sdvo_get_trained_inputs_response {} __attribute__((packed));

/** Returns a struct intel_sdvo_output_flags of active outputs. */
#define SDVO_CMD_GET_ACTIVE_OUTPUTS

/**
 * Sets the current set of active outputs.
 *
 * Takes a struct intel_sdvo_output_flags.  Must be preceded by a SET_IN_OUT_MAP
 * on multi-output devices.
 */
#define SDVO_CMD_SET_ACTIVE_OUTPUTS

/**
 * Returns the current mapping of SDVO inputs to outputs on the device.
 *
 * Returns two struct intel_sdvo_output_flags structures.
 */
#define SDVO_CMD_GET_IN_OUT_MAP
struct psb_intel_sdvo_in_out_map {};

/**
 * Sets the current mapping of SDVO inputs to outputs on the device.
 *
 * Takes two struct i380_sdvo_output_flags structures.
 */
#define SDVO_CMD_SET_IN_OUT_MAP

/**
 * Returns a struct intel_sdvo_output_flags of attached displays.
 */
#define SDVO_CMD_GET_ATTACHED_DISPLAYS

/**
 * Returns a struct intel_sdvo_ouptut_flags of displays supporting hot plugging.
 */
#define SDVO_CMD_GET_HOT_PLUG_SUPPORT

/**
 * Takes a struct intel_sdvo_output_flags.
 */
#define SDVO_CMD_SET_ACTIVE_HOT_PLUG

/**
 * Returns a struct intel_sdvo_output_flags of displays with hot plug
 * interrupts enabled.
 */
#define SDVO_CMD_GET_ACTIVE_HOT_PLUG

#define SDVO_CMD_GET_INTERRUPT_EVENT_SOURCE
struct intel_sdvo_get_interrupt_event_source_response {} __attribute__((packed));

/**
 * Selects which input is affected by future input commands.
 *
 * Commands affected include SET_INPUT_TIMINGS_PART[12],
 * GET_INPUT_TIMINGS_PART[12], GET_PREFERRED_INPUT_TIMINGS_PART[12],
 * GET_INPUT_PIXEL_CLOCK_RANGE, and CREATE_PREFERRED_INPUT_TIMINGS.
 */
#define SDVO_CMD_SET_TARGET_INPUT
struct psb_intel_sdvo_set_target_input_args {} __attribute__((packed));

/**
 * Takes a struct intel_sdvo_output_flags of which outputs are targeted by
 * future output commands.
 *
 * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12],
 * GET_OUTPUT_TIMINGS_PART[12], and GET_OUTPUT_PIXEL_CLOCK_RANGE.
 */
#define SDVO_CMD_SET_TARGET_OUTPUT

#define SDVO_CMD_GET_INPUT_TIMINGS_PART1
#define SDVO_CMD_GET_INPUT_TIMINGS_PART2
#define SDVO_CMD_SET_INPUT_TIMINGS_PART1
#define SDVO_CMD_SET_INPUT_TIMINGS_PART2
#define SDVO_CMD_SET_OUTPUT_TIMINGS_PART1
#define SDVO_CMD_SET_OUTPUT_TIMINGS_PART2
#define SDVO_CMD_GET_OUTPUT_TIMINGS_PART1
#define SDVO_CMD_GET_OUTPUT_TIMINGS_PART2
/* Part 1 */
#define SDVO_DTD_CLOCK_LOW
#define SDVO_DTD_CLOCK_HIGH
#define SDVO_DTD_H_ACTIVE
#define SDVO_DTD_H_BLANK
#define SDVO_DTD_H_HIGH
#define SDVO_DTD_V_ACTIVE
#define SDVO_DTD_V_BLANK
#define SDVO_DTD_V_HIGH
/* Part 2 */
#define SDVO_DTD_HSYNC_OFF
#define SDVO_DTD_HSYNC_WIDTH
#define SDVO_DTD_VSYNC_OFF_WIDTH
#define SDVO_DTD_SYNC_OFF_WIDTH_HIGH
#define SDVO_DTD_DTD_FLAGS
#define SDVO_DTD_DTD_FLAG_INTERLACED
#define SDVO_DTD_DTD_FLAG_STEREO_MASK
#define SDVO_DTD_DTD_FLAG_INPUT_MASK
#define SDVO_DTD_DTD_FLAG_SYNC_MASK
#define SDVO_DTD_SDVO_FLAS
#define SDVO_DTD_SDVO_FLAG_STALL
#define SDVO_DTD_SDVO_FLAG_CENTERED
#define SDVO_DTD_SDVO_FLAG_UPPER_LEFT
#define SDVO_DTD_SDVO_FLAG_SCALING_MASK
#define SDVO_DTD_SDVO_FLAG_SCALING_NONE
#define SDVO_DTD_SDVO_FLAG_SCALING_SHARP
#define SDVO_DTD_SDVO_FLAG_SCALING_SMOOTH
#define SDVO_DTD_VSYNC_OFF_HIGH

/**
 * Generates a DTD based on the given width, height, and flags.
 *
 * This will be supported by any device supporting scaling or interlaced
 * modes.
 */
#define SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING
#define SDVO_PREFERRED_INPUT_TIMING_CLOCK_LOW
#define SDVO_PREFERRED_INPUT_TIMING_CLOCK_HIGH
#define SDVO_PREFERRED_INPUT_TIMING_WIDTH_LOW
#define SDVO_PREFERRED_INPUT_TIMING_WIDTH_HIGH
#define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_LOW
#define SDVO_PREFERRED_INPUT_TIMING_HEIGHT_HIGH
#define SDVO_PREFERRED_INPUT_TIMING_FLAGS
#define SDVO_PREFERRED_INPUT_TIMING_FLAGS_INTERLACED
#define SDVO_PREFERRED_INPUT_TIMING_FLAGS_SCALED

#define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1
#define SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2

/** Returns a struct intel_sdvo_pixel_clock_range */
#define SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE
/** Returns a struct intel_sdvo_pixel_clock_range */
#define SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE

/** Returns a byte bitfield containing SDVO_CLOCK_RATE_MULT_* flags */
#define SDVO_CMD_GET_SUPPORTED_CLOCK_RATE_MULTS

/** Returns a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
#define SDVO_CMD_GET_CLOCK_RATE_MULT
/** Takes a byte containing a SDVO_CLOCK_RATE_MULT_* flag */
#define SDVO_CMD_SET_CLOCK_RATE_MULT
#define SDVO_CLOCK_RATE_MULT_1X
#define SDVO_CLOCK_RATE_MULT_2X
#define SDVO_CLOCK_RATE_MULT_4X

#define SDVO_CMD_GET_SUPPORTED_TV_FORMATS
/** 6 bytes of bit flags for TV formats shared by all TV format functions */
struct psb_intel_sdvo_tv_format {} __attribute__((packed));

#define SDVO_CMD_GET_TV_FORMAT

#define SDVO_CMD_SET_TV_FORMAT

/** Returns the resolutiosn that can be used with the given TV format */
#define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT
struct psb_intel_sdvo_sdtv_resolution_request {} __attribute__((packed));

struct psb_intel_sdvo_sdtv_resolution_reply {} __attribute__((packed));

/* Get supported resolution with squire pixel aspect ratio that can be
   scaled for the requested HDTV format */
#define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT

struct psb_intel_sdvo_hdtv_resolution_request {} __attribute__((packed));

struct psb_intel_sdvo_hdtv_resolution_reply {} __attribute__((packed));

/* Get supported power state returns info for encoder and monitor, rely on
   last SetTargetInput and SetTargetOutput calls */
#define SDVO_CMD_GET_SUPPORTED_POWER_STATES
/* Get power state returns info for encoder and monitor, rely on last
   SetTargetInput and SetTargetOutput calls */
#define SDVO_CMD_GET_POWER_STATE
#define SDVO_CMD_GET_ENCODER_POWER_STATE
#define SDVO_CMD_SET_ENCODER_POWER_STATE
#define SDVO_ENCODER_STATE_ON
#define SDVO_ENCODER_STATE_STANDBY
#define SDVO_ENCODER_STATE_SUSPEND
#define SDVO_ENCODER_STATE_OFF
#define SDVO_MONITOR_STATE_ON
#define SDVO_MONITOR_STATE_STANDBY
#define SDVO_MONITOR_STATE_SUSPEND
#define SDVO_MONITOR_STATE_OFF

#define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING
#define SDVO_CMD_GET_PANEL_POWER_SEQUENCING
#define SDVO_CMD_SET_PANEL_POWER_SEQUENCING
/**
 * The panel power sequencing parameters are in units of milliseconds.
 * The high fields are bits 8:9 of the 10-bit values.
 */
struct psb_sdvo_panel_power_sequencing {} __attribute__((packed));

#define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL
struct sdvo_max_backlight_reply {} __attribute__((packed));

#define SDVO_CMD_GET_BACKLIGHT_LEVEL
#define SDVO_CMD_SET_BACKLIGHT_LEVEL

#define SDVO_CMD_GET_AMBIENT_LIGHT
struct sdvo_get_ambient_light_reply {} __attribute__((packed));
#define SDVO_CMD_SET_AMBIENT_LIGHT
struct sdvo_set_ambient_light_reply {} __attribute__((packed));

/* Set display power state */
#define SDVO_CMD_SET_DISPLAY_POWER_STATE
#define SDVO_DISPLAY_STATE_ON
#define SDVO_DISPLAY_STATE_STANDBY
#define SDVO_DISPLAY_STATE_SUSPEND
#define SDVO_DISPLAY_STATE_OFF

#define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS
struct psb_intel_sdvo_enhancements_reply {} __attribute__((packed));

/* Picture enhancement limits below are dependent on the current TV format,
 * and thus need to be queried and set after it.
 */
#define SDVO_CMD_GET_MAX_FLICKER_FILTER
#define SDVO_CMD_GET_MAX_FLICKER_FILTER_ADAPTIVE
#define SDVO_CMD_GET_MAX_FLICKER_FILTER_2D
#define SDVO_CMD_GET_MAX_SATURATION
#define SDVO_CMD_GET_MAX_HUE
#define SDVO_CMD_GET_MAX_BRIGHTNESS
#define SDVO_CMD_GET_MAX_CONTRAST
#define SDVO_CMD_GET_MAX_OVERSCAN_H
#define SDVO_CMD_GET_MAX_OVERSCAN_V
#define SDVO_CMD_GET_MAX_HPOS
#define SDVO_CMD_GET_MAX_VPOS
#define SDVO_CMD_GET_MAX_SHARPNESS
#define SDVO_CMD_GET_MAX_TV_CHROMA_FILTER
#define SDVO_CMD_GET_MAX_TV_LUMA_FILTER
struct psb_intel_sdvo_enhancement_limits_reply {} __attribute__((packed));

#define SDVO_CMD_GET_LVDS_PANEL_INFORMATION
#define SDVO_CMD_SET_LVDS_PANEL_INFORMATION
#define SDVO_LVDS_COLOR_DEPTH_18
#define SDVO_LVDS_COLOR_DEPTH_24
#define SDVO_LVDS_CONNECTOR_SPWG
#define SDVO_LVDS_CONNECTOR_OPENLDI
#define SDVO_LVDS_SINGLE_CHANNEL
#define SDVO_LVDS_DUAL_CHANNEL

#define SDVO_CMD_GET_FLICKER_FILTER
#define SDVO_CMD_SET_FLICKER_FILTER
#define SDVO_CMD_GET_FLICKER_FILTER_ADAPTIVE
#define SDVO_CMD_SET_FLICKER_FILTER_ADAPTIVE
#define SDVO_CMD_GET_FLICKER_FILTER_2D
#define SDVO_CMD_SET_FLICKER_FILTER_2D
#define SDVO_CMD_GET_SATURATION
#define SDVO_CMD_SET_SATURATION
#define SDVO_CMD_GET_HUE
#define SDVO_CMD_SET_HUE
#define SDVO_CMD_GET_BRIGHTNESS
#define SDVO_CMD_SET_BRIGHTNESS
#define SDVO_CMD_GET_CONTRAST
#define SDVO_CMD_SET_CONTRAST
#define SDVO_CMD_GET_OVERSCAN_H
#define SDVO_CMD_SET_OVERSCAN_H
#define SDVO_CMD_GET_OVERSCAN_V
#define SDVO_CMD_SET_OVERSCAN_V
#define SDVO_CMD_GET_HPOS
#define SDVO_CMD_SET_HPOS
#define SDVO_CMD_GET_VPOS
#define SDVO_CMD_SET_VPOS
#define SDVO_CMD_GET_SHARPNESS
#define SDVO_CMD_SET_SHARPNESS
#define SDVO_CMD_GET_TV_CHROMA_FILTER
#define SDVO_CMD_SET_TV_CHROMA_FILTER
#define SDVO_CMD_GET_TV_LUMA_FILTER
#define SDVO_CMD_SET_TV_LUMA_FILTER
struct psb_intel_sdvo_enhancements_arg {}__attribute__((packed));

#define SDVO_CMD_GET_DOT_CRAWL
#define SDVO_CMD_SET_DOT_CRAWL
#define SDVO_DOT_CRAWL_ON
#define SDVO_DOT_CRAWL_DEFAULT_ON

#define SDVO_CMD_GET_DITHER
#define SDVO_CMD_SET_DITHER
#define SDVO_DITHER_ON
#define SDVO_DITHER_DEFAULT_ON

#define SDVO_CMD_SET_CONTROL_BUS_SWITCH
#define SDVO_CONTROL_BUS_PROM
#define SDVO_CONTROL_BUS_DDC1
#define SDVO_CONTROL_BUS_DDC2
#define SDVO_CONTROL_BUS_DDC3

/* HDMI op codes */
#define SDVO_CMD_GET_SUPP_ENCODE
#define SDVO_CMD_GET_ENCODE
#define SDVO_CMD_SET_ENCODE
  #define SDVO_ENCODE_DVI
  #define SDVO_ENCODE_HDMI
#define SDVO_CMD_SET_PIXEL_REPLI
#define SDVO_CMD_GET_PIXEL_REPLI
#define SDVO_CMD_GET_COLORIMETRY_CAP
#define SDVO_CMD_SET_COLORIMETRY
  #define SDVO_COLORIMETRY_RGB256
  #define SDVO_COLORIMETRY_RGB220
  #define SDVO_COLORIMETRY_YCrCb422
  #define SDVO_COLORIMETRY_YCrCb444
#define SDVO_CMD_GET_COLORIMETRY
#define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER
#define SDVO_CMD_SET_AUDIO_STAT
#define SDVO_CMD_GET_AUDIO_STAT
#define SDVO_CMD_SET_HBUF_INDEX
#define SDVO_CMD_GET_HBUF_INDEX
#define SDVO_CMD_GET_HBUF_INFO
#define SDVO_CMD_SET_HBUF_AV_SPLIT
#define SDVO_CMD_GET_HBUF_AV_SPLIT
#define SDVO_CMD_SET_HBUF_DATA
#define SDVO_CMD_GET_HBUF_DATA
#define SDVO_CMD_SET_HBUF_TXRATE
#define SDVO_CMD_GET_HBUF_TXRATE
  #define SDVO_HBUF_TX_DISABLED
  #define SDVO_HBUF_TX_ONCE
  #define SDVO_HBUF_TX_VSYNC
#define SDVO_CMD_GET_AUDIO_TX_INFO
#define SDVO_NEED_TO_STALL

struct psb_intel_sdvo_encode {} __attribute__ ((packed));