From 6089affe90a01c08ffda92ea4947aab743123b03 Mon Sep 17 00:00:00 2001 From: Shadul Shaikh Date: Thu, 16 Jul 2015 20:04:53 +0530 Subject: [PATCH] gpio: Defined number of instances macro if not defined This patch adds definition of macro XPAR_XGPIO_NUM_INSTANCES, controls config table parameters with macro XPAR_XGPIO_NUM_INSTANCES. These changes are to avoid compilation errors in Subsystem driver if Subsystem HIP is not included gpio as subcore, results gpio driver not in BSP. Signed-off-by: Shadul Shaikh Acked-by: Srikanth Vemula --- XilinxProcessorIPLib/drivers/gpio/src/xgpio_g.c | 7 ++++++- XilinxProcessorIPLib/drivers/gpio/src/xgpio_sinit.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/XilinxProcessorIPLib/drivers/gpio/src/xgpio_g.c b/XilinxProcessorIPLib/drivers/gpio/src/xgpio_g.c index 4cc5caa1..17afaeb3 100644 --- a/XilinxProcessorIPLib/drivers/gpio/src/xgpio_g.c +++ b/XilinxProcessorIPLib/drivers/gpio/src/xgpio_g.c @@ -47,6 +47,8 @@ * 1.00a rmm 02/04/02 First release * 2.00a jhl 12/16/02 Update for dual channel and interrupt support * 2.11a mta 03/21/07 Updated to new coding style +* 4.0 sha 07/15/15 Added XPAR_XGPIO_NUM_INSTANCES macro to control +* config table parameters. * * ******************************************************************************/ @@ -76,9 +78,12 @@ */ XGpio_Config XGpio_ConfigTable[] = { { +#ifdef XPAR_XGPIO_NUM_INSTANCES XPAR_GPIO_0_DEVICE_ID, XPAR_GPIO_0_BASEADDR, XPAR_GPIO_0_INTERRUPT_PRESENT, - XPAR_GPIO_0_IS_DUAL} + XPAR_GPIO_0_IS_DUAL +#endif + } }; /** @} */ diff --git a/XilinxProcessorIPLib/drivers/gpio/src/xgpio_sinit.c b/XilinxProcessorIPLib/drivers/gpio/src/xgpio_sinit.c index 2a1fd4fa..b0cfde86 100644 --- a/XilinxProcessorIPLib/drivers/gpio/src/xgpio_sinit.c +++ b/XilinxProcessorIPLib/drivers/gpio/src/xgpio_sinit.c @@ -49,6 +49,8 @@ * ----- ---- -------- ----------------------------------------------- * 2.01a jvb 10/13/05 First release * 2.11a mta 03/21/07 Updated to new coding style +* 4.0 sha 07/15/15 Defined macro XPAR_XGPIO_NUM_INSTANCES if not +* defined in xparameters.h * * *****************************************************************************/ @@ -61,6 +63,10 @@ /************************** Constant Definitions ****************************/ +#ifndef XPAR_XGPIO_NUM_INSTANCES +#define XPAR_XGPIO_NUM_INSTANCES 0 +#endif + /**************************** Type Definitions ******************************/ /***************** Macros (Inline Functions) Definitions ********************/