| 1 | /**************************************************************************** |
|---|
| 2 | * Copyright (c) 2004 DST Technologies Inc. All Rights Reserved. |
|---|
| 3 | * |
|---|
| 4 | * Module: dsthhalav.h |
|---|
| 5 | * |
|---|
| 6 | * Description: DST HAL AUDIO/VIDEO Interface function definition |
|---|
| 7 | * |
|---|
| 8 | * |
|---|
| 9 | * |
|---|
| 10 | * notes: jfet0525 |
|---|
| 11 | * |
|---|
| 12 | ***************************************************************************/ |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #if !defined (_DSTHAL_SYS_H_) |
|---|
| 16 | #define _DSTHAL_SYS_H_ |
|---|
| 17 | |
|---|
| 18 | #include "dsthallocal.h" |
|---|
| 19 | #include "dsthalcommon.h" |
|---|
| 20 | #include "dstddgpio.h" |
|---|
| 21 | #include "dstversion.h" |
|---|
| 22 | #include "dstoslayer.h" |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | /*Debug level Type*/ |
|---|
| 26 | typedef enum { |
|---|
| 27 | DHL_SYSDBG_DHLSYS, //DHL_SYS |
|---|
| 28 | DHL_SYSDBG_DDSYS, //DD_SYS |
|---|
| 29 | DHL_SYSDBG_END |
|---|
| 30 | }DHL_SYS_DBGTYPE; |
|---|
| 31 | |
|---|
| 32 | typedef enum { |
|---|
| 33 | BOARD_DIV_DDM40 = 0x8001, |
|---|
| 34 | BOARD_DIV_DDM42 |
|---|
| 35 | } BOARD_DIVERSITY; |
|---|
| 36 | |
|---|
| 37 | typedef enum { |
|---|
| 38 | BOARD_R0_1 = 0x1, |
|---|
| 39 | BOARD_R0_2 = 0x2, |
|---|
| 40 | BOARD_R0_3 = 0x3, |
|---|
| 41 | BOARD_R0_4 = 0x4, |
|---|
| 42 | BOARD_R1_0 = 0x8, |
|---|
| 43 | } BOARD_REV_TYPE; |
|---|
| 44 | |
|---|
| 45 | #if defined __cplusplus |
|---|
| 46 | extern "C" { |
|---|
| 47 | #endif |
|---|
| 48 | |
|---|
| 49 | DHL_RESULT DHL_SYS_Initiate(void); |
|---|
| 50 | DHL_RESULT DHL_SYS_Terminate(void); |
|---|
| 51 | void DHL_SYS_SetDbgLvl(DS_U32 uDbgLvl, DHL_SYS_DBGTYPE DbgType); |
|---|
| 52 | DHL_RESULT DHL_SYS_IsDCRBoard( DS_BOOL *flag ); |
|---|
| 53 | DHL_RESULT DHL_SYS_IsSTBYPowerMode( DS_BOOL *flag ); |
|---|
| 54 | DHL_RESULT DHL_SYS_GetBoardVersion(DS_U32 *ver); |
|---|
| 55 | DHL_RESULT DHL_SYS_uPD64012_CheckAlive(void); |
|---|
| 56 | DHL_RESULT DHL_SYS_1394_CheckAlive(void); |
|---|
| 57 | DHL_RESULT DHL_SYS_ADV7400_CheckAlive(void); |
|---|
| 58 | int DHL_SYS_IsR0_5(void); |
|---|
| 59 | |
|---|
| 60 | void DHL_SYS_DumpVersionInfo(void); |
|---|
| 61 | // JFET_20041030 |
|---|
| 62 | // added atidriver_version by jfet. |
|---|
| 63 | // this version managed by DST not ATI.(Dx.xx) |
|---|
| 64 | typedef struct |
|---|
| 65 | { |
|---|
| 66 | char kernel_version[64]; |
|---|
| 67 | DS_U32 dsthal_version; // it managed by DST (Hyy_y) |
|---|
| 68 | DS_U32 driver_dst_version; // it managed by DST (Dxx_x) |
|---|
| 69 | DS_U32 board_version; // be careful. it is char value. not string. |
|---|
| 70 | DS_U32 driver_ven_version; // it managed by Vendor (Mxx_x) |
|---|
| 71 | DS_U32 fe_version; |
|---|
| 72 | //DS_U32 mce_microversion; //mpeg2.mce Micro version |
|---|
| 73 | //DS_U32 mce_fileversion; //mpeg2.mce File version |
|---|
| 74 | DS_U32 loader_version; |
|---|
| 75 | } DHL_SYS_Info, *pDHL_SYS_Info; |
|---|
| 76 | |
|---|
| 77 | typedef struct tag_DHL_SYS_CONFIG |
|---|
| 78 | { |
|---|
| 79 | OS_MUTEX_ID SYSMutex; |
|---|
| 80 | |
|---|
| 81 | } DHL_SYS_CONFIG, *P_DHL_SYS_CONFIG; |
|---|
| 82 | |
|---|
| 83 | void DHL_SYS_GetInfo( pDHL_SYS_Info ); |
|---|
| 84 | void DHL_SYS_DumpVersion(void); |
|---|
| 85 | |
|---|
| 86 | DHL_RESULT DHL_SYS_SetSelfPwr( int selfPwr ); |
|---|
| 87 | DHL_RESULT DHL_SYS_CIMaxCheckAlive(void); |
|---|
| 88 | DHL_RESULT DHL_SYS_Reset(void); |
|---|
| 89 | |
|---|
| 90 | DHL_RESULT DHL_SYS_SetBoardRev(DS_U32 BrdDiv, DS_U32 BrdRev); |
|---|
| 91 | DS_U32 DHL_SYS_GetBoardRev(void); |
|---|
| 92 | DS_U32 DHL_SYS_GetBoardDiv(void); |
|---|
| 93 | |
|---|
| 94 | #if 0 |
|---|
| 95 | void DD_SYS_WaitForDone( char *pidName ); |
|---|
| 96 | #endif |
|---|
| 97 | |
|---|
| 98 | DS_U32 DHL_SYS_GetChipID(void); |
|---|
| 99 | |
|---|
| 100 | /////////////////////////////// |
|---|
| 101 | // GPIO |
|---|
| 102 | /////////////////////////////// |
|---|
| 103 | DHL_RESULT DHL_SYS_SetGPIO( int GpioNum, int Value ); |
|---|
| 104 | int DHL_SYS_GetGPIO( int GpioNum ); |
|---|
| 105 | char *DHL_SYS_GetGPIOName( int GpioNum ); |
|---|
| 106 | int DHL_SYS_FindGPIONum( const char *gpioName ); |
|---|
| 107 | |
|---|
| 108 | /////////////////////////////// |
|---|
| 109 | // I2C |
|---|
| 110 | /////////////////////////////// |
|---|
| 111 | int DHL_SYS_MSPRead(unsigned char subAddr, unsigned int addr,unsigned short length,unsigned char *rbuf); |
|---|
| 112 | int DHL_SYS_MSPWrite(unsigned char WriteAddr,unsigned int addr,unsigned short length,unsigned short data); |
|---|
| 113 | int DHL_SYS_I2cWrite(unsigned char addr, int nSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 114 | int DHL_SYS_I2cRead(unsigned char addr, int nSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 115 | int DHL_SYS_ANXWrite(unsigned char port, unsigned char regAddr, unsigned char val); |
|---|
| 116 | int DHL_SYS_ANXRead(unsigned char port, unsigned char regAddr, unsigned char *buf); |
|---|
| 117 | int DHL_SYS_GetHDMISwMux(void); |
|---|
| 118 | int DHL_SYS_SetHDMISwMux(int mux); |
|---|
| 119 | int DHL_SYS_SetHDMI_EDID_WREn(int onoff); |
|---|
| 120 | int DHL_SYS_GenHDMI_HPD(void); |
|---|
| 121 | DHL_RESULT DHL_SYS_SetI2CSpeed(unsigned char bus, unsigned int speed); |
|---|
| 122 | int DHL_SYS_GetCECSwitchStatus(void); |
|---|
| 123 | int DHL_SYS_I2cWriteEx(int i2cBus, unsigned char addr, int isSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 124 | int DHL_SYS_I2cReadEx(int i2cBus, unsigned char addr, int isSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 125 | int DHL_SYS_I2cWriteAndReadEx(int i2cBus, unsigned char addr, int isSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 126 | DS_U32 DHL_SYS_PrintFreeMem(const char *pfunc, int line); |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | /////////////////////////////// |
|---|
| 130 | // Register |
|---|
| 131 | /////////////////////////////// |
|---|
| 132 | DS_U32 DHL_SYS_ReadRegister( DS_U32 Address ); |
|---|
| 133 | DS_U32 DHL_SYS_WriteRegister( DS_U32 Address, DS_U32 Value ); |
|---|
| 134 | |
|---|
| 135 | /////////////////////////////// |
|---|
| 136 | // USB |
|---|
| 137 | /////////////////////////////// |
|---|
| 138 | DHL_RESULT DHL_SYS_IsUsbValid(void); |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | DHL_RESULT DHL_SYS_IsSystemAlive(DS_U8 *pErrorCode); |
|---|
| 142 | char *DHL_SYS_GetSystemErrorCode(DS_U8 ErrorCode); |
|---|
| 143 | |
|---|
| 144 | DHL_RESULT DHL_SYS_GetSysinfo(DS_U32 *pTotalMem, DS_U32 *pUsedMem, DS_U32 *pFreeMem, DS_U32 *pBuffer, DS_U32 *pCached); |
|---|
| 145 | DS_U32 freeMemory(void); |
|---|
| 146 | int DHL_SYS_I2cWriteAndRead(unsigned char addr, int isSubAddress, int subAddress, unsigned char *buf, int len); |
|---|
| 147 | void DHL_SYS_DumpRegister(DS_U32 Address, DS_U32 cnt); |
|---|
| 148 | void DHL_SYS_DumpMemory(DS_U32 Address, DS_U32 cnt); |
|---|
| 149 | int DHL_SYS_IsANX8775Exist(void); |
|---|
| 150 | |
|---|
| 151 | #if defined __cplusplus |
|---|
| 152 | } |
|---|
| 153 | #endif |
|---|
| 154 | |
|---|
| 155 | #endif /* _DSTHAL_SYS_H_ */ |
|---|
| 156 | |
|---|
| 157 | |
|---|