media: ddbridge: report I2C bus errors
authorDaniel Scheller <d.scheller@gmx.net>
Sat, 23 Jun 2018 15:36:01 +0000 (11:36 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 30 Jul 2018 20:23:12 +0000 (16:23 -0400)
The I2C_COMMAND response reports an error in the I2C bus communication
using bit 17. Evaluate the response more thoroughly and log an error
if an I2C problem was detected.

Picked up from the upstream dddvb GIT.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/pci/ddbridge/ddbridge-i2c.c

index 667340c..5a28d76 100644 (file)
@@ -73,7 +73,10 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
                }
                return -EIO;
        }
-       if (val & 0x70000)
+       val &= 0x70000;
+       if (val == 0x20000)
+               dev_err(dev->dev, "I2C bus error\n");
+       if (val)
                return -EIO;
        return 0;
 }