Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56f304e9 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/bios: add legacy contents to common child device config



Add legacy contents to common child device config, in preparation for
using a single child device config. Use unions where BDB versions of the
config differ. Use the naming from old_child_dev_config for legacy
fields.

No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b606456da4d52f1aedf383aab4275d81013d3178.1503600621.git.jani.nikula@intel.com
parent d58107f9
Loading
Loading
Loading
Loading
+70 −31
Original line number Diff line number Diff line
@@ -257,12 +257,31 @@ struct old_child_dev_config {
	u8  dvo_function;
} __packed;

/* This one contains field offsets that are known to be common for all BDB
 * versions. Notice that the meaning of the contents contents may still change,
 * but at least the offsets are consistent. */
/*
 * The child device config, aka the display device data structure, provides a
 * description of a port and its configuration on the platform.
 *
 * The child device config size has been increased, and fields have been added
 * and their meaning has changed over time. Care must be taken when accessing
 * basically any of the fields to ensure the correct interpretation for the BDB
 * version in question.
 *
 * When we copy the child device configs to dev_priv->vbt.child_dev, we reserve
 * space for the full structure below, and initialize the tail not actually
 * present in VBT to zeros. Accessing those fields is fine, as long as the
 * default zero is taken into account, again according to the BDB version.
 *
 * BDB versions 155 and below are considered legacy, and version 155 seems to be
 * a baseline for some of the VBT documentation. When adding new fields, please
 * include the BDB version when the field was added, if it's above that.
 */
struct common_child_dev_config {
	u16 handle;
	u16 device_type;

	union {
		u8  device_id[10]; /* ascii string */
		struct {
			u8 i2c_speed;
			u8 dp_onboard_redriver;			/* 158 */
			u8 dp_ondock_redriver;			/* 158 */
@@ -278,6 +297,9 @@ struct common_child_dev_config {
			u8 reserved1:4;
			u8 slave_port;				/* 202 */
			u8 reserved2;
		} __packed;
	} __packed;

	u16 addin_offset;
	u8 dvo_port;
	u8 i2c_pin;
@@ -285,6 +307,15 @@ struct common_child_dev_config {
	u8 ddc_pin;
	u16 edid_ptr;
	u8 dvo_cfg; /* See DEVICE_CFG_* above */

	union {
		struct {
			u8 dvo2_port;
			u8 i2c2_pin;
			u8 slave2_addr;
			u8 ddc2_pin;
		} __packed;
		struct {
			u8 efp_routed:1;			/* 158 */
			u8 lane_reversal:1;			/* 184 */
			u8 lspcon:1;				/* 192 */
@@ -297,9 +328,17 @@ struct common_child_dev_config {
			u8 support_reserved:5;
			u8 aux_channel;
			u8 dongle_detect;
		} __packed;
	} __packed;

	u8 capabilities;
	u8 dvo_wiring; /* See DEVICE_WIRE_* above */

	union {
		u8 dvo2_wiring;
		u8 mipi_bridge_type;				/* 171 */
	} __packed;

	u16 extended_type;
	u8 dvo_function;
	u8 flags2;						/* 195 */