summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2011-04-06 13:15:20 -0700
committerErik Gilling <konkers@android.com>2011-04-07 14:29:33 -0700
commit237d326d61bbda05e90dd531d2057efe365db498 (patch)
treeb89dc60f2998a647de62773a0ff5a04e7b1eab9d /drivers
parent6b43b35b10209985e1aad79e800c453fc6477e23 (diff)
video: tegra: use longer retries for hdcp
use 3 seconds for i2c/ddc failures on hdcp (15 attempts at 250mS each) Change-Id: Ia755c9b42d5a0d8467b68c9d334638bcb015eabd Signed-off-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/dc/nvhdcp.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/video/tegra/dc/nvhdcp.c b/drivers/video/tegra/dc/nvhdcp.c
index fe8beb97c38a..2229c6b93ad3 100644
--- a/drivers/video/tegra/dc/nvhdcp.c
+++ b/drivers/video/tegra/dc/nvhdcp.c
@@ -116,6 +116,7 @@ static int nvhdcp_i2c_read(struct tegra_nvhdcp *nvhdcp, u8 reg,
size_t len, void *data)
{
int status;
+ int retries = 15;
struct i2c_msg msg[] = {
{
.addr = 0x74 >> 1, /* primary link */
@@ -131,7 +132,16 @@ static int nvhdcp_i2c_read(struct tegra_nvhdcp *nvhdcp, u8 reg,
},
};
- status = i2c_transfer(nvhdcp->client->adapter, msg, ARRAY_SIZE(msg));
+ do {
+ if (!nvhdcp_is_plugged(nvhdcp)) {
+ nvhdcp_err("disconnect during i2c xfer\n");
+ return -EIO;
+ }
+ status = i2c_transfer(nvhdcp->client->adapter,
+ msg, ARRAY_SIZE(msg));
+ if (retries > 1)
+ msleep(250);
+ } while ((status < 0) && retries--);
if (status < 0) {
nvhdcp_err("i2c xfer error %d\n", status);
@@ -154,11 +164,21 @@ static int nvhdcp_i2c_write(struct tegra_nvhdcp *nvhdcp, u8 reg,
.buf = buf,
},
};
+ int retries = 15;
buf[0] = reg;
memcpy(buf + 1, data, len);
- status = i2c_transfer(nvhdcp->client->adapter, msg, ARRAY_SIZE(msg));
+ do {
+ if (!nvhdcp_is_plugged(nvhdcp)) {
+ nvhdcp_err("disconnect during i2c xfer\n");
+ return -EIO;
+ }
+ status = i2c_transfer(nvhdcp->client->adapter,
+ msg, ARRAY_SIZE(msg));
+ if (retries > 1)
+ msleep(250);
+ } while ((status < 0) && retries--);
if (status < 0) {
nvhdcp_err("i2c xfer error %d\n", status);
@@ -320,16 +340,7 @@ static inline int get_receiver_ri(struct tegra_nvhdcp *nvhdcp, u16 *r)
static int get_bcaps(struct tegra_nvhdcp *nvhdcp, u8 *b_caps)
{
- int e, retries = 4;
- do {
- e = nvhdcp_i2c_read8(nvhdcp, 0x40, b_caps);
- if (!e)
- return 0;
- if (retries > 1)
- msleep(100);
- } while (--retries);
-
- return -EIO;
+ return nvhdcp_i2c_read8(nvhdcp, 0x40, b_caps);
}
static int get_ksvfifo(struct tegra_nvhdcp *nvhdcp,