summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
Diffstat (limited to 'io-module')
-rw-r--r--io-module/mts-io.c25
-rw-r--r--io-module/mts_io_module.h7
2 files changed, 18 insertions, 14 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index 09f0eef..3df4732 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -684,8 +684,8 @@ mts_id_eeprom_load(void)
return -ENODEV;
}
- // If we are an MTCPM, the base board sets the radio existance.
- if (strncmp(id_eeprom.hw_version,HW_VERSION_MTCPM_DASH,sizeof HW_VERSION_MTCPM_DASH) != 0) {
+ // If we are an MTCPM-0.0, the base board sets the radio existance.
+ if (strncmp(id_eeprom.hw_version,HW_VERSION_MTCPM_0_0,sizeof HW_VERSION_MTCPM_0_0) != 0) {
if (id_eeprom.eeprom_layout_version == 0) {
noradio = ! mts_has_radio(id_eeprom.product_id,sizeof id_eeprom.product_id);
log_debug("mts_id_eeprom_load: noradio=%d",noradio);
@@ -696,10 +696,10 @@ mts_id_eeprom_load(void)
}
}
- if (((tmp=HW_VERSION_MTCAP_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
- ((tmp=HW_VERSION_MTCAP_0_1),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
- ((tmp=HW_VERSION_MTCAP_0_2),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
- ((tmp=HW_VERSION_MTCAP_0_3),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) {
+ if (((tmp=HW_VERSION_MTCAP_0_0),(mts_hw_version=MTCAP_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
+ ((tmp=HW_VERSION_MTCAP_0_1),(mts_hw_version=MTCAP_0_1),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
+ ((tmp=HW_VERSION_MTCAP_0_2),(mts_hw_version=MTCAP_0_2),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
+ ((tmp=HW_VERSION_MTCAP_0_3),(mts_hw_version=MTCAP_0_3),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) {
int need_radio_enable = 0;
current_blength = attr_blength = sizeof mtcap_0_0_platform_attributes;
current_blength -= sizeof(struct attribute *); /* Length without terminating NULL */
@@ -819,8 +819,8 @@ mts_id_eeprom_load(void)
set_buttons(mths_buttons_0_0); /* Only one button version */
mts_hw_version = MTHS_0_1;
log_info("detected board %s", HW_VERSION_MTHS_0_1);
- } else if (((tmp=HW_VERSION_MTCDT_0_1),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
- ((tmp=HW_VERSION_MTCDTIP_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) {
+ } else if (((tmp=HW_VERSION_MTCDT_0_1),(mts_hw_version=MTCDT_0_1),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
+ ((tmp=HW_VERSION_MTCDTIP_0_0),(mts_hw_version=MTCDTIP_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) {
current_blength = attr_blength = sizeof mtcdt_0_1_platform_attributes;
current_blength -= sizeof(struct attribute *); /* Length without terminating NULL */
@@ -918,6 +918,7 @@ mts_id_eeprom_load(void)
attr_group_lora = &mtcdtiphp_0_0_lora_attribute_group;
}
set_buttons(default_buttons);
+ mts_hw_version = MTCDTIPHP_0_0;
log_info("detected board %s", tmp);
} else if ((tmp=HW_VERSION_MTCDT_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) {
if(noradio) {
@@ -941,13 +942,12 @@ mts_id_eeprom_load(void)
mts_hw_version = MTCDT_0_0;
set_buttons(default_buttons);
log_info("detected board %s", tmp);
-
- } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCPM_0_0, strlen(HW_VERSION_MTCPM_0_0)) == 0) {
+ } else if (((tmp=HW_VERSION_MTCPM_0_0),(mts_hw_version=MTCPM_0_0),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) ||
+ ((tmp=HW_VERSION_MTCPM_0_1),(mts_hw_version=MTCPM_0_1),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) {
attr_group = &mtcpm_platform_attribute_group;
gpio_pins = gpio_pins_mtcpm;
set_buttons(default_buttons);
- mts_hw_version = MTCPM_0_0;
- log_info("detected board %s", HW_VERSION_MTCPM_0_0);
+ log_info("detected board %s", tmp);
} else if (strncmp(id_eeprom.product_id, PRODUCT_ID_MT100EOCG, strlen(PRODUCT_ID_MT100EOCG)) == 0) {
attr_group = &mt100eocg_platform_attribute_group;
gpio_pins = gpio_pins_mt100eocg_0_0;
@@ -957,6 +957,7 @@ mts_id_eeprom_load(void)
} else {
int i;
+ mts_hw_version = MTHWUNKNOWN;
for(i=0;i<sizeof id_eeprom.hw_version;i++) {
if(! id_eeprom.hw_version[i])
/* Found NULL so done */
diff --git a/io-module/mts_io_module.h b/io-module/mts_io_module.h
index 6863150..29b6e81 100644
--- a/io-module/mts_io_module.h
+++ b/io-module/mts_io_module.h
@@ -5,7 +5,7 @@
* MTAC cards.
*/
-#define DRIVER_VERSION "v4.4.2"
+#define DRIVER_VERSION "v4.4.3"
#define DRIVER_AUTHOR "Multitech Systems"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"
@@ -47,8 +47,10 @@
#define HW_VERSION_MTCPM_DASH "MTCPM-"
#define HW_VERSION_MTCPM_0_0 "MTCPM-0.0"
+#define HW_VERSION_MTCPM_0_0 "MTCPM-0.1"
enum {
+ MTHWUNKNOWN,
MTCDP_E1_DK_0_0,
MTCDP_E1_DK_1_0,
MT100EOCG_0_0,
@@ -65,7 +67,8 @@ enum {
MTCAP_0_1,
MTHS_0_0,
MTHS_0_1,
- MTCPM_0_0,
+ MTCPM_0_0,
+ MTCPM_0_1,
};
enum {