From 0a72981dcd67013fe515af8f00e863ba049bb00f Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Fri, 9 Jan 2015 14:52:23 -0800 Subject: [PATCH] dp: Allow differentiate between XDptx and XDprx structures from a void *. The XDp_Config structure is moved to the top of the instance structure for XDptx. The XDprx structure, once implemented, will keep the XDp_Config structure as the first member. This allows functions to accept a void * argument and determine whether the pointed structure is of type XDptx or XDprx by accessing the XDp_Config member's IsRx member. The reason this works is because XDp_Config is the first member in the structure's order so the configuration structure will be placed in the same relative location for both the XDptx and XDprx structures. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dp/src/xdptx.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdptx.h b/XilinxProcessorIPLib/drivers/dp/src/xdptx.h index bc6d0030..cd1a8530 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdptx.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdptx.h @@ -517,6 +517,11 @@ typedef void (*XDptx_HpdPulseHandler)(void *InstancePtr); * this type is then passed to the driver API functions. */ typedef struct { + XDp_Config Config; /**< Configuration structure for + the DisplayPort TX + core. It is important to + keep this member first + in the XDptx order. */ u32 MstEnable; /**< Multi-stream transport (MST) mode. Enables functionality, allowing @@ -528,9 +533,6 @@ typedef struct { u8 TrainAdaptive; /**< Downshift lane count and link rate if necessary during training. */ - XDp_Config Config; /**< Configuration structure for - the DisplayPort TX - core. */ XDptx_SinkConfig RxConfig; /**< Configuration structure for the RX device. */ XDptx_LinkConfig LinkConfig; /**< Configuration structure for