musbfsh_debug.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. * Copyright 2015 Mediatek Inc.
  9. * Marvin Lin <marvin.lin@mediatek.com>
  10. * Arvin Wang <arvin.wang@mediatek.com>
  11. * Vincent Fan <vincent.fan@mediatek.com>
  12. * Bryant Lu <bryant.lu@mediatek.com>
  13. * Yu-Chang Wang <yu-chang.wang@mediatek.com>
  14. * Macpaul Lin <macpaul.lin@mediatek.com>
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License
  18. * version 2 as published by the Free Software Foundation.
  19. *
  20. * This program is distributed in the hope that it will be useful, but
  21. * WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  23. * General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program.
  27. *
  28. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  31. * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  32. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  33. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  34. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  35. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  36. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  37. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. */
  39. #ifndef __MUSBFSH_LINUX_DEBUG_H__
  40. #define __MUSBFSH_LINUX_DEBUG_H__
  41. /* for normal log, very detail, impact performance a lot */
  42. extern int musbfsh_debug;
  43. #define yprintk(facility, format, args...) \
  44. do { \
  45. if (musbfsh_debug) { \
  46. printk(facility "[MUSBFSH] %s %d: " format , \
  47. __func__, __LINE__ , ## args); \
  48. } \
  49. } while (0)
  50. #define INFO(fmt, args...) yprintk(KERN_NOTICE, fmt, ## args)
  51. /* for critical log */
  52. #define zprintk(facility, format, args...) \
  53. printk(facility "[MUSBFSH] %s %d: " \
  54. format, __func__, __LINE__, ## args)
  55. #define WARNING(fmt, args...) zprintk(KERN_WARNING, fmt, ## args)
  56. #define ERR(fmt, args...) zprintk(KERN_ERR, fmt, ## args)
  57. #endif