dp: rx: mst: Added MST interrupt handling.
Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
parent
27e918f845
commit
bed16a0aca
2 changed files with 180 additions and 0 deletions
|
@ -842,6 +842,34 @@ typedef struct {
|
|||
passed to the down
|
||||
reply callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrAudioOverHandler; /**< Callback function for audio
|
||||
packet overflow
|
||||
interrupts. */
|
||||
void *IntrAudioOverCallbackRef; /**< A pointer to the user data
|
||||
passed to the audio
|
||||
packet overflow callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrPayloadAllocHandler; /**< Callback function for
|
||||
payload allocation
|
||||
interrupts. */
|
||||
void *IntrPayloadAllocCallbackRef; /**< A pointer to the user data
|
||||
passed to the payload
|
||||
allocation callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrActRxHandler; /**< Callback function for ACT
|
||||
sequence received
|
||||
interrupts. */
|
||||
void *IntrActRxCallbackRef; /**< A pointer to the user data
|
||||
passed to the ACT
|
||||
sequence received
|
||||
callback function. */
|
||||
XDp_IntrHandler IntrCrcTestHandler; /**< Callback function for CRC
|
||||
test start
|
||||
interrupts. */
|
||||
void *IntrCrcTestCallbackRef; /**< A pointer to the user data
|
||||
passed to the CRC test
|
||||
start callback
|
||||
function. */
|
||||
} XDp_Rx;
|
||||
|
||||
/**
|
||||
|
@ -978,6 +1006,14 @@ void XDp_RxSetIntrDownReqHandler(XDp *InstancePtr,
|
|||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrAudioOverHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrPayloadAllocHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrActRxHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrCrcTestHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
|
||||
/* xdp_mst.c: Multi-stream transport (MST) functions for enabling or disabling
|
||||
* MST mode. */
|
||||
|
|
|
@ -648,6 +648,119 @@ void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr,
|
|||
InstancePtr->RxInstance.IntrDownReplyCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when an audio packet overflow
|
||||
* interrupt occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrAudioOverHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrAudioOverHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrAudioOverCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when the RX's DPCD payload
|
||||
* allocation registers have been written for allocation, de-allocation, or
|
||||
* partial deletion.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrPayloadAllocHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrPayloadAllocHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrPayloadAllocCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when an ACT received interrupt
|
||||
* occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrActRxHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrActRxHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrActRxCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when a CRC test start
|
||||
* interrupt occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrCrcTestHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrCrcTestHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrCrcTestCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function is the interrupt handler for the XDp driver operating in TX
|
||||
|
@ -800,4 +913,35 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr)
|
|||
InstancePtr->RxInstance.IntrDownReqHandler(
|
||||
InstancePtr->RxInstance.IntrDownReqCallbackRef);
|
||||
}
|
||||
|
||||
/* The RX has issued a down reply. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_DOWN_REPLY_MASK) {
|
||||
InstancePtr->RxInstance.IntrDownReplyHandler(
|
||||
InstancePtr->RxInstance.IntrDownReplyCallbackRef);
|
||||
}
|
||||
|
||||
/* An audio packet overflow has occurred. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_AUDIO_OVER_MASK) {
|
||||
InstancePtr->RxInstance.IntrAudioOverHandler(
|
||||
InstancePtr->RxInstance.IntrAudioOverCallbackRef);
|
||||
}
|
||||
|
||||
/* The RX's DPCD payload allocation registers have been written for
|
||||
* allocation, de-allocation, or partial deletion. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_PAYLOAD_ALLOC_MASK) {
|
||||
InstancePtr->RxInstance.IntrPayloadAllocHandler(
|
||||
InstancePtr->RxInstance.IntrPayloadAllocCallbackRef);
|
||||
}
|
||||
|
||||
/* The ACT sequence has been received. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_ACT_RX_MASK) {
|
||||
InstancePtr->RxInstance.IntrActRxHandler(
|
||||
InstancePtr->RxInstance.IntrActRxCallbackRef);
|
||||
}
|
||||
|
||||
/* The CRC test has started. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_CRC_TEST_MASK) {
|
||||
InstancePtr->RxInstance.IntrCrcTestHandler(
|
||||
InstancePtr->RxInstance.IntrCrcTestCallbackRef);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue