From 7e4cd23d4767be71316c4113c209b5ea049fc6ba Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 21 Sep 2017 16:44:55 +0300 Subject: tools/intel_vbt_decode: abstract DSI bridge type dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleaner than having it inline. Acked-by: Ville Syrjälä Signed-off-by: Jani Nikula --- tools/intel_vbt_decode.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'tools') diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c index 0f7e2daf..69cf1e4c 100644 --- a/tools/intel_vbt_decode.c +++ b/tools/intel_vbt_decode.c @@ -384,6 +384,20 @@ static const char *dvo_port(uint8_t type) return "unknown"; } +static const char *mipi_bridge_type(uint8_t type) +{ + switch (type) { + case 1: + return "ASUS"; + case 2: + return "Toshiba"; + case 3: + return "Renesas"; + default: + return "unknown"; + } +} + static void dump_child_device(struct context *context, const struct child_device_config *child) { @@ -440,21 +454,8 @@ static void dump_child_device(struct context *context, printf("\t\tSDVO stall signal available: %s\n", YESNO(efp->sdvo_stall)); printf("\t\tPipe capabilities: 0x%02x\n", efp->pipe_cap); printf("\t\tDVO wiring: 0x%02x\n", efp->dvo_wiring); - printf("\t\tMIPI bridge type:"); - switch (efp->mipi_bridge_type) { - case 1: - printf("ASUS\n"); - break; - case 2: - printf("Toshiba\n"); - break; - case 3: - printf("Renesas\n"); - break; - default: - printf("(unknown value %d)\n", efp->mipi_bridge_type); - break; - } + printf("\t\tMIPI bridge type: %02x (%s)\n", efp->mipi_bridge_type, + mipi_bridge_type(efp->mipi_bridge_type)); printf("\t\tDevice class extendsion: 0x%02x\n", efp->extended_type); printf("\t\tDVO function: 0x%02x\n", efp->dvo_function); } -- cgit v1.2.3