[i-g-t PATCH 5/5] intel_bios_reader: add dumping of i2c element in mipi sequence

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

 



Due to the clever way the whole sequence block is specified without
forward compatibility, it's not possible to dump most blocks without
this.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 tools/intel_bios_reader.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c
index 7c3e1bcaa387..b31f648f0607 100644
--- a/tools/intel_bios_reader.c
+++ b/tools/intel_bios_reader.c
@@ -894,12 +894,35 @@ static const uint8_t *mipi_dump_gpio(const uint8_t *data)
 	return data;
 }
 
+static const uint8_t *mipi_dump_i2c(const uint8_t *data)
+{
+	uint8_t flags, index, bus, offset, len, i;
+	uint16_t address;
+
+	flags = *data++;
+	index = *data++;
+	bus = *data++;
+	address = *((uint16_t *) data);
+	data += 2;
+	offset = *data++;
+	len = *data++;
+
+	printf("\t\tSend I2C: Flags %02x, Index %02x, Bus %02x, Address %04x, Offset %02x, Length %u, Data",
+	       flags, index, bus, address, offset, len);
+	for (i = 0; i < len; i++)
+		printf(" %02x", *data++);
+	printf("\n");
+
+	return data;
+}
+
 typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data);
 
 static const fn_mipi_elem_dump dump_elem[] = {
 	[MIPI_SEQ_ELEM_SEND_PKT] = mipi_dump_send_packet,
 	[MIPI_SEQ_ELEM_DELAY] = mipi_dump_delay,
 	[MIPI_SEQ_ELEM_GPIO] = mipi_dump_gpio,
+	[MIPI_SEQ_ELEM_I2C] = mipi_dump_i2c,
 };
 
 static const char * const seq_name[] = {
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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