XilinxProcessorIPLib/drivers/dp14txss/examples/src/pt_only/tx.c
void DpPt_HpdEventHandler(void *InstancePtr)
{
	if (XDpTxSs_IsConnected(&DpTxSsInst)) {
//		sink_power_down();
		sink_power_up();
		tx_is_reconnected++;
		onetime = 0;
//		usleep(50000);
	}
	else
	{
		tx_done = 0;
		i2s_started = 0;
        xil_printf ("TX Cable Disconnected !!\r\n");
		//DpTxSs_DisableAudio
		XDp_WriteReg(DpTxSsInst.DpPtr->Config.BaseAddr,
			     XDP_TX_AUDIO_CONTROL, 0x0);

		//on HPD d/c, it is important to bring down the HDCP
		tx_is_reconnected = 0;
		DpTxSsInst.no_video_trigger = 1;
#ifndef versal
	    //setting vswing
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH1,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH2,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH3,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH4,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);

	    //setting postcursor
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH1,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH2,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH3,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH4,
			XVPHY_GTHE4_PREEMP_DP_L0);
#endif
	}
}
/*****************************************************************************/
/**
*
* This function takes care HPD event
*
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function takes care HPD event
This function takes care HPD event
void DpPt_HpdEventHandler(void *InstancePtr)
{
	if (XDpTxSs_IsConnected(&DpTxSsInst)) {
		sink_power_up();
		tx_is_reconnected++;
		onetime = 0;
	}
	else
	{
		tx_done = 0;
		i2s_started = 0;
        xil_printf ("TX Cable Disconnected !!\r\n");
		XDp_WriteReg(DpTxSsInst.DpPtr->Config.BaseAddr,
			     XDP_TX_AUDIO_CONTROL, 0x0);
		tx_is_reconnected = 0;
		DpTxSsInst.no_video_trigger = 1;
#ifndef versal
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH1,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH2,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH3,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxVoltageSwing(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH4,
			XVPHY_GTHE4_DIFF_SWING_DP_V0P0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH1,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH2,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH3,
			XVPHY_GTHE4_PREEMP_DP_L0);
	    XVphy_SetTxPostCursor(&VPhyInst, 0, XVPHY_CHANNEL_ID_CH4,
			XVPHY_GTHE4_PREEMP_DP_L0);
#endif
	}
}
void DpPt_HpdEventHandler ( void * InstancePtr ) { if ( XDpTxSs_IsConnected ( & DpTxSsInst ) ) { sink_power_up ( ) ; tx_is_reconnected ++ ; onetime = 0 ; } else { tx_done = 0 ; i2s_started = 0 ; xil_printf ( " \r \n " ) ; XDp_WriteReg ( DpTxSsInst . DpPtr -> Config . BaseAddr , XDP_TX_AUDIO_CONTROL , 0x0 ) ; tx_is_reconnected = 0 ; DpTxSsInst . no_video_trigger = 1 ; #ifndef versal XVphy_SetTxVoltageSwing ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH1 , XVPHY_GTHE4_DIFF_SWING_DP_V0P0 ) ; XVphy_SetTxVoltageSwing ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH2 , XVPHY_GTHE4_DIFF_SWING_DP_V0P0 ) ; XVphy_SetTxVoltageSwing ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH3 , XVPHY_GTHE4_DIFF_SWING_DP_V0P0 ) ; XVphy_SetTxVoltageSwing ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH4 , XVPHY_GTHE4_DIFF_SWING_DP_V0P0 ) ; XVphy_SetTxPostCursor ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH1 , XVPHY_GTHE4_PREEMP_DP_L0 ) ; XVphy_SetTxPostCursor ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH2 , XVPHY_GTHE4_PREEMP_DP_L0 ) ; XVphy_SetTxPostCursor ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH3 , XVPHY_GTHE4_PREEMP_DP_L0 ) ; XVphy_SetTxPostCursor ( & VPhyInst , 0 , XVPHY_CHANNEL_ID_CH4 , XVPHY_GTHE4_PREEMP_DP_L0 ) ; #endif } }
This function takes care HPD event
This function takes care HPD event
//		sink_power_down(); //		usleep(50000); //DpTxSs_DisableAudio //on HPD d/c, it is important to bring down the HDCP //setting vswing //setting postcursor