From 9764247dc57036e1d1c73b2f69411906504a8288 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 21 Dec 2015 16:50:47 +0200 Subject: [PATCH] intel_bios_reader: add dumping of i2c element in mipi sequence 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 --- 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 7c3e1bca..b31f648f 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[] = {