diff options
author | Ken Chang <kenc@nvidia.com> | 2011-08-30 17:59:23 +0800 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2011-09-19 17:18:24 -0700 |
commit | 21cf13c123684153a524cb199d95e20bc5bca883 (patch) | |
tree | 568ae2f851d68b7b4a692f4dedb3ecf21b5fe63f /drivers | |
parent | 4e7b8c8e1a7a43e4d745289fc9f20a11556eca96 (diff) |
video:tegra:dc: fix hdcp hotplug issue
bit WRITE16 of HDMI_NV_PDISP_KEY_CTRL_0 shall be polled until it
reports DONE, which is value 0 to ensure the write is complete.
bug 858744
bug 861719
(cherry picked from commit d37336f3965cd1071afb6b03b979b0409ee480f1)
(reviewed on http://git-master/r/49821)
Change-Id: I7f54615882d46fa6b67a5fdb2a52046b935aa7c3
Reviewed-on: http://git-master/r/52854
Tested-by: Ken Chang <kenc@nvidia.com>
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/dc/nvhdcp.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/video/tegra/dc/nvhdcp.c b/drivers/video/tegra/dc/nvhdcp.c index 16d27cbccbd8..263de07a3da0 100644 --- a/drivers/video/tegra/dc/nvhdcp.c +++ b/drivers/video/tegra/dc/nvhdcp.c @@ -419,7 +419,7 @@ static int wait_hdcp_ctrl(struct tegra_dc_hdmi_data *hdmi, u32 mask, u32 *v) do { ctrl = tegra_hdmi_readl(hdmi, HDMI_NV_PDISP_RG_HDCP_CTRL); - if ((ctrl | (mask))) { + if ((ctrl & mask)) { if (v) *v = ctrl; break; @@ -434,19 +434,18 @@ static int wait_hdcp_ctrl(struct tegra_dc_hdmi_data *hdmi, u32 mask, u32 *v) return 0; } -/* wait for any bits in mask to be set in HDMI_NV_PDISP_KEY_CTRL +/* wait for bits in mask to be set to value in HDMI_NV_PDISP_KEY_CTRL * waits up to 100mS */ -static int wait_key_ctrl(struct tegra_dc_hdmi_data *hdmi, u32 mask) +static int wait_key_ctrl(struct tegra_dc_hdmi_data *hdmi, u32 mask, u32 value) { int retries = 101; u32 ctrl; do { + msleep(1); ctrl = tegra_hdmi_readl(hdmi, HDMI_NV_PDISP_KEY_CTRL); - if ((ctrl | (mask))) + if (((ctrl ^ value) & mask) == 0) break; - if (retries > 1) - msleep(1); } while (--retries); if (!retries) { nvhdcp_err("key ctrl read timeout (mask=0x%x)\n", mask); @@ -666,7 +665,7 @@ static int load_kfuse(struct tegra_dc_hdmi_data *hdmi) tegra_hdmi_writel(hdmi, ctrl | PKEY_REQUEST_RELOAD_TRIGGER | LOCAL_KEYS , HDMI_NV_PDISP_KEY_CTRL); - e = wait_key_ctrl(hdmi, PKEY_LOADED); + e = wait_key_ctrl(hdmi, PKEY_LOADED, PKEY_LOADED); if (e) { nvhdcp_err("key reload timeout\n"); return -EIO; @@ -704,7 +703,7 @@ static int load_kfuse(struct tegra_dc_hdmi_data *hdmi) tegra_hdmi_writel(hdmi, tmp, HDMI_NV_PDISP_KEY_CTRL); /* wait for WRITE16 to complete */ - e = wait_key_ctrl(hdmi, 0x10); /* WRITE16 */ + e = wait_key_ctrl(hdmi, 0x10, 0); /* WRITE16 */ if (e) { nvhdcp_err("key write timeout\n"); return -EIO; |