diff options
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index f4e4e51..de59a50 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -47,7 +47,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v1.5.13" +#define DRIVER_VERSION "v1.5.14" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -74,7 +74,6 @@ static struct mts_id_eeprom_layout id_eeprom; #define NUM_AP 0 #endif -static uint8_t mts_hw_version; static struct platform_device *mts_io_platform_device; static struct attribute_group *attr_group; static struct attribute_group *attr_group_lora; // on-board lora peripheral to be stored in the lora/ sub-directory @@ -823,7 +822,6 @@ static int mts_id_eeprom_load() int current_blength; // Current length in bytes of attribute array int current_count; // Number of items in array struct attribute **all_attrs = NULL; - mts_hw_version = MTCDT_0_0; //The mts_id_eeprom buffer is initialize once on boot //reloading the mts_io.ko module will not reinitialize this buffer @@ -833,33 +831,36 @@ static int mts_id_eeprom_load() if (mts_id_eeprom[0] == 0xFF) { log_error("uninitialized eeprom"); return -EIO; - } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCAP_0_0, strlen(HW_VERSION_MTCAP_0_0)) == 0) { + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCAP_0_0, strlen(HW_VERSION_MTCAP_0_0)) == 0) { attr_group = &mtcap_0_0_platform_attribute_group; gpio_pins = gpio_pins_mtcap_0_0; if (DEVICE_CAPA(id_eeprom.capa, CAPA_LORA)) { attr_group_lora = &mtcap_0_0_lora_attribute_group; } - mts_hw_version = MTCAP_0_0; log_info("detected board %s", HW_VERSION_MTCAP_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCAP_0_1, strlen(HW_VERSION_MTCAP_0_1)) == 0) + { + attr_group = &mtcap_0_0_platform_attribute_group; + gpio_pins = gpio_pins_mtcap_0_0; + if (DEVICE_CAPA(id_eeprom.capa, CAPA_LORA)) { + attr_group_lora = &mtcap_0_0_lora_attribute_group; + } + log_info("detected board %s", HW_VERSION_MTCAP_0_1); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_0, strlen(HW_VERSION_MTR_0_0)) == 0) { attr_group = &mtr_platform_attribute_group; gpio_pins = gpio_pins_mtr_0_0; - mts_hw_version = MTR_0_0; log_info("detected board %s", HW_VERSION_MTR_0_0); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_1, strlen(HW_VERSION_MTR_0_1)) == 0) { attr_group = &mtr_platform_attribute_group; gpio_pins = gpio_pins_mtr_0_1; - mts_hw_version = MTR_0_1; log_info("detected board %s", HW_VERSION_MTR_0_1); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTRV1_0_0, strlen(HW_VERSION_MTRV1_0_0)) == 0) { attr_group = &mtr_platform_attribute_group; gpio_pins = gpio_pins_mtrv1_0_0; - mts_hw_version = MTRV1_0_0; log_info("detected board %s", HW_VERSION_MTRV1_0_0); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTRV1_0_1, strlen(HW_VERSION_MTRV1_0_1)) == 0) { attr_group = &mtrv1_0_1_platform_attribute_group; gpio_pins = gpio_pins_mtrv1_0_1; - mts_hw_version = MTRV1_0_1; log_info("detected board %s", HW_VERSION_MTRV1_0_1); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCDT_0_1, strlen(HW_VERSION_MTCDT_0_1)) == 0) { attr_blength = sizeof mtcdt_0_1_platform_attributes; @@ -889,12 +890,10 @@ static int mts_id_eeprom_load() attr_group = &mtcdt_0_1_platform_attribute_group; gpio_pins = gpio_pins_mtcdt_0_1; - mts_hw_version = MTCDT_0_1; log_info("detected board %s", HW_VERSION_MTCDT_0_1); } else { attr_group = &mtcdt_platform_attribute_group; gpio_pins = gpio_pins_mtcdt_0_0; - mts_hw_version = MTCDT_0_0; log_info("detected board %s", HW_VERSION_MTCDT_0_0); } |