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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cleaner than having it inline.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux