1 /* 2 * SdioDrvDbg.h 3 * 4 * Copyright (C) 2009 Texas Instruments, Inc. - http://www.ti.com/ 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation version 2. 9 * 10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any 11 * kind, whether express or implied; without even the implied warranty 12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 */ 15 16 #ifndef OMAP3430_SDIODRV_DEBUG_H 17 #define OMAP3430_SDIODRV_DEBUG_H 18 19 #include <linux/kernel.h> 20 21 typedef enum{ 22 SDIO_DEBUGLEVEL_EMERG=1, 23 SDIO_DEBUGLEVEL_ALERT, 24 SDIO_DEBUGLEVEL_CRIT, 25 SDIO_DEBUGLEVEL_ERR=4, 26 SDIO_DEBUGLEVEL_WARNING, 27 SDIO_DEBUGLEVEL_NOTICE, 28 SDIO_DEBUGLEVEL_INFO, 29 SDIO_DEBUGLEVEL_DEBUG=8 30 }sdio_debuglevel; 31 32 extern int g_sdio_debug_level; 33 34 #ifdef SDIO_DEBUG 35 36 #define PERR(format, args... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_ERR) printk(format , ##args) 37 #define PDEBUG(format, args... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_DEBUG) printk(format , ##args) 38 #define PINFO(format, ... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_INFO) printk( format , ##__VA_ARGS__) 39 #define PNOTICE(format, ... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_NOTICE) printk( format , ##__VA_ARGS__) 40 #define PWARNING(format, ... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_WARNING) printk(format , ##__VA_ARGS__) 41 42 #else 43 44 #define PERR(format, args... ) if(g_sdio_debug_level >= SDIO_DEBUGLEVEL_ERR) printk(format , ##args) 45 #define PDEBUG(format, args... ) 46 #define PINFO(format, ... ) 47 #define PNOTICE(format, ... ) 48 #define PWARNING(format, ... ) 49 50 #endif 51 52 /* we want errors reported anyway */ 53 54 #define PERR1 PERR 55 #define PERR2 PERR 56 #define PERR3 PERR 57 58 #endif /* OMAP3430_SDIODRV_DEBUG_H */ 59