diff options
| author | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
| commit | 8e4bff4cab0ddac6060645b0715210484d02ff40 (patch) | |
| tree | 3a5c3024371a04692a3a6d9974d001cdff8ebf84 /include/linux/rtdefs.h | |
Diffstat (limited to 'include/linux/rtdefs.h')
| -rw-r--r-- | include/linux/rtdefs.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/include/linux/rtdefs.h b/include/linux/rtdefs.h new file mode 100644 index 00000000..cc8802d6 --- /dev/null +++ b/include/linux/rtdefs.h @@ -0,0 +1,81 @@ +/* + * include/linux/rtdefs.h + * + * Richtek driver common definitions + * + * Copyright (C) 2013 Richtek Technology Corp. + * Author: Patrick Chang <patrick_chang@richtek.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + */ + +#ifndef RTDEFS_H +#define RTDEFS_H +#include <linux/kernel.h> + +#ifndef RTDBGLEVEL +#define RTDBGLEVEL 3 +#endif + +#define RTDBGINFO_LEVEL 3 +#define RTDBGWARN_LEVEL 2 +#define RTDBGERR_LEVEL 1 +#define RTDBGFPRN_LEVEL 0 + + +#if RTDBGINFO_LEVEL<=RTDBGLEVEL +#define RTINFO(format, args...) \ + printk(KERN_INFO "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#define RTINFO_IF(cond, format, args...) \ + if (cond) \ +printk(KERN_INFO "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#else +#define RTINFO(format, args...) +#define RTINFO_IF(cond, format, args...) +#endif + +#if RTDBGWARN_LEVEL<=RTDBGLEVEL +#define RTWARN(format, args...) \ + printk(KERN_WARNING "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#define RTWARN_IF(cond, format, args...) \ + if (cond) \ +printk(KERN_WARNING "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#else +#define RTWARN(format, args...) +#define RTWARN_IF(cond, format, args...) +#endif + +#if RTDBGERR_LEVEL<=RTDBGLEVEL +#define RTERR(format, args...) \ + printk(KERN_ERR "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#define RTERR_IF(cond, format, args...) \ + if (cond) printk(KERN_ERR "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#else +#define RTERR(format, args...) +#define RTERR_IF(cond, format, args...) +#endif + +#if RTDBGFPRN_LEVEL<=RTDBGLEVEL +#define RTPRN(format, args...) \ + printk(KERN_DEBUG "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#define RTPRN_IF(cond, format, args...) \ + if (cond) printk(KERN_DEBUG "%s:%s() line-%d: " format, \ + ALIAS_NAME, __FUNCTION__, __LINE__, ## args) +#else +#define RTPRN(format, args...) +#define RTPRN_IF(cond, format, args...) +#endif + + + +#endif // RTDEFS_H |
