From ec36a3c6efe4d753c0d6a336aeba24765f9c6979 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 31 Dec 2008 01:45:35 -0200 Subject: parse_em28xx.pl: Add a limited capability of parsing i2c commands From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l2-apps/util/parse_em28xx.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'v4l2-apps') diff --git a/v4l2-apps/util/parse_em28xx.pl b/v4l2-apps/util/parse_em28xx.pl index d1bbb0f0d..3f5cda6da 100755 --- a/v4l2-apps/util/parse_em28xx.pl +++ b/v4l2-apps/util/parse_em28xx.pl @@ -62,7 +62,7 @@ # This way, it is easier to understand what the em28xx driver is doing. # # Known limitations: -# - Currently, the tool only parses em28xx, ac97 and em202 registers. +# - Currently, the tool only parses em28xx, i2c, ac97 and em202 registers. # - It is limited to read/write operations with 1 or 2 bytes of # arguments; # - Not all registers are documented; @@ -275,4 +275,11 @@ while (<>) { $reg, $3, $2; next; } + + if (m/40 02 00 00 ([0-9a-f].) 00 ([0-9a-f].) 00\s+[\>]+\s+([0-9a-f ]+)/) { + printf "i2c_master_send(0x$1>>1, { $3 }, 0x$2);\n"; + } + if (m/c0 02 00 00 ([0-9a-f].) 00 ([0-9a-f].) 00\s+[\>]+\s+([0-9a-f ]+)/) { + printf "i2c_master_recv(0x$1>>1, &buf, 0x$2); /* $3 */\n"; + } } -- cgit v1.2.3