diff options
author | Mike Isely <devnull@localhost> | 2006-01-03 05:48:29 +0000 |
---|---|---|
committer | Mike Isely <devnull@localhost> | 2006-01-03 05:48:29 +0000 |
commit | 82fd6647322e382719712588c0890ad11629d0ff (patch) | |
tree | c373a88ee98ebeb108ac7eeec2634cf070ef74eb /v4l_experimental | |
parent | 4bf90fead1910ce3f8a023a68adda15a0b405e74 (diff) | |
download | mediapointer-dvb-s2-82fd6647322e382719712588c0890ad11629d0ff.tar.gz mediapointer-dvb-s2-82fd6647322e382719712588c0890ad11629d0ff.tar.bz2 |
Implement some (normally disabled) I2C adapter debugging code
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'v4l_experimental')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-i2c-core.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c index 8375ca7af..8f562fab7 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c +++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-core.c,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id: pvrusb2-i2c-core.c,v 1.2 2006/01/03 05:48:29 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -254,6 +254,30 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, } done: + if (debug & PVR2_TRACE_I2C_TRAF) { + unsigned int idx; + for (idx = 0; idx < num; idx++) { + printk(KERN_INFO + "pvrusb2 i2c xfer %u/%u:" + " addr=0x%x len=%d %s%s", + idx+1,num, + msgs[idx].addr, + msgs[idx].len, + (msgs[idx].flags & I2C_M_RD ? + "read" : "write"), + (msgs[idx].flags & I2C_M_NOSTART ? + " nostart" : "")); + if (idx+1 == num) { + printk(" result=%d",ret); + } + printk("\n"); + } + if (!num) { + printk(KERN_INFO + "pvrusb2 i2c xfer null transfer result=%d\n", + ret); + } + } return ret; } |