From 6f5f0b82433c6a9a0e737617e87cad9675ad4cb4 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 0d80b3863432..0bfd5e3b0c66 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hdcp.c @@ -142,8 +142,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)); @@ -239,6 +240,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"; @@ -277,7 +279,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 b35c424c2d77..b076d38118a0 100644 --- 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; @@ -1586,7 +1586,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