summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mtcap.c1
-rw-r--r--io-module/mts_io.c21
-rw-r--r--io-module/mts_io.h13
3 files changed, 12 insertions, 23 deletions
diff --git a/io-module/mtcap.c b/io-module/mtcap.c
index 490bee2..f8b7d4b 100644
--- a/io-module/mtcap.c
+++ b/io-module/mtcap.c
@@ -1,3 +1,4 @@
+/* Used for both MTCAP 0.0 and 0.1 */
static struct gpio_pin gpio_pins_mtcap_0_0[] = {
{
.name = "ETH_RESET",
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);
}
diff --git a/io-module/mts_io.h b/io-module/mts_io.h
index 99bfcbb..35bb76e 100644
--- a/io-module/mts_io.h
+++ b/io-module/mts_io.h
@@ -70,19 +70,8 @@ struct device_attribute _dev_name = { \
#define HW_VERSION_MTCDT_0_0 "MTCDT-0.0"
#define HW_VERSION_MTCDT_0_1 "MTCDT-0.1"
#define HW_VERSION_MTCAP_0_0 "MTCAP-0.0"
+#define HW_VERSION_MTCAP_0_1 "MTCAP-0.1"
-enum {
- MTCDP_E1_DK_0_0,
- MTCDP_E1_DK_1_0,
- MT100EOCG_0_0,
- MTR_0_0,
- MTR_0_1,
- MTRV1_0_0,
- MTRV1_0_1,
- MTCDT_0_0,
- MTCDT_0_1,
- MTCAP_0_0,
-};
enum {
MTAC_NONE,