[igt-dev] [PATCH i-g-t 2/5] tools/intel_vbt_decode: Decode the i2c speed
Ville Syrjala
ville.syrjala at linux.intel.com
Wed Sep 7 09:46:48 UTC 2022
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Decode the i2c speed, just for kicks.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
tools/intel_vbt_decode.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index ee3b5effee92..7e3bad3583cd 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -918,6 +918,17 @@ static const char *hdmi_frl_rate(u8 frl_rate)
}
}
+static const char *i2c_speed(u8 i2c_speed)
+{
+ switch (i2c_speed) {
+ case 0: return "100 kHz";
+ case 1: return "50 kHz";
+ case 2: return "400 kHz";
+ case 3: return "1 MHz";
+ default: return "<unknown>";
+ }
+}
+
static void dump_child_device(struct context *context,
const struct child_device_config *child)
{
@@ -934,7 +945,8 @@ static void dump_child_device(struct context *context,
if (context->bdb->version < 152) {
printf("\t\tSignature: %.*s\n", (int)sizeof(child->device_id), child->device_id);
} else {
- printf("\t\tI2C speed: 0x%02x\n", child->i2c_speed);
+ printf("\t\tI2C speed: %s (0x%02x)\n",
+ i2c_speed(child->i2c_speed), child->i2c_speed);
printf("\t\tDP onboard redriver:\n");
printf("\t\t\tpresent: %s\n",
YESNO((child->dp_onboard_redriver_present)));
--
2.35.1
More information about the igt-dev
mailing list