summaryrefslogtreecommitdiff
path: root/io-module/mts_io.h
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2014-05-16 16:43:44 -0500
committerJesse Gilles <jgilles@multitech.com>2014-05-16 16:43:44 -0500
commit9cf9a09c665ecfb6425a08e424b01c8cacbdb660 (patch)
tree4ca4e88e9e53076086610846e863c505e0d48674 /io-module/mts_io.h
parentfb0cddc68ee95d61cd2af4889b18bf3d6ddd01d2 (diff)
downloadmts-io-9cf9a09c665ecfb6425a08e424b01c8cacbdb660.tar.gz
mts-io-9cf9a09c665ecfb6425a08e424b01c8cacbdb660.tar.bz2
mts-io-9cf9a09c665ecfb6425a08e424b01c8cacbdb660.zip
Major changes to split sources up
* moved common peripheral i/o functions to separate source files * moved device-specific setup to separate source files * removed LED blink functionality (unused) * mtcdp, mt100eocg are not supported, but code is included for possible future use
Diffstat (limited to 'io-module/mts_io.h')
-rw-r--r--io-module/mts_io.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/io-module/mts_io.h b/io-module/mts_io.h
index ad82b2a..0842f25 100644
--- a/io-module/mts_io.h
+++ b/io-module/mts_io.h
@@ -4,6 +4,25 @@
#include "mts_eeprom.h"
#include <linux/gpio.h>
+#define DEBUG 0
+
+#define __log(level, name, format, args...) \
+ printk(level "[" name "] " DRIVER_NAME ":%s:%d: " format "\n" , \
+ __func__ , __LINE__ , ## args)
+
+#define log_emerg(format, args...) __log(KERN_EMERG, "EMERG", format , ## args)
+#define log_alert(format, args...) __log(KERN_ALERT, "ALERT", format , ## args)
+#define log_crit(format, args...) __log(KERN_CRIT, "CRIT", format , ## args)
+#define log_error(format, args...) __log(KERN_ERR, "ERROR", format , ## args)
+#define log_warning(format, args...) __log(KERN_WARNING, "WARNING", format , ## args)
+#define log_notice(format, args...) __log(KERN_NOTICE, "NOTICE", format , ## args)
+#define log_info(format, args...) __log(KERN_INFO, "INFO", format , ## args)
+#if DEBUG
+# define log_debug(format, args...) __log(KERN_DEBUG, "DEBUG", format , ## args)
+#else
+# define log_debug(format, args...) do {} while (0)
+#endif
+
#define MTS_ATTR_MODE_RW S_IWUSR | S_IRUGO
#define MTS_ATTR_MODE_RO S_IRUGO