Mian Yousaf Kaukab | b1b2261 | 2010-05-01 21:46:35 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2009 STMicroelectronics |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 |
| 6 | * as published by the Free Software Foundation. |
| 7 | */ |
| 8 | #ifndef __INC_DBG_H |
| 9 | #define __INC_DBG_H |
| 10 | |
| 11 | /* Store a submitter ID, unique for each HCL. */ |
| 12 | |
| 13 | struct driver_debug_st { |
| 14 | int mtd; |
| 15 | int gpio; |
| 16 | int mmc; |
| 17 | int ssp; |
| 18 | int mtu; |
| 19 | int msp; |
| 20 | int spi; |
| 21 | int touch; |
| 22 | int dma; |
| 23 | int rtc; |
| 24 | int acodec; |
| 25 | int tourg; |
| 26 | int alsa; |
| 27 | int keypad; |
| 28 | int mcde; |
| 29 | int power; |
| 30 | int i2c; |
| 31 | int hsi; |
| 32 | }; |
| 33 | |
| 34 | #define stm_error(format, arg...) printk(KERN_ERR DRIVER_DEBUG_PFX ":ERROR " format "\n" , ## arg) |
| 35 | #define stm_warn(format, arg...) printk(KERN_WARNING DRIVER_DEBUG_PFX ":WARNING " format "\n" , ## arg) |
| 36 | #define stm_info(format, arg...) printk(KERN_INFO DRIVER_DEBUG_PFX ":INFO" format "\n" , ## arg) |
| 37 | |
| 38 | |
| 39 | #define stm_dbg(debug, format, arg...) (!(DRIVER_DEBUG)) ? ({do {} while(0); }) : debug == 1 ? (printk(DRIVER_DBG DRIVER_DEBUG_PFX ": " format "\n" , ## arg)) : ({do {} while (0); }) |
| 40 | |
| 41 | #define stm_dbg2(debug, format, arg...) (!(DRIVER_DEBUG)) ? ({do {} while(0); }) : debug == 2 ? (printk(DRIVER_DBG DRIVER_DEBUG_PFX ": " format "\n" , ## arg)) : ({do {} while (0); }) |
| 42 | |
| 43 | #define stm_dbg3(debug, format, arg...) (!(DRIVER_DEBUG)) ? ({do {} while(0); }) : debug == 3 ? (printk(DRIVER_DBG DRIVER_DEBUG_PFX ": " format "\n" , ## arg)) : ({do {} while (0); }) |
| 44 | |
| 45 | #define stm_dbg4(format, arg...) (DRIVER_DEBUG & 1) ? (printk(DRIVER_DBG DRIVER_DEBUG_PFX ": " format "\n" , ## arg)) : ({do {} while (0); }) |
| 46 | |
| 47 | extern struct driver_debug_st DBG_ST; |
| 48 | #endif |
| 49 | |
| 50 | /* __INC_DBG_H */ |
| 51 | |
| 52 | /* End of file - debug.h */ |