@@ -80,6 +80,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
if (ret == 0x80 + len - 1) {
return len;
} else if (ret == 0x94 + len - 1) {
+ em28xx_warn("R05 returned 0x%02x: I2C timeout", ret);
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
@@ -123,6 +124,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
if (ret == 0x84 + len - 1) {
break;
} else if (ret == 0x94 + len - 1) {
+ em28xx_warn("R05 returned 0x%02x: I2C timeout", ret);
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
@@ -198,6 +200,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
if (ret == 0) { /* success */
return len;
} else if (ret == 0x10) {
+ em28xx_warn("I2C transfer timeout on writing to addr 0x%02x", addr);
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to read i2c transfer status from bridge (error=%i)\n",
@@ -255,6 +258,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)
}
if (ret > 0) {
if (ret == 0x10) {
+ em28xx_warn("I2C transfer timeout on read from addr 0x%02x", addr);
return -ENODEV;
} else {
em28xx_warn("unknown i2c error (status=%i)\n", ret);
@@ -316,8 +320,10 @@ static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
*/
if (!ret)
return len;
- else if (ret > 0)
+ else if (ret > 0) {
+ em28xx_warn("Bus B R08 returned 0x%02x: I2C timeout", ret);
return -ENODEV;
+ }
return ret;
/*
@@ -367,8 +373,10 @@ static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf,
*/
if (!ret)
return len;
- else if (ret > 0)
+ else if (ret > 0) {
+ em28xx_warn("Bus B R08 returned 0x%02x: I2C timeout", ret);
return -ENODEV;
+ }
return ret;
/*