From 67ea220c39bcd2ce967dc6deacdc2aecb6ee5a3e Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Tue, 5 May 2015 18:25:21 +0800 Subject: [PATCH] HDMI: rk3368/rk3288: If HDCP is enabled in uboot, do not set again. Signed-off-by: Zheng Yang --- .../rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c | 9 ++++++--- .../rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c index 6beeaf1bebde..eaf27b9bb3a5 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c @@ -196,8 +196,9 @@ static void rockchip_hdmiv2_hdcp_start(struct hdmi *hdmi) m_ENCRYPT_DISBALE | m_PH2UPSHFTENC, v_ENCRYPT_DISBALE(0) | v_PH2UPSHFTENC(1)); /* Reset HDCP Engine */ - hdmi_msk_reg(hdmi_dev, A_HDCPCFG1, - m_HDCP_SW_RST, v_HDCP_SW_RST(0)); + if (hdmi_readl(hdmi_dev, MC_CLKDIS) & m_HDCPCLK_DISABLE) + hdmi_msk_reg(hdmi_dev, A_HDCPCFG1, + m_HDCP_SW_RST, v_HDCP_SW_RST(0)); hdmi_writel(hdmi_dev, A_APIINTMSK, 0x00); hdmi_msk_reg(hdmi_dev, A_HDCPCFG0, m_RX_DETECT, v_RX_DETECT(1)); @@ -296,6 +297,7 @@ static DEVICE_ATTR(trytimes, S_IRUGO|S_IWUSR, static int hdcp_init(struct hdmi *hdmi) { int ret; + struct hdmi_dev *hdmi_dev = hdmi->property->priv; mdev.minor = MISC_DYNAMIC_MINOR; mdev.name = "hdcp"; @@ -334,7 +336,8 @@ static int hdcp_init(struct hdmi *hdmi) pr_err("HDCP: request_firmware_nowait failed: %d\n", ret); goto error4; } - + if ((hdmi_readl(hdmi_dev, MC_CLKDIS) & m_HDCPCLK_DISABLE) == 0) + hdcp->enable = 1; hdmi->ops->hdcp_cb = rockchip_hdmiv2_hdcp_start; return 0; diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c index e1ef8a6d9cac..64f67c6a9ac3 100755 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c @@ -1288,9 +1288,9 @@ static int hdmi_dev_config_video(struct hdmi *hdmi, struct hdmi_video *vpara) } hdmi_msk_reg(hdmi_dev, FC_DBGFORCE, m_FC_FORCEVIDEO, v_FC_FORCEVIDEO(1)); + hdmi_writel(hdmi_dev, MC_CLKDIS, m_HDCPCLK_DISABLE); } - hdmi_writel(hdmi_dev, MC_CLKDIS, m_HDCPCLK_DISABLE); if (rockchip_hdmiv2_video_framecomposer(hdmi, vpara) < 0) return -1; @@ -1598,7 +1598,8 @@ static int hdmi_dev_insert(struct hdmi *hdmi) struct hdmi_dev *hdmi_dev = hdmi->property->priv; HDMIDBG("%s\n", __func__); - hdmi_writel(hdmi_dev, MC_CLKDIS, m_HDCPCLK_DISABLE); + if (!hdmi->uboot) + hdmi_writel(hdmi_dev, MC_CLKDIS, m_HDCPCLK_DISABLE); return HDMI_ERROR_SUCESS; } -- 2.34.1