From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- include/linux/rtdefs.h | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 include/linux/rtdefs.h (limited to 'include/linux/rtdefs.h') 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 + * + * 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 + +#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 -- cgit v1.3.1