[Intel-gfx] [PATCH i-g-t 4/8] tools/intel_vbt_decode: abstract DSI bridge type dump

Jani Nikula jani.nikula at intel.com
Thu Oct 19 15:22:55 UTC 2017


Cleaner than having it inline.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 tools/intel_vbt_decode.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 0f7e2dafc762..69cf1e4c6cc6 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);
 	}
-- 
2.11.0



More information about the Intel-gfx mailing list