From 8913efd7020f8e78cbdcbfac68189bdcdb33ce89 Mon Sep 17 00:00:00 2001 From: hjc Date: Wed, 9 Jul 2014 08:59:23 +0800 Subject: [PATCH] rk3036 hdmi: fix HPD status reg change --- .../video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c | 11 +++++++++-- .../video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c b/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c index 7948608899a5..f94a1a02ec3c 100755 --- a/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c +++ b/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c @@ -217,8 +217,12 @@ int rk616_hdmi_read_edid(struct hdmi *hdmi_drv, int block, u8 *buf) disable_irq(hdmi_drv->irq); /* Enable edid interrupt */ +#ifdef SOC_CONFIG_RK3036 + hdmi_writel(hdmi_dev, INTERRUPT_MASK1, m_INT_EDID_READY); +#else hdmi_writel(hdmi_dev, INTERRUPT_MASK1, m_INT_HOTPLUG | m_INT_EDID_READY); +#endif for (trytime = 0; trytime < 10; trytime++) { hdmi_writel(hdmi_dev, INTERRUPT_STATUS1, 0x04); @@ -588,20 +592,22 @@ void rk616_hdmi_work(struct hdmi *hdmi_drv) if(interrupt){ hdmi_writel(hdmi_dev, HDMI_STATUS, interrupt); } + if (interrupt & m_INT_HOTPLUG) #else hdmi_readl(hdmi_dev, INTERRUPT_STATUS1,&interrupt); if(interrupt){ hdmi_writel(hdmi_dev, INTERRUPT_STATUS1, interrupt); } + if (interrupt & m_HOTPLUG) #endif - if (interrupt & m_HOTPLUG) { + { if (hdmi_drv->state == HDMI_SLEEP) hdmi_drv->state = WAIT_HOTPLUG; queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, msecs_to_jiffies(40)); - } + }//plug out? if (hdmi_drv->hdcp_irq_cb) hdmi_drv->hdcp_irq_cb(0); @@ -654,6 +660,7 @@ int rk616_hdmi_initial(struct hdmi *hdmi_drv) rk3028_hdmi_reset_pclk(); rk616_hdmi_reset(hdmi_drv); #elif defined(SOC_CONFIG_RK3036) + rk3028_hdmi_reset_pclk(); rk616_hdmi_reset(hdmi_drv); #else hdmi_drv->set_vif = rk616_hdmi_set_vif; diff --git a/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h b/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h index 83dbce3725e6..1bd7e5d02ff9 100755 --- a/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h +++ b/drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h @@ -2,7 +2,7 @@ #define _RK616_HDMI_HW_H #define SOC_CONFIG_RK3036 - +#include #define RK616_HDMI_BASE 0x400 enum PWR_MODE { NORMAL, @@ -356,12 +356,12 @@ static inline int hdmi_msk_reg(struct rk_hdmi_device *hdmi_dev, u16 offset, writel_relaxed(temp | ((val) & (msk)), hdmi_dev->regbase + (offset) * 0x04); return ret; } -#if defined(CONFIG_ARCH_RK3026) +#if defined(CONFIG_ARCH_RK3026) || defined(SOC_CONFIG_RK3036) static inline void rk3028_hdmi_reset_pclk(void) { - writel_relaxed(0x00010001, RK2928_CRU_BASE + 0x128); + writel_relaxed(0x00010001, RK_CRU_VIRT+ 0x128); msleep(100); - writel_relaxed(0x00010000, RK2928_CRU_BASE + 0x128); + writel_relaxed(0x00010000, RK_CRU_VIRT + 0x128); } #endif #endif -- 2.34.1