diff options
Diffstat (limited to 'drivers/usb/musb/musb_debug.h')
| -rw-r--r-- | drivers/usb/musb/musb_debug.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h new file mode 100644 index 000000000000..3bdb311e820d --- /dev/null +++ b/drivers/usb/musb/musb_debug.h | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | /* | ||
| 2 | * MUSB OTG driver debug defines | ||
| 3 | * | ||
| 4 | * Copyright 2005 Mentor Graphics Corporation | ||
| 5 | * Copyright (C) 2005-2006 by Texas Instruments | ||
| 6 | * Copyright (C) 2006-2007 Nokia Corporation | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 20 | * 02110-1301 USA | ||
| 21 | * | ||
| 22 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED | ||
| 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
| 25 | * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| 26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 27 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
| 28 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 29 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
| 31 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 32 | * | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef __MUSB_LINUX_DEBUG_H__ | ||
| 36 | #define __MUSB_LINUX_DEBUG_H__ | ||
| 37 | |||
| 38 | #define yprintk(facility, format, args...) \ | ||
| 39 | do { printk(facility "%s %d: " format , \ | ||
| 40 | __func__, __LINE__ , ## args); } while (0) | ||
| 41 | #define WARNING(fmt, args...) yprintk(KERN_WARNING, fmt, ## args) | ||
| 42 | #define INFO(fmt, args...) yprintk(KERN_INFO, fmt, ## args) | ||
| 43 | #define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args) | ||
| 44 | |||
| 45 | #define xprintk(level, facility, format, args...) do { \ | ||
| 46 | if (_dbg_level(level)) { \ | ||
| 47 | printk(facility "%s %d: " format , \ | ||
| 48 | __func__, __LINE__ , ## args); \ | ||
| 49 | } } while (0) | ||
| 50 | |||
| 51 | #if MUSB_DEBUG > 0 | ||
| 52 | extern unsigned debug; | ||
| 53 | #else | ||
| 54 | #define debug 0 | ||
| 55 | #endif | ||
| 56 | |||
| 57 | static inline int _dbg_level(unsigned l) | ||
| 58 | { | ||
| 59 | return debug >= l; | ||
| 60 | } | ||
| 61 | |||
| 62 | #define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) | ||
| 63 | |||
| 64 | extern const char *otg_state_string(struct musb *); | ||
| 65 | |||
| 66 | #endif /* __MUSB_LINUX_DEBUG_H__ */ | ||
