summaryrefslogtreecommitdiff
path: root/io-module/mts_io.h
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2013-02-25 10:53:26 -0600
committerJesse Gilles <jgilles@multitech.com>2013-02-25 10:53:26 -0600
commit179f87cf87c48e82f7e74b747fd9acbf9c1f8d3a (patch)
tree8e6f6a1b5badd7dc8823ad12c7818d1a814240b9 /io-module/mts_io.h
parentcfcc6385560a16628fe45db5389aa2dd8c115421 (diff)
downloadcdp-io-controller-179f87cf87c48e82f7e74b747fd9acbf9c1f8d3a.tar.gz
cdp-io-controller-179f87cf87c48e82f7e74b747fd9acbf9c1f8d3a.tar.bz2
cdp-io-controller-179f87cf87c48e82f7e74b747fd9acbf9c1f8d3a.zip
code cleanup and re-org
Diffstat (limited to 'io-module/mts_io.h')
-rw-r--r--io-module/mts_io.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/io-module/mts_io.h b/io-module/mts_io.h
index eb40276..5f2235c 100644
--- a/io-module/mts_io.h
+++ b/io-module/mts_io.h
@@ -1,4 +1,3 @@
-
#ifndef __MTS_IO_H
#define __MTS_IO_H
@@ -10,6 +9,22 @@
#endif
#endif
+#define MTS_ATTR_MODE_RW S_IWUSR | S_IRUGO
+#define MTS_ATTR_MODE_RO S_IRUGO
+
+#define DEVICE_ATTR_MTS(_dev_name, _name, _show, _store) \
+struct device_attribute _dev_name = { \
+ .attr = { .name = _name, .mode = MTS_ATTR_MODE_RW }, \
+ .show = _show, \
+ .store = _store, \
+}
+
+#define DEVICE_ATTR_RO_MTS(_dev_name, _name, _show) \
+struct device_attribute _dev_name = { \
+ .attr = { .name = _name, .mode = MTS_ATTR_MODE_RO }, \
+ .show = _show, \
+}
+
#define VENDOR_ID_MULTITECH "Multi-Tech Systems"
#define PRODUCT_ID_MTCDP_E1_DK "MTCDP-E1-DK"
#define PRODUCT_ID_MT100EOCG "MT100EOCG"
@@ -55,7 +70,7 @@ do { \
#define CAPA_BLUETOOTH DEVICE_CAPA_VALUE(1, 7)
#define CAPA_WIFI DEVICE_CAPA_VALUE(1, 6)
-
+
struct mts_id_eeprom_layout {
char vendor_id[32];
char product_id[32];
@@ -69,5 +84,27 @@ struct mts_id_eeprom_layout {
uint8_t reserved[302];
};
+// GPIO pin types:input, output, open drain (1 = high Z, 0 = output low)
+enum {
+ GPIO_DIR_INPUT,
+ GPIO_DIR_OUTPUT,
+ GPIO_DIR_OD,
+};
+
+struct gpio_pin {
+ char name[32];
+ char attr_name[32];
+ unsigned pin;
+ int direction;
+ int output_value;
+ int use_pullup;
+};
+
+enum {
+ LED_OFF,
+ LED_ON,
+ LED_FLASHING,
+};
+
#endif /* ~__MTS_IO_H */