hv_drv_HdmiRx.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /**
  2. * @file drv_hdmi.h
  3. * @brief HDMI RX driver layer interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use Hv_HDMIRx_DataInit(...) to Init the HDMI RX Data.
  9. * (+) Use Hv_HDMIRx_GetCableConnect(...) to Get the Cable Connection status.
  10. * (+) Use Hv_HDMIRx_RegisterIntCallBack(...) to register the Interrupt Call Back function.
  11. * @endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 0.0.1
  15. * @date 2022-08-22
  16. */
  17. #ifndef __HV_DRV_HDMIRX_H__
  18. #define __HV_DRV_HDMIRX_H__
  19. #include "hv_cal_HdmiRx.h"
  20. #include "hv_cal_HdmiInc.h"
  21. /**
  22. * @brief Initialize the hdmi parameter for the indicated port.
  23. * @param[in] Port Number used for the HDMI RX.
  24. * @return VOID without return.
  25. */
  26. VOID Hv_Drv_HdmiRx_CecInit(UCHAR8 ucPortIndex);
  27. /**
  28. * @brief HPD Control with switch.
  29. * @param[in] Port Index of HDMI and the HPD switch.
  30. * @return 0: Success or 1: Fail.
  31. */
  32. Status Hv_Drv_HdmiRx_HPDCtrol(UCHAR8 ucPortIndex, BOOL bSwitch);
  33. /**
  34. * @brief Initialize the hdmi parameter for the indicated port.
  35. * @param[in] Port Index used for the HDMI RX.
  36. * @return Status with 0: Success, 1: Failure.
  37. */
  38. Status Hv_Drv_HdmiRx_PortInit(UCHAR8 ucPortIndex);
  39. /**
  40. * @brief Get HDMI Rx AVI info.
  41. * @param[in] Port Index of HDMI.
  42. * @return Status of the function and the color parameters.
  43. */
  44. Status Hv_Drv_HdmiRx_GetAVIPara(UCHAR8 ucPortIndex, VideoColorParam *pstVideoAVIPara, VideoTimingParam *pstTimingPara);
  45. /**
  46. * @brief Get HDMI Rx Timing parameters.
  47. * @param[in] Port Index of HDMI
  48. * @return Status of the function and the information of the RX timing.
  49. */
  50. Status Hv_Drv_HdmiRx_GetTimingPara(UCHAR8 ucPortIndex, VideoTimingParam *pstTimingPara);
  51. /**
  52. * @brief frl rate change indicate frl or tmds
  53. * @param[in] ucPortIndex used for the HDMI RX.
  54. * @return FRL Rate 0: TMDS, Others: FRL.
  55. */
  56. UCHAR8 Hv_Drv_HdmiFRLRateChange(UCHAR8 ucPortIndex);
  57. /**
  58. * @brief frl training is in
  59. * @param[in] ucPortIndex used for the HDMI RX.
  60. * @return Status with 0: Success, 1: Failure.
  61. */
  62. Status Hv_Drv_HdmiFRLTraningIn(UCHAR8 ucPortIndex);
  63. /**
  64. * @brief frl training is error
  65. * @param[in] ucPortIndex used for the HDMI RX.
  66. * @return Status with 0: Success, 1: Failure.
  67. */
  68. Status Hv_Drv_HdmiFRLTraningError(UCHAR8 ucPortIndex);
  69. /**
  70. * @brief frl training is done
  71. * @param[in] ucPortIndex used for the HDMI RX.
  72. * @return Status with 0: Success, 1: Failure.
  73. */
  74. Status Hv_Drv_HdmiFRLTraningDone(UCHAR8 ucPortIndex);
  75. /**
  76. * @brief cec recv data
  77. * @param[in] ucPortIndex used for the HDMI RX.
  78. * @return Status with 0: Success, 1: Failure.
  79. */
  80. Status Hv_Drv_HdmiRx_CecRecvData(UCHAR8 ucPortIndex);
  81. /**
  82. * @brief Action for the HDMI Enter the Standby.
  83. * @param[in] Port Index of HDMI.
  84. * @param[in] Status of Enter or Leave the standby.
  85. * @return Status of this Function.
  86. */
  87. Status Hv_Drv_HdmiRx_EnterStandby(UCHAR8 ucPortIndex, BOOL bEnterStandby);
  88. /**
  89. * @brief Send the DDC Message for DDCCI.
  90. * @param[in] Port Index of HDMI.
  91. * @param[in] Data and Length for the DDC to send.
  92. * @return Status of this Function.
  93. */
  94. Status Hv_Drv_HdmiRx_DdcSend(UCHAR8 ucPortIndex, UCHAR8 *data, UINT32 len);
  95. /**
  96. * @brief Get the DDC Message for DDCCI.
  97. * @param[in] Port Index of HDMI.
  98. * @param[Out] Data for the DDC received.
  99. * @return length of the DDC data received.
  100. */
  101. UCHAR8 Hv_Drv_HdmiRx_DdcRecv(UCHAR8 ucPortIndex, UCHAR8 *ucBuf);
  102. /**
  103. * @brief hdmi ratio change need change phy para
  104. * @param[in] ucPortIndex used for the HDMI RX.
  105. * @return Status with 0: Success, 1: Failure.
  106. */
  107. HdmiRxGearMode Hv_Drv_HdmiRx_GetRatioType(UCHAR8 ucPortIndex, HdmiRxGearMode emGearModeCfg);
  108. /**
  109. * @brief hdmi read request change need init reg
  110. * @param[in] ucPortIndex used for the HDMI RX.
  111. * @return Status with 0: Success, 1: Failure.
  112. */
  113. Status Hv_Drv_HdmiRRChange(UCHAR8 ucPortIndex);
  114. /**
  115. * @brief Open or Closed the packet error interrupt.
  116. * @param[in] Port Index of HDMI.
  117. * @return Status of the function.
  118. */
  119. Status Hv_Drv_HdmiRx_SetPacketErrorInt(UCHAR8 ucPortIndex, BOOL bSwitch);
  120. /**
  121. * @brief Send DDCCI Message.
  122. * @param[in] Port Index of HDMI and Data want to send.
  123. * @return Status of the function.
  124. */
  125. Status Hv_Drv_HdmiRxDDCSend(UCHAR8 ucPortIndex, UCHAR8 *data, UCHAR8 len);
  126. /**
  127. * @brief Print the Interrupt Message.
  128. * @param[in] Port Index of HDMI and Data want to send.
  129. * @return Status of the function.
  130. */
  131. UINT32 Hv_Drv_HdmiRx_InterruptEnPrint(UCHAR8 ucPortIndex, UCHAR8 ucIntr);
  132. /**
  133. * @brief Reset SCDC with the 5V Change.
  134. * @param[in] ucPortIndex Port Index of HDMI.
  135. * @return : None.
  136. */
  137. VOID HV_Drv_HdmirRx_ResetScdcWith5V(UCHAR8 ucPortIndex);
  138. /**
  139. * @brief Initialize the hdmi EDID configuration, check if need to close the Register EDID.
  140. * @param[in] Port Number used for the HDMI RX.
  141. * @return VOID without return.
  142. */
  143. Status Hv_Drv_HdmiRx_InitEdidConf(UCHAR8 ucPortIndex);
  144. /**
  145. * @brief Reset The TMDS Pre of Bus and Sw.
  146. * @param[in] Port Number used for the HDMI RX.
  147. * @return Status of the function.
  148. */
  149. Status Hv_Drv_HdmiRx_TmdsPreReset(UCHAR8 ucPortIndex);
  150. /**
  151. * @brief check and restore audio fifo
  152. * @param[in] Port Number used for the HDMI RX.
  153. */
  154. VOID Hv_Drv_HdmiRx_AudioCheck(UCHAR8 ucPortId);
  155. /**
  156. * @brief reload color depth reg
  157. * @param[in] Port Number used for the HDMI RX.
  158. */
  159. VOID Hv_Drv_HdmiRx_ReloadColorDepth(UCHAR8 ucPortIndex);
  160. /**
  161. * @brief Get the Mata Date for the VRR with EMP(0x7F) Packet.
  162. * @param[in] Port Index of HDMI.
  163. * @return VRR parameters on EMP.
  164. */
  165. Status Hv_Drv_HdmiRx_GetMDVrrPara(UCHAR8 ucPortIndex, VRRInfoParam* pstVrrMdPara);
  166. /**
  167. * @brief Get HDMI Rx audio info.
  168. * @param[in] Port Index of HDMI
  169. * @return Status of the function.
  170. */
  171. Status Hv_Drv_HdmiRx_GetAudioPara(UCHAR8 ucPortIndex, AudioPara *pstAudioPara);
  172. /**
  173. * @brief Get HDR data.
  174. * @param[in] Port Index of HDMI
  175. * @return Parameters of HDR send from Source.
  176. */
  177. Status Hv_Drv_HdmiRx_GetHDRPara(UCHAR8 ucPortIndex, HDRParam *pstHDRPara);
  178. /**
  179. * @brief Parse the SPD of AMD.
  180. * @param[in] Port Index of HDMI
  181. * @return HV_SUCCESS or FAILSE.
  182. * @return VRR value from the SPD.
  183. */
  184. Status Hv_Drv_HdmiRx_GetAMDVendSpecInfoPara(UCHAR8 ucPortIndex, VRRInfoParam *pstVendSpecInfoPara);
  185. /**
  186. * @brief HDMI Rx Phy Gear Mode Robust checking.
  187. * @param[in] Port Index of HDMI and gear mode.
  188. * @return HV_TRUE for Ratio mode and HV_TRUE for Normal.
  189. */
  190. BOOL Hv_Drv_HdmiRX_RobustCheckRatioMode(UCHAR8 ucPortIndex);
  191. /**
  192. * @brief Detect HDMI Rx aln lock.
  193. * @param[in] Port Index of HDMI.
  194. * @param[in] Clock Lane Swap ID.
  195. * @return HV_TRUE of HV_FALSE.
  196. */
  197. BOOL Hv_Drv_HdmiRx_IsClockStable(UCHAR8 ucPortIndex);
  198. /**
  199. * @brief Set the EQ with Confgiure Date.
  200. * @param[in] ucPortIndex Port Index of HDMI.
  201. * @param[in] pusSwEqValue The 3Lane Eq Value to be configured
  202. * @return Status of the function.
  203. */
  204. Status Hv_Drv_HdmiRx_SetSwEqValue(UCHAR8 ucPortIndex, const USHORT16 *pusSwEqValue);
  205. /**
  206. * @brief Get the Packet Error Value.
  207. * @param[in] Port Index of HDMI.
  208. * @return Number of the CED Value.
  209. */
  210. Status Hv_Drv_HdmiRx_GetLaneCEDValue(UCHAR8 ucPortIndex, HdmiRxLaneCED *pstLaneCedValue);
  211. /**
  212. * @brief Detect HDMI Timing Statble.
  213. * @param[in] Port Index of HDMI
  214. * @return HV_TRUE of HV_FALSE.
  215. */
  216. BOOL Hv_Drv_HdmiRx_IsTimingStable(UCHAR8 ucPortIndex);
  217. /**
  218. * @brief Action for the Cable plug in or out.
  219. * @param[in] Port Index of HDMI and the cable status.
  220. * @return Status of the function.
  221. */
  222. Status Hv_Drv_HdmiRx_CableConnectAction(UCHAR8 ucPortIndex, BOOL bCableSta);
  223. /**
  224. * @brief HDMI Rx Phy Gear Mode change.
  225. * @param[in] Port Index of HDMI and gear mode.
  226. * @return VOID.
  227. */
  228. VOID Hv_Drv_HdmiRX_SwitchPhyGearMode(UCHAR8 ucPortIndex, HdmiRxGearMode ucGrearMode);
  229. /**
  230. * @brief If the PHY is fast locked.
  231. * @param[in] Port Number used for the HDMI RX.
  232. * @return TRUE is Loced False is unlocked.
  233. */
  234. BOOL Hv_Drv_HdmiRX_IsPhyFastLocked(UCHAR8 ucPortIndex);
  235. /**
  236. * @brief If the PHY TMDS Clock Is OverFlow.
  237. * @param[in] Port Number used for the HDMI RX.
  238. * @return TRUE is OverFlow False is not OverFlow.
  239. */
  240. BOOL Hv_Drv_HdmiRX_IsTMDSClockOverFlow(UCHAR8 ucPortIndex);
  241. Status Hv_Drv_HdmiRx_Hdcp1XInitForAuth(UCHAR8 ucPortIndex);
  242. BOOL Hv_Drv_HdmiRx_CheckTmdsClockAbnormal(UCHAR8 ucPortIndex);
  243. BOOL Hv_Drv_HdmiRx_GetCableStatus(UCHAR8 ucPortIndex);
  244. #endif