diff options
author | Mike Isely <isely@pobox.com> | 2006-03-29 02:00:23 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-03-29 02:00:23 -0600 |
commit | 896235d467ecdcaecf352dae6d1970fdda4caeec (patch) | |
tree | 0c4224272afa9695e9be4867263fc643cc1e73c5 /linux | |
parent | 0d7fd3cdc85eb7e7e64a735ee7242aad047f4d64 (diff) | |
download | mediapointer-dvb-s2-896235d467ecdcaecf352dae6d1970fdda4caeec.tar.gz mediapointer-dvb-s2-896235d467ecdcaecf352dae6d1970fdda4caeec.tar.bz2 |
Enhance I2C debugging in pvrusb2
From: Mike Isely <isely@pobox.com>
Enhance I2C debugging in pvrusb2 such that I2C data is printed when
transactions are reported.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index 2f7946195..9a96273f2 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -262,18 +262,29 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, done: if (pvrusb2_debug & PVR2_TRACE_I2C_TRAF) { - unsigned int idx; + unsigned int idx,offs,cnt; for (idx = 0; idx < num; idx++) { + cnt = msgs[idx].len; printk(KERN_INFO "pvrusb2 i2c xfer %u/%u:" " addr=0x%x len=%d %s%s", idx+1,num, msgs[idx].addr, - msgs[idx].len, + cnt, (msgs[idx].flags & I2C_M_RD ? "read" : "write"), (msgs[idx].flags & I2C_M_NOSTART ? " nostart" : "")); + if ((ret > 0) || !(msgs[idx].flags & I2C_M_RD)) { + if (cnt > 8) cnt = 8; + printk(" ["); + for (offs = 0; offs < (cnt>8?8:cnt); offs++) { + if (offs) printk(" "); + printk("%02x",msgs[idx].buf[offs]); + } + if (offs < cnt) printk(" ..."); + printk("]"); + } if (idx+1 == num) { printk(" result=%d",ret); } |