// //****************************************************************************** // MStar Software // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. // All software, firmware and related documentation herein ("MStar Software") are // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by // law, including, but not limited to, copyright law and international treaties. // Any use, modification, reproduction, retransmission, or republication of all // or part of MStar Software is expressly prohibited, unless prior written // permission has been granted by MStar. // // By accessing, browsing and/or using MStar Software, you acknowledge that you // have read, understood, and agree, to be bound by below terms ("Terms") and to // comply with all applicable laws and regulations: // // 1. MStar shall retain any and all right, ownership and interest to MStar // Software and any modification/derivatives thereof. // No right, ownership, or interest to MStar Software and any // modification/derivatives thereof is transferred to you under Terms. // // 2. You understand that MStar Software might include, incorporate or be // supplied together with third party`s software and the use of MStar // Software may require additional licenses from third parties. // Therefore, you hereby agree it is your sole responsibility to separately // obtain any and all third party right and license necessary for your use of // such third party`s software. // // 3. MStar Software and any modification/derivatives thereof shall be deemed as // MStar`s confidential information and you agree to keep MStar`s // confidential information in strictest confidence and not disclose to any // third party. // // 4. MStar Software is provided on an "AS IS" basis without warranties of any // kind. Any warranties are hereby expressly disclaimed by MStar, including // without limitation, any warranties of merchantability, non-infringement of // intellectual property rights, fitness for a particular purpose, error free // and in conformity with any international standard. You agree to waive any // claim against MStar for any loss, damage, cost or expense that you may // incur related to your use of MStar Software. // In no event shall MStar be liable for any direct, indirect, incidental or // consequential damages, including without limitation, lost of profit or // revenues, lost or damage of data, and unauthorized system use. // You agree that this Section 4 shall still apply without being affected // even if MStar Software has been modified by MStar in accordance with your // request or instruction for your use, except otherwise agreed by both // parties in writing. // // 5. If requested, MStar may from time to time provide technical supports or // services in relation with MStar Software to you for your use of // MStar Software in conjunction with your or your customer`s product // ("Services"). // You understand and agree that, except otherwise agreed by both parties in // writing, Services are provided on an "AS IS" basis and the warranty // disclaimer set forth in Section 4 above shall apply. // // 6. Nothing contained herein shall be construed as by implication, estoppels // or otherwise: // (a) conferring any license or right to use MStar name, trademark, service // mark, symbol or any other identification; // (b) obligating MStar or any of its affiliates to furnish any person, // including without limitation, you and your customers, any assistance // of any kind whatsoever, or any information; or // (c) conferring any license or right under any intellectual property right. // // 7. These terms shall be governed by and construed in accordance with the laws // of Taiwan, R.O.C., excluding its conflict of law rules. // Any and all dispute arising out hereof or related hereto shall be finally // settled by arbitration referred to the Chinese Arbitration Association, // Taipei in accordance with the ROC Arbitration Law and the Arbitration // Rules of the Association by three (3) arbitrators appointed in accordance // with the said Rules. // The place of arbitration shall be in Taipei, Taiwan and the language shall // be English. // The arbitration award shall be final and binding to both parties. // //****************************************************************************** // /////////////////////////////////////////////////////////////////////////////////////////////////// /// /// @file Mdrv_mhl.h /// @author MStar Semiconductor Inc. /// @brief MHL driver Function /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _DRV_MHL_H_ #define _DRV_MHL_H_ #include "MsCommon.h" #include "mdrv_mhl_st.h" //------------------------------------------------------------------------------------------------- // Macro and Define //------------------------------------------------------------------------------------------------- #ifndef UNUSED #define UNUSED(x) (void)(x) #endif enum MHL_SYSTEM_CONTROL_TYPE { MHL_CABLE_PLUGGED = 0, MHL_CABLE_UNPLUGGED, MHL_INPUT_SOURCE_CHANGE, MHL_CBUS_UNCONNECTION, MHL_CBUS_CONNECTION, MHL_CBUS_NORMAL_24BIT_MODE, MHL_CBUS_PACKET_PIXEL_MODE, MHL_CBUS_AUTO_EQ_SETTING, MHL_CBUS_WAKE_UP_DETECT, MHL_CBUS_TEST_RASING, MHL_CBUS_TEST_FALLING, }; enum MHL_CABLE_DETECT_TYPE { MHL_CABLE_DETECT_PORTA_FLAG = 0x01, MHL_CABLE_DETECT_PORTB_FLAG = 0x02, MHL_CABLE_DETECT_PORTC_FLAG = 0x04, MHL_CABLE_DETECT_PORTD_FLAG = 0x08, }; enum MHL_ECBUS_STATUS_TYPE { MHL_CBUS_TX_QUEUE_FREEZE_FLAG = BIT(0), }; #define MHL_UTOPIA_VERSION_10 1 #define MHL_UTOPIA_VERSION_20 2 #define MHL_USE_UTOPIA_VERSION MHL_UTOPIA_VERSION_20 //------------------------------------------------------------------------------------------------- // Type and Structure //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- // Function Prototype //------------------------------------------------------------------------------------------------- #if(MHL_USE_UTOPIA_VERSION == MHL_UTOPIA_VERSION_10) MS_U32 mdrv_mhl_STREventProc(EN_POWER_MODE usPowerState); void mdrv_mhl_MHLSupportPath(MS_U8 ucSelect); void mdrv_mhl_Initial(MS_U8 *edid, MS_U8 *DevCap); MS_U16 mdrv_mhl_Handler(void); MS_BOOL mdrv_mhl_AutoSwitchHandler(MS_BOOL bReset, MS_U8 *ucCbusPath); MS_U32 mdrv_mhl_SetPowerState(EN_POWER_MODE usPowerState); void mdrv_mhl_CbusControl(MS_U8 ucState); void mdrv_mhl_LoadEDID(MS_U8 *edid); void mdrv_mhl_ReadEDID(MS_U16 usSize, MS_U8 *edid); void mdrv_mhl_LoadDeviceCapability(MS_U8 *devcap); void mdrv_mhl_SetVenderID(MS_U8 ucVenderID); void mdrv_mhl_InvertCableDetect(MS_BOOL bCableDetectInvert); void mdrv_mhl_VbusConfigSetting(MS_U8 ucState); void mdrv_mhl_AdjustSettingIControl(MS_U8 ucIControl); void mdrv_mhl_AdjustImpedanceSetting(MS_U8 ucImpedance); MS_BOOL mdrv_mhl_GetCableDetectFlag(void); MS_BOOL mdrv_mhl_GetCbusConnectFlag(void); MS_BOOL mdrv_mhl_CbusWakeupIntFlag(void); MS_BOOL mdrv_mhl_SrcRCPSupportFlag(void); MS_BOOL mdrv_mhl_SrcRAPSupportFlag(void); MS_BOOL mdrv_mhl_CbusGetStatusFlag(MS_U8 ucState); MS_BOOL mdrv_mhl_SendRAPCommand(MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendRCPAutoReleaseCmd(MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendUCPCommand(MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendWriteBurst(MS_U8 ucAddr, MS_U8 ucLength, MS_U8 *ucData); MS_BOOL mdrv_mhl_CbusSendUserWriteBurst(MS_U8 ucLength, MS_U8 *ucData); MS_BOOL mdrv_mhl_GetDeviceCapability(MS_U16 usDevcapMask, MS_U8 *ucDevcap); MS_BOOL mdrv_mhl_GetExtendDeviceCapability(MS_U16 usExtendDevcapMask, MS_U8 *ucExtendDevcap); MS_BOOL mdrv_mhl_GetDeviceVenderID(MS_U8 *ucVenderID); MS_BOOL mdrv_mhl_GetWriteBurstData(MS_U8 *ucData); void mdrv_mhl_RegisterCallBackFunctions(MS_BOOL bRCPfunctionFlag, MS_BOOL bRAPfunctionFlag); void mdrv_mhl_RegisterRcpCallBackFunction(MS_BOOL bRCPfunctionFlag); void mdrv_mhl_RegisterRapCallBackFunction(MS_BOOL bRAPfunctionFlag); void mdrv_mhl_RegisterUcpCallBackFunction(MS_BOOL bUCPfunctionFlag); void mdrv_mhl_RegisterAttCallBackFunction(MS_BOOL bATTfunctionFlag); void mdrv_mhl_RegisterRbpCallBackFunction(MS_BOOL bRBPfunctionFlag); stMHL_INITIAL_CONFIG_INFO mdrv_mhl_GetConfiguration(void); #elif(MHL_USE_UTOPIA_VERSION == MHL_UTOPIA_VERSION_20) MS_U32 mdrv_mhl_STREventProc(void* pModule, EN_POWER_MODE usPowerState); void mdrv_mhl_MHLSupportPath(void* pInstance, MS_U8 ucSelect); void mdrv_mhl_Initial(void* pInstance, MS_U8 *edid, MS_U8 *DevCap); MS_U16 mdrv_mhl_Handler(void* pInstance); MS_BOOL mdrv_mhl_AutoSwitchHandler(void* pInstance, MS_BOOL bReset, MS_U8 *ucCbusPath); MS_U32 mdrv_mhl_SetPowerState(void* pInstance, EN_POWER_MODE usPowerState); void mdrv_mhl_CbusControl(void* pInstance, MS_U8 ucState); void mdrv_mhl_LoadEDID(void* pInstance, MS_U8 *edid); void mdrv_mhl_ReadEDID(void* pInstance, MS_U16 usSize, MS_U8 *edid); void mdrv_mhl_LoadDeviceCapability(void* pInstance, MS_U8 *devcap); void mdrv_mhl_SetVenderID(void* pInstance, MS_U8 ucVenderID); void mdrv_mhl_InvertCableDetect(void* pInstance, MS_BOOL bCableDetectInvert); void mdrv_mhl_VbusConfigSetting(void* pInstance, MS_U8 ucState); void mdrv_mhl_AdjustSettingIControl(void* pInstance, MS_U8 ucIControl); void mdrv_mhl_AdjustImpedanceSetting(void* pInstance, MS_U8 ucImpedance); MS_BOOL mdrv_mhl_GetCableDetectFlag(void* pInstance); MS_BOOL mdrv_mhl_GetCbusConnectFlag(void* pInstance); MS_BOOL mdrv_mhl_CbusWakeupIntFlag(void* pInstance); MS_BOOL mdrv_mhl_SrcRCPSupportFlag(void* pInstance); MS_BOOL mdrv_mhl_SrcRAPSupportFlag(void* pInstance); MS_BOOL mdrv_mhl_CbusGetStatusFlag(void* pInstance, MS_U8 ucState); MS_BOOL mdrv_mhl_SendRAPCommand(void* pInstance, MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendRCPAutoReleaseCmd(void* pInstance, MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendUCPCommand(void* pInstance, MS_U8 ucKeyCode); MS_BOOL mdrv_mhl_SendWriteBurst(void* pInstance, MS_U8 ucAddr, MS_U8 ucLength, MS_U8 *ucData); MS_BOOL mdrv_mhl_CbusSendUserWriteBurst(void* pInstance, MS_U8 ucLength, MS_U8 *ucData); MS_BOOL mdrv_mhl_GetDeviceCapability(void* pInstance, MS_U16 usDevcapMask, MS_U8 *ucDevcap); MS_BOOL mdrv_mhl_GetExtendDeviceCapability(void* pInstance, MS_U16 usExtendDevcapMask, MS_U8 *ucExtendDevcap); MS_BOOL mdrv_mhl_GetDeviceVenderID(void* pInstance, MS_U8 *ucVenderID); MS_BOOL mdrv_mhl_GetWriteBurstData(void* pInstance, MS_U8 *ucData); void mdrv_mhl_RegisterCallBackFunctions(void* pInstance, MS_BOOL bRCPfunctionFlag, MS_BOOL bRAPfunctionFlag); void mdrv_mhl_RegisterRcpCallBackFunction(void* pInstance, MS_BOOL bRCPfunctionFlag); void mdrv_mhl_RegisterRapCallBackFunction(void* pInstance, MS_BOOL bRAPfunctionFlag); void mdrv_mhl_RegisterUcpCallBackFunction(void* pInstance, MS_BOOL bUCPfunctionFlag); void mdrv_mhl_RegisterAttCallBackFunction(void* pInstance, MS_BOOL bATTfunctionFlag); void mdrv_mhl_RegisterRbpCallBackFunction(void* pInstance, MS_BOOL bRBPfunctionFlag); stMHL_INITIAL_CONFIG_INFO mdrv_mhl_GetConfiguration(void* pInstance); #ifdef CONFIG_UTOPIA_PROC_DBG_SUPPORT void mdrv_mhl_MDCMDEchoCommand(void* pInstance, MS_U64* u64ReqHdl, char* pcCmdLine); void mdrv_mhl_MDCMDGetInfo(void* pInstance, MS_U64* u64ReqHdl); #endif #endif #endif //_MDRV_MHL_H_