summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index 8ec637e5e..2f7946195 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -56,7 +56,7 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
"Killing an I2C write to %u that is too large"
" (desired=%u limit=%u)",
i2c_addr,
- length,(sizeof(hdw->cmd_buffer) - 3));
+ length,(unsigned int)(sizeof(hdw->cmd_buffer) - 3));
return -ENOTSUPP;
}
@@ -88,7 +88,7 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
}
}
#if 0
- trace_i2c("i2c_write(%d) len=%d ret=%d stat=%d",i2c_addr,length,ret,
+ trace_i2c("i2c_write(0x%x) len=%d ret=%d stat=%d",i2c_addr,length,ret,
hdw->cmd_buffer[0]);
#endif
@@ -146,7 +146,7 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */
}
#if 0
- trace_i2c("i2c_read(%d) wlen=%d rlen=%d ret=%d stat=%d",
+ trace_i2c("i2c_read(0x%x) wlen=%d rlen=%d ret=%d stat=%d",
i2c_addr,dlen,rlen,ret,hdw->cmd_buffer[0]);
#endif
/* Copy back the result */
@@ -296,7 +296,7 @@ static int pvr2_i2c_control(struct i2c_adapter *adapter,
static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
{
- return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
+ return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C | I2C_FUNC_SMBUS_BYTE_DATA;
}
static int pvr2_i2c_core_singleton(struct i2c_client *cp,
@@ -322,15 +322,26 @@ static int pvr2_i2c_core_singleton(struct i2c_client *cp,
int pvr2_i2c_client_cmd(struct pvr2_i2c_client *cp,unsigned int cmd,void *arg)
{
+ int stat;
if (pvrusb2_debug & PVR2_TRACE_I2C_CMD) {
char buf[100];
unsigned int cnt;
cnt = pvr2_i2c_client_describe(cp,PVR2_I2C_DETAIL_DEBUG,
buf,sizeof(buf));
pvr2_trace(PVR2_TRACE_I2C_CMD,
- "i2c COMMAND to %.*s",cnt,buf);
+ "i2c COMMAND (code=%u 0x%x) to %.*s",
+ cmd,cmd,cnt,buf);
}
- return pvr2_i2c_core_singleton(cp->client,cmd,arg);
+ stat = pvr2_i2c_core_singleton(cp->client,cmd,arg);
+ if (pvrusb2_debug & PVR2_TRACE_I2C_CMD) {
+ char buf[100];
+ unsigned int cnt;
+ cnt = pvr2_i2c_client_describe(cp,PVR2_I2C_DETAIL_DEBUG,
+ buf,sizeof(buf));
+ pvr2_trace(PVR2_TRACE_I2C_CMD,
+ "i2c COMMAND to %.*s (ret=%d)",cnt,buf,stat);
+ }
+ return stat;
}
int pvr2_i2c_core_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg)