+config SUPPORT_HDCP
+ bool "HDCP support"
+ depends on HDMI_CAT66121
+ default n
+ help
+ HDCP Interface. This adds the High Definition Content Protection Interface.
+ See http://www.digital-cp.com/ for HDCP specification.
+
hdmitx_sys.o \
hdmitx_hdcp.o \
hdmitx_input.o \
- hdmitx_drv.o
+ hdmitx_drv.o \
+ sha1.o
hdmi->hdcp_irq_cb(0);
}
#ifndef HDMI_USE_IRQ
- queue_delayed_work(cat66121_hdmi->workqueue, &cat66121_hdmi->delay_work, 50);
+ queue_delayed_work(cat66121_hdmi->workqueue, &cat66121_hdmi->delay_work, 100);
#endif
}
}
rc = -ENXIO;
goto err_request_lcdc;
}
+ if(cat66121_detect_device()!=1){
+ dev_err(hdmi->dev, "can't find it6610 device \n");
+ rc = -ENXIO;
+ goto err_request_lcdc;
+ }
+
hdmi->xscale = 100;
hdmi->yscale = 100;
hdmi->insert = cat66121_hdmi_sys_insert;
extern struct cat66121_hdmi_pdata *cat66121_hdmi;
+extern int cat66121_detect_device(void);
extern int cat66121_hdmi_sys_init(void);
extern void cat66121_hdmi_interrupt(void);
extern int cat66121_hdmi_sys_detect_hpd(void);
}
return HDMITX_WriteI2C_Byte(Reg,Temp);
}
+
+int cat66121_detect_device(void)
+{
+ uint8_t VendorID0, VendorID1, DeviceID0, DeviceID1;
+
+ Switch_HDMITX_Bank(0);
+ VendorID0 = HDMITX_ReadI2C_Byte(REG_TX_VENDOR_ID0);
+ VendorID1 = HDMITX_ReadI2C_Byte(REG_TX_VENDOR_ID1);
+ DeviceID0 = HDMITX_ReadI2C_Byte(REG_TX_DEVICE_ID0);
+ DeviceID1 = HDMITX_ReadI2C_Byte(REG_TX_DEVICE_ID1);
+ if( (VendorID0 == 0x54) && (VendorID1 == 0x49) &&
+ (DeviceID0 == 0x12) && (DeviceID1 == 0x16) )
+ return 1;
+
+ printk("CAT66121: Reg[0-3] = 0x[%02x].[%02x].[%02x].[%02x]\n",
+ VendorID0, VendorID1, DeviceID0, DeviceID1);
+ printk("[CAT66121] Device not found!\n");
+
+ return 0;
+}
int cat66121_hdmi_sys_init(void)
{
hdmi_dbg(hdmi->dev, "[%s]\n", __FUNCTION__);
void cat66121_hdmi_interrupt()
{
- char interrupt = 0;
-
- hdmi_dbg(hdmi->dev, "[%s]\n", __FUNCTION__);
- if(hdmi->state == HDMI_SLEEP)
- hdmi->state = WAIT_HOTPLUG;
- queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));
+ if(HDMITX_DevLoopProc()){
+ if(hdmi->state == HDMI_SLEEP)
+ hdmi->state = WAIT_HOTPLUG;
+ queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));
+ }
}
int cat66121_hdmi_sys_detect_hpd(void)
{
- char hdmi_status = 0;
- hdmi_dbg(hdmi->dev, "[%s]\n", __FUNCTION__);
- // BYTE sysstat;
+ char HPD= 0;
+ BYTE sysstat;
+ sysstat = HDMITX_ReadI2C_Byte(REG_TX_SYS_STATUS);
- //sysstat = HDMITX_ReadI2C_Byte(REG_SYS_STATUS) ;
- //*hpdstatus = ((sysstat & B_HPDETECT) == B_HPDETECT)?TRUE:FALSE ;
- hdmi_status = HDMITX_DevLoopProc();
- if(hdmi_status)
+ HPD = ((sysstat & B_TX_HPDETECT) == B_TX_HPDETECT)?TRUE:FALSE;
+ if(HPD)
return HDMI_HPD_ACTIVED;
else
return HDMI_HPD_REMOVED;
******************************/
int cat66121_detect_device(void)
{
- printk(">>>%s \n",__func__);
+ uint8_t VendorID0, VendorID1, DeviceID0, DeviceID1;
+
+ Switch_HDMITX_Bank(0);
+ VendorID0 = HDMITX_ReadI2C_Byte(REG_VENDOR_ID0);
+ VendorID1 = HDMITX_ReadI2C_Byte(REG_VENDOR_ID1);
+ DeviceID0 = HDMITX_ReadI2C_Byte(REG_DEVICE_ID0);
+ DeviceID1 = HDMITX_ReadI2C_Byte(REG_DEVICE_ID1);
+ ErrorF("CAT66121: Reg[0-3] = 0x[%02x].[%02x].[%02x].[%02x]\n",
+ VendorID0, VendorID1, DeviceID0, DeviceID1);
+ if( (VendorID0 == 0x54) && (VendorID1 == 0x49) &&
+ (DeviceID0 == 0x12) && (DeviceID1 == 0x06) )
+ return 1;
+
+ printk("[CAT66121] Device not found!\n");
+
return 0;
}
//******************************************/
#ifndef _CONFIG_H_
#define _CONFIG_H_
-#pragma message("config.h")
+//#pragma message("config.h")
#ifdef EXTERN_HDCPROM
#pragma message("Defined EXTERN_HDCPROM")
#endif // EXTERN_HDCPROM
#define SUPPORT_EDID
-//#define SUPPORT_HDCP
-//#define SUPPORT_SHA
//#define SUPPORT_AUDIO_MONITOR
#define AudioOutDelayCnt 250
+#ifdef CONFIG_SUPPORT_HDCP
+#define SUPPORT_HDCP
+#define SUPPORT_SHA
+#endif
//////////////////////////////////////////////////////////////////////////////////////////
//******************************************/\r
#ifndef _DEBUG_H_\r
#define _DEBUG_H_\r
-#define Debug_message 0\r
-\r
-#pragma message("debug.h")\r
\r
-#ifndef Debug_message\r
+#ifdef CONFIG_RK_HDMI_DEBUG\r
#define Debug_message 1\r
+#else\r
+#define Debug_message 0\r
#endif\r
\r
+//#pragma message("debug.h")\r
+\r
#if Debug_message\r
\r
#define HDMITX_DEBUG_PRINTF(x) printk x\r
{0x05, 0xC0, 0x40},\r
{REG_TX_INT_MASK1, 0xFF, ~(B_TX_RXSEN_MASK|B_TX_HPD_MASK)},\r
{REG_TX_INT_MASK2, 0xFF, ~(B_TX_KSVLISTCHK_MASK|B_TX_AUTH_DONE_MASK|B_TX_AUTH_FAIL_MASK)},\r
- {REG_TX_INT_MASK3, 0xFF, ~(B_TX_VIDSTABLE_MASK)},\r
+ {REG_TX_INT_MASK3, 0xFF, ~(0x0)},\r
{0x0C, 0xFF, 0xFF},\r
{0x0D, 0xFF, 0xFF},\r
{0x0E, 0x03, 0x03},\r
}\r
#endif // SUPPORT_HDCP\r
\r
- /*\r
+#if 1\r
intdata3 = HDMITX_ReadI2C_Byte(REG_TX_INT_STAT3);\r
+ HDMITX_DEBUG_PRINTF(("INT_Handler: reg%X = %X\n",(int)REG_TX_INT_STAT3,(int)intdata3));\r
if(intdata3 & B_TX_INT_VIDSTABLE)\r
{\r
sysstat = HDMITX_ReadI2C_Byte(REG_TX_SYS_STATUS);\r
hdmitx_FireAFE();\r
}\r
}\r
- */\r
+#endif\r
intdata3= HDMITX_ReadI2C_Byte(0xEE);\r
if( intdata3 )\r
{\r
HDMITX_WriteI2C_Byte(0xEE,intdata3); // clear ext interrupt ;\r
HDMITX_DEBUG_PRINTF(("%s%s%s%s%s%s%s\n",\r
- (intdata3&0x40)?"video parameter change ":"",\r
- (intdata3&0x20)?"HDCP Pj check done ":"",\r
- (intdata3&0x10)?"HDCP Ri check done ":"",\r
- (intdata3&0x8)? "DDC bus hang ":"",\r
- (intdata3&0x4)? "Video input FIFO auto reset ":"",\r
- (intdata3&0x2)? "No audio input interrupt ":"",\r
- (intdata3&0x1)? "Audio decode error interrupt ":""));\r
+ (intdata3&0x40)?"video parameter change \n":"",\r
+ (intdata3&0x20)?"HDCP Pj check done \n":"",\r
+ (intdata3&0x10)?"HDCP Ri check done \n":"",\r
+ (intdata3&0x8)? "DDC bus hang \n":"",\r
+ (intdata3&0x4)? "Video input FIFO auto reset \n":"",\r
+ (intdata3&0x2)? "No audio input interrupt \n":"",\r
+ (intdata3&0x1)? "Audio decode error interrupt \n":""));\r
}\r
HDMITX_WriteI2C_Byte(REG_TX_INT_CLR0,0xFF);\r
HDMITX_WriteI2C_Byte(REG_TX_INT_CLR1,0xFF);\r
//******************************************/\r
#include "hdmitx.h"\r
#include "hdmitx_drv.h"\r
+#include "sha1.h"\r
\r
static BYTE countbit(BYTE b);\r
\r
{\r
if(ER_FAIL == hdmitx_hdcp_Authenticate())\r
{\r
- //printf("ER_FAIL == hdmitx_hdcp_Authenticate\n");\r
+ printk("ER_FAIL == hdmitx_hdcp_Authenticate\n");\r
hdmitx_hdcp_ResetAuth();\r
return FALSE ;\r
}\r
+ HDCP_DEBUG_PRINTF(("hdmitx_hdcp_Authenticate SUCCESS\n"));\r
}\r
else\r
{\r
}\r
}\r
*/\r
- //SHA_Simple(SHABuff,n,V);\r
+ SHA_Simple(SHABuff,n,V);\r
for(i = 0 ; i < 20 ; i++)\r
{\r
if(V[i] != Vr[i])\r
if( RxCapability.ValidHDMI )\r
{\r
bHDMIMode = TRUE ;\r
-\r
+ bAudioEnable = TRUE ;\r
+#if 0\r
if(RxCapability.VideoMode & (1<<6))\r
{\r
bAudioEnable = TRUE ;\r
}\r
+#endif\r
if( RxCapability.VideoMode & (1<<5))\r
{\r
bOutputColorMode &= ~F_MODE_CLRMOD_MASK ;\r
}\r
\r
DevLoopCount ++ ;\r
- return HPDStatus;\r
+ return HPDChangeStatus;\r
}\r
\r
#ifdef HDMITX_AUTO_MONITOR_INPUT\r
\r
EDID_Buf = CommunBuff;\r
RxCapability.ValidCEA = FALSE ;\r
- RxCapability.ValidHDMI = FALSE ;\r
+ RxCapability.ValidHDMI = TRUE;\r
RxCapability.dc.uc = 0;\r
\r
getHDMITX_EDIDBlock(0, EDID_Buf);\r
+#if Debug_message\r
+ for( j = 0 ; j < 128 ; j++ )\r
+ {\r
+ EDID_DEBUG_PRINTF(("%02X%c",(int)EDID_Buf[j],(7 == (j&7))?'\n':' '));\r
+ }\r
+#endif // Debug_message\r
\r
for( i = 0, CheckSum = 0 ; i < 128 ; i++ )\r
{\r
// @fileversion: COMMON_FILE_1.01\r
//******************************************/\r
\r
-#include <stdio.h>\r
-//#include <stdlib.h>\r
#include "sha1.h"\r
\r
\r
#ifndef _SHA_1_H_\r
#define _SHA_1_H_\r
\r
-#ifdef _MCU_8051_\r
- #include "Mcu.h"\r
-#endif\r
-\r
-#include <string.h>\r
-\r
-#if Debug_message\r
- #include <stdio.h>\r
-#endif\r
-\r
#include "config.h"\r
#include "typedef.h"\r
\r