parse_saa7134.pl: Properly handle I2C transactions
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 3 Oct 2010 03:42:01 +0000 (00:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 3 Oct 2010 03:48:27 +0000 (00:48 -0300)
commit83e82e2977ea875e3c6ef0a5542a939330c3336e
treef03dc55e4d21ef19a13800200866d82ffe48ea53
parenta1f0bde47d0f0e7c95e2a4dea908277556da162e
parse_saa7134.pl: Properly handle I2C transactions

Instead of printing raw register reads/writes for I2C transactions,
use a more high-level print. By default, it will discard intermediate
transactions, like waiting for non-busy status.

A write transaction will look like:

write_i2c(DONE_STOP, START, 0x96)
write_i2c(DONE_WRITE, CONTINUE, 0xff)
write_i2c(DONE_WRITE, CONTINUE, 0x02)
write_i2c(DONE_WRITE, STOP, 0x00)

The better would be to group those operations, into something like:
write_i2c_addr (0x96, "0xff, 0x02, 0x00");
or
write_i2c_addr (0x96, "0xff0200");

But this is not an easy task, especially since it may have some
read operations in-between. So, let's postpone such higher level
grouping to future improvements in the parser ;)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
contrib/saa7134/parse_saa7134.pl