1. io mux ddc channel to GPIO mode when suspend, and mux again when resume.
2. fix ddc clock frequency error when hdcp is enabled.
*/
static void hdcp_irq_cb(int interrupt)
{
+ int value;
DBG("%s 0x%x", __FUNCTION__, interrupt);
if(interrupt & m_INT_HDCP_ERR)
{
+ value = HDMIRdReg(HDCP_ERROR);
+ HDMIWrReg(HDCP_ERROR, value);
+ printk(KERN_INFO "HDCP: Error 0x%02x\n", value);
+
if( (hdcp->hdcp_state != HDCP_DISABLED) &&
(hdcp->hdcp_state != HDCP_ENABLE_PENDING) )
{
HDMIWrReg(HDCP_TIMER_5S, 0x2c);
break;
}
-
-
+ // Config DDC Clock
+ temp = (hdmi->tmdsclk/HDCP_DDC_CLK)/4;
+ HDMIWrReg(DDC_BUS_FREQ_L, temp & 0xFF);
+ HDMIWrReg(DDC_BUS_FREQ_H, (temp >> 8) & 0xFF);
// Enable HDCP Interrupt
HDMIWrReg(INTR_MASK2, m_INT_HDCP_ERR | m_INT_BKSV_RPRDY | m_INT_BKSV_RCRDY | m_INT_AUTH_DONE | m_INT_AUTH_READY);
// Start HDCP
#define HDCP_PRIVATE_KEY_SIZE 280
#define HDCP_KEY_SHA_SIZE 20
+#define HDCP_DDC_CLK 100000
struct hdcp_keys{
u8 KSV[8];
wait_for_completion_interruptible_timeout(&hdmi->complete,\r
msecs_to_jiffies(5000));\r
flush_delayed_work(&hdmi->delay_work);\r
+ // When HDMI 1.1V and 2.5V power off, DDC channel will be pull down, current is produced\r
+ // from VCC_IO which is pull up outside soc. We need to switch DDC IO to GPIO.\r
+ rk30_mux_api_set(GPIO0A2_HDMII2CSDA_NAME, GPIO0A_GPIO0A2);\r
+ rk30_mux_api_set(GPIO0A1_HDMII2CSCL_NAME, GPIO0A_GPIO0A1);\r
return;\r
}\r
\r
{\r
hdmi_dbg(hdmi->dev, "hdmi exit early resume\n");\r
mutex_lock(&hdmi->enable_mutex);\r
+ \r
+ rk30_mux_api_set(GPIO0A2_HDMII2CSDA_NAME, GPIO0A_HDMI_I2C_SDA);\r
+ rk30_mux_api_set(GPIO0A1_HDMII2CSCL_NAME, GPIO0A_HDMI_I2C_SCL);\r
+ \r
hdmi->suspend = 0;\r
rk30_hdmi_initial();\r
if(hdmi->enable) {\r
int display; // HDMI display status
int xscale; // x direction scale value
int yscale; // y directoon scale value
-
+ int tmdsclk; // TDMS Clock frequency
// call back for hdcp operatoion
void (*hdcp_cb)(void);
void (*hdcp_irq_cb)(int);
spin_lock_irqsave(&hdmi->irq_lock, flags);
edid_result = 0;
spin_unlock_irqrestore(&hdmi->irq_lock, flags);
- //Before Phy parameter was set, DDC_CLK is equal to PLLA freq which is 24MHz.
+ //Before Phy parameter was set, DDC_CLK is equal to PLLA freq which is 30MHz.
//Set DDC I2C CLK which devided from DDC_CLK to 100KHz.
- ddc_bus_freq = (24000000/HDMI_EDID_DDC_CLK)/4;
+ ddc_bus_freq = (30000000/HDMI_EDID_DDC_CLK)/4;
HDMIWrReg(DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF);
HDMIWrReg(DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF);
hdmi_err(hdmi->dev, "[%s] not found vic %d\n", __FUNCTION__, vpara->vic);
return -ENOENT;
}
+ hdmi->tmdsclk = mode->pixclock;
value = v_EXT_VIDEO_ENABLE(1) | v_INTERLACE(mode->vmode);
if(mode->sync & FB_SYNC_HOR_HIGH_ACT)
value |= v_HSYNC_POLARITY(1);
#define HDCP_KSV_BYTE3 0x308
#define HDCP_KSV_BYTE4 0x30c
+/* HDCP error status */
+#define HDCP_ERROR 0x320
+
/* HDCP 100 ms timer */
#define HDCP_TIMER_100MS 0x324
/* HDCP 5s timer */