summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/ddbridge/ddbridge-i2c.c
diff options
context:
space:
mode:
authorDaniel Scheller <d.scheller@gmx.net>2018-06-23 17:36:01 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-30 22:23:12 +0200
commitd96eeee502cc5c75e0ab7d61468a3b906e609e98 (patch)
treeb62b5a362193f9e81effadec6643dc5f747ba91f /drivers/media/pci/ddbridge/ddbridge-i2c.c
parentmedia: ddbridge: evaluate the actual link when setting up the dummy tuner (diff)
downloadlinux-d96eeee502cc5c75e0ab7d61468a3b906e609e98.tar.xz
linux-d96eeee502cc5c75e0ab7d61468a3b906e609e98.zip
media: ddbridge: report I2C bus errors
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>
Diffstat (limited to 'drivers/media/pci/ddbridge/ddbridge-i2c.c')
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-i2c.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-i2c.c b/drivers/media/pci/ddbridge/ddbridge-i2c.c
index 667340c86ea7..5a28d7611713 100644
--- a/drivers/media/pci/ddbridge/ddbridge-i2c.c
+++ b/drivers/media/pci/ddbridge/ddbridge-i2c.c
@@ -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;
}