summaryrefslogtreecommitdiff
path: root/tools/intel_vbt_decode.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2017-08-28 15:07:35 +0300
committerJani Nikula <jani.nikula@intel.com>2017-08-29 17:26:19 +0300
commit3b163c4809519c8e5baa02bcf01bd3d3efadc8eb (patch)
tree25e3f9de01b2ff3b5b51b52c6e1afc8c322d8e7a /tools/intel_vbt_decode.c
parent66d88e6093a7aa682ee4baa1573dda7c7f70c3b4 (diff)
tools/intel_vbt_decode: migrate child device type bits decoding to kernel defs
This lets us use the verbatim copy of the kernel intel_vbt_defs.h file after kernel commit 058727ee8d9a ("drm/i915/bios: amend edp block based on intel_vbt_decode"). Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'tools/intel_vbt_decode.c')
-rw-r--r--tools/intel_vbt_decode.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 20f7569a..a3c4e3fc 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -299,34 +299,37 @@ static const char *child_device_type(unsigned short type)
return "unknown";
}
-static const char * const child_device_type_bits[] = {
- [DEVICE_TYPE_CLASS_EXTENSION] = "Class extension",
- [DEVICE_TYPE_POWER_MANAGEMENT] = "Power management",
- [DEVICE_TYPE_HOTPLUG_SIGNALING] = "Hotplug signaling",
- [DEVICE_TYPE_INTERNAL_CONNECTOR] = "Internal connector",
- [DEVICE_TYPE_NOT_HDMI_OUTPUT] = "HDMI output", /* decoded as inverse */
- [DEVICE_TYPE_MIPI_OUTPUT] = "MIPI output",
- [DEVICE_TYPE_COMPOSITE_OUTPUT] = "Composite output",
- [DEVICE_TYPE_DIAL_CHANNEL] = "Dual channel",
- [DEVICE_TYPE_CONTENT_PROTECTION] = "Content protection",
- [DEVICE_TYPE_HIGH_SPEED_LINK] = "High speel link",
- [DEVICE_TYPE_LVDS_SIGNALING] = "LVDS signaling",
- [DEVICE_TYPE_TMDS_DVI_SIGNALING] = "TMDS/DVI signaling",
- [DEVICE_TYPE_VIDEO_SIGNALING] = "Video signaling",
- [DEVICE_TYPE_DISPLAYPORT_OUTPUT] = "DisplayPort output",
- [DEVICE_TYPE_DIGITAL_OUTPUT] = "Digital output",
- [DEVICE_TYPE_ANALOG_OUTPUT] = "Analog output",
+static const struct {
+ unsigned short mask;
+ const char *name;
+} child_device_type_bits[] = {
+ { DEVICE_TYPE_CLASS_EXTENSION, "Class extension" },
+ { DEVICE_TYPE_POWER_MANAGEMENT, "Power management" },
+ { DEVICE_TYPE_HOTPLUG_SIGNALING, "Hotplug signaling" },
+ { DEVICE_TYPE_INTERNAL_CONNECTOR, "Internal connector" },
+ { DEVICE_TYPE_NOT_HDMI_OUTPUT, "HDMI output" }, /* decoded as inverse */
+ { DEVICE_TYPE_MIPI_OUTPUT, "MIPI output" },
+ { DEVICE_TYPE_COMPOSITE_OUTPUT, "Composite output" },
+ { DEVICE_TYPE_DUAL_CHANNEL, "Dual channel" },
+ { 1 << 7, "Content protection" },
+ { DEVICE_TYPE_HIGH_SPEED_LINK, "High speel link" },
+ { DEVICE_TYPE_LVDS_SINGALING, "LVDS signaling" },
+ { DEVICE_TYPE_TMDS_DVI_SIGNALING, "TMDS/DVI signaling" },
+ { DEVICE_TYPE_VIDEO_SIGNALING, "Video signaling" },
+ { DEVICE_TYPE_DISPLAYPORT_OUTPUT, "DisplayPort output" },
+ { DEVICE_TYPE_DIGITAL_OUTPUT, "Digital output" },
+ { DEVICE_TYPE_ANALOG_OUTPUT, "Analog output" },
};
static void dump_child_device_type_bits(uint16_t type)
{
- int bit;
+ int i;
- type ^= 1 << DEVICE_TYPE_NOT_HDMI_OUTPUT;
+ type ^= DEVICE_TYPE_NOT_HDMI_OUTPUT;
- for (bit = 15; bit >= 0; bit--) {
- if (type & (1 << bit))
- printf("\t\t\t%s\n", child_device_type_bits[bit]);
+ for (i = 0; i < ARRAY_SIZE(child_device_type_bits); i++) {
+ if (child_device_type_bits[i].mask & type)
+ printf("\t\t\t%s\n", child_device_type_bits[i].name);
}
}