#ifndef __MTS_IO_H #define __MTS_IO_H #include "mts_eeprom.h" #include #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 #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" #define PRODUCT_ID_MTR2 "MTR2" #define PRODUCT_ID_MTR "MTR" #define PRODUCT_ID_MTOCGD2 "MTOCGD2" #define PRODUCT_ID_MTOCGD "MTOCGD" #define PRODUCT_ID_MTR2D2 "MTR2D2" #define PRODUCT_ID_MTDC_GPIOB "MTDC-GPIOB" #define PRODUCT_ID_MTAC_MFSER "MTAC-MFSER" #define PRODUCT_ID_MTDC_ETH "MTDC-ETH" #define HW_VERSION_MTCBA2_2_0 "MTCBA2-2.0" #define HW_VERSION_MTCDP_0_0 "MTCDP-0.0" #define HW_VERSION_MTCDP_1_0 "MTCDP-1.0" #define HW_VERSION_MT100EOCG_0_0 "MT100EOCG-0.0" #define HW_VERSION_MTR2_0_0 "MTR2-0.0" #define HW_VERSION_MTR_0_0 "MTR-0.0" #define HW_VERSION_MTR_0_1 "MTR-0.1" #define HW_VERSION_MTOCGD2_0_0 "MTOCGD2-0.0" #define HW_VERSION_MTOCGD_0_0 "MTOCGD-0.0" #define HW_VERSION_MTOCGD_0_1 "MTOCGD-0.1" #define HW_VERSION_MTR2D2_0_0 "MTR2D2-0.0" enum { MTCDP_E1_DK_0_0, MTCDP_E1_DK_1_0, MT100EOCG_0_0, MTR2_0_0, MTR_0_0, MTR_0_1, MTOCGD2_0_0, MTOCGD_0_0, MTOCGD_0_1, MTR2D2_0_0, }; enum { MTDC_NONE, MTDC_GPIOB_0_0, MTAC_MFSER_0_0, }; // 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]; struct gpio pin; int active_low; }; enum { LED_OFF, LED_ON, LED_FLASHING, }; #endif /* ~__MTS_IO_H */