00001 /* $Id: */ 00002 /****************************************************************************** 00003 -- (c) Copyright 2008 - 2011 Xilinx, Inc. All rights reserved. 00004 -- 00005 -- This file contains confidential and proprietary information 00006 -- of Xilinx, Inc. and is protected under U.S. and 00007 -- international copyright and other intellectual property 00008 -- laws. 00009 -- 00010 -- DISCLAIMER 00011 -- This disclaimer is not a license and does not grant any 00012 -- rights to the materials distributed herewith. Except as 00013 -- otherwise provided in a valid license issued to you by 00014 -- Xilinx, and to the maximum extent permitted by applicable 00015 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND 00016 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES 00017 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING 00018 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- 00019 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and 00020 -- (2) Xilinx shall not be liable (whether in contract or tort, 00021 -- including negligence, or under any other theory of 00022 -- liability) for any loss or damage of any kind or nature 00023 -- related to, arising under or in connection with these 00024 -- materials, including for any direct, or any indirect, 00025 -- special, incidental, or consequential loss or damage 00026 -- (including loss of data, profits, goodwill, or any type of 00027 -- loss or damage suffered as a result of any action brought 00028 -- by a third party) even if such damage or loss was 00029 -- reasonably foreseeable or Xilinx had been advised of the 00030 -- possibility of the same. 00031 -- 00032 -- CRITICAL APPLICATIONS 00033 -- Xilinx products are not designed or intended to be fail- 00034 -- safe, or for use in any application requiring fail-safe 00035 -- performance, such as life-support or safety devices or 00036 -- systems, Class III medical devices, nuclear facilities, 00037 -- applications related to the deployment of airbags, or any 00038 -- other applications that could lead to death, personal 00039 -- injury, or severe property or environmental damage 00040 -- (individually and collectively, "Critical 00041 -- Applications"). Customer assumes the sole risk and 00042 -- liability of any use of Xilinx products in Critical 00043 -- Applications, subject only to applicable laws and 00044 -- regulations governing limitations on product liability. 00045 -- 00046 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS 00047 -- PART OF THIS FILE AT ALL TIMES. 00048 ******************************************************************************/ 00049 /*****************************************************************************/ 00050 /** 00051 * 00052 * @file xvtc_sinit.c 00053 * 00054 * This file contains static initialization methods for Xilinx MVI VTC 00055 * device driver. 00056 * 00057 * <pre> 00058 * MODIFICATION HISTORY: 00059 * 00060 * Ver Who Date Changes 00061 * ----- ---- -------- ----------------------------------------------- 00062 * 1.00a xd 08/05/08 First release 00063 * 1.01a xd 07/23/10 Added GIER; Added more h/w generic info into 00064 * xparameters.h; Feed callbacks with pending 00065 * interrupt info. Added Doxygen & Version support 00066 * </pre> 00067 * 00068 ******************************************************************************/ 00069 00070 /***************************** Include Files *********************************/ 00071 00072 #include "xvtc.h" 00073 #include "xparameters.h" 00074 00075 /************************** Constant Definitions *****************************/ 00076 00077 00078 /**************************** Type Definitions *******************************/ 00079 00080 00081 /***************** Macros (Inline Functions) Definitions *********************/ 00082 00083 00084 /************************** Function Prototypes ******************************/ 00085 00086 /*****************************************************************************/ 00087 /** 00088 * XVtc_LookupConfig returns a reference to an XVtc_Config structure 00089 * based on the unique device id, <i>DeviceId</i>. The return value will refer 00090 * to an entry in the device configuration table defined in the xvtc_g.c 00091 * file. 00092 * 00093 * @param DeviceId is the unique device ID of the device for the lookup 00094 * operation. 00095 * 00096 * @return XVtc_LookupConfig returns a reference to a config record in the 00097 * configuration table (in xvtc_g.c) corresponding to 00098 * <i>DeviceId</i>, or NULL if no match is found. 00099 * 00100 ******************************************************************************/ 00101 XVtc_Config *XVtc_LookupConfig(u16 DeviceId) 00102 { 00103 extern XVtc_Config XVtc_ConfigTable[]; 00104 XVtc_Config *CfgPtr = NULL; 00105 int i; 00106 00107 for (i = 0; i < XPAR_XVTC_NUM_INSTANCES; i++) { 00108 if (XVtc_ConfigTable[i].DeviceId == DeviceId) { 00109 CfgPtr = &XVtc_ConfigTable[i]; 00110 break; 00111 } 00112 } 00113 00114 return CfgPtr; 00115 }