summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mths.c232
-rw-r--r--io-module/mts-io.c6
-rw-r--r--io-module/mts_io_module.h6
3 files changed, 242 insertions, 2 deletions
diff --git a/io-module/mths.c b/io-module/mths.c
index 739a9a0..a51380c 100644
--- a/io-module/mths.c
+++ b/io-module/mths.c
@@ -255,6 +255,237 @@ static struct gpio_pin gpio_pins_mths_0_0[] = {
{ },
};
+/* MTHS-0.1 has no WIFI LED */
+static struct gpio_pin gpio_pins_mths_0_1[] = {
+ {
+ .name = "RADIO_POWER_MONITOR",
+ .pin = {
+ .gpio = AT91_PIN_PA23,
+ .flags = GPIOF_IN,
+ .label = "radio-power-monitor",
+ },
+ .active_low = 0,
+ },
+ {
+ .name = "RADIO_RESET",
+ .pin = {
+ .gpio = AT91_PIN_PA22,
+ .flags = GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN,
+ .label = "radio-reset",
+ },
+ .active_low = 0,
+ },
+ {
+ .name = "RADIO_POWER",
+ .pin = {
+ .gpio = AT91_PIN_PA21,
+ .flags = GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN,
+ .label = "radio-power",
+ },
+ .active_low = 0,
+ },
+ {
+ .name = "DEVICE_RESET",
+ .pin = {
+ .gpio = AT91_PIN_PC4,
+ .flags = GPIOF_IN,
+ .label = "reset",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "WPS_BUTTON",
+ .pin = {
+ .gpio = AT91_PIN_PA13,
+ .flags = GPIOF_IN,
+ .label = "wps_button",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "BT_BUTTON",
+ .pin = {
+ //TODO return back .gpio = AT91_PIN_PC4,
+ .gpio = AT91_PIN_PA12,
+ .flags = GPIOF_IN,
+ .label = "bt_button",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LS_LED",
+ .pin = {
+ .gpio = AT91_PIN_PC16,
+#if LED_LS_CONTROLLABLE
+ .flags = GPIOF_OUT_INIT_HIGH,
+#else
+ .flags = GPIOF_IN,
+#endif
+ .label = "led-ls",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED4",
+ .pin = {
+ .gpio = AT91_PIN_PC20,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-bt",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED4",
+ .pin = {
+ .gpio = AT91_PIN_PC20,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-c",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED5",
+ .pin = {
+ .gpio = AT91_PIN_PC21,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-status",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED5",
+ .pin = {
+ .gpio = AT91_PIN_PC21,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-cd",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED6",
+ .pin = {
+ .gpio = AT91_PIN_PC19,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-sig3",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED6",
+ .pin = {
+ .gpio = AT91_PIN_PC19,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-d",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED7",
+ .pin = {
+ .gpio = AT91_PIN_PC18,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-sig2",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED7",
+ .pin = {
+ .gpio = AT91_PIN_PC18,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-e",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED8",
+ .pin = {
+ .gpio = AT91_PIN_PC17,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-sig1",
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "LED8",
+ .pin = {
+ .gpio = AT91_PIN_PC17,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "led-f",
+ },
+ .active_low = 1,
+ },
+
+ // The difference between MTRv1_0_0 and MTRv1_0_1 starts here
+ {
+ .name = "WIFI_BT_ULPWKUP",
+ .pin = {
+ .gpio = AT91_PIN_PB9,
+ .flags = GPIOF_IN,
+ .label = "wifi-bt-ulpwkup",
+ }
+ },
+ {
+ .name = "WIFI_BT_LPWKUP",
+ .pin = {
+ .gpio = AT91_PIN_PB11,
+ .flags = GPIOF_IN,
+ .label = "wifi-bt-lpwkup",
+ }
+ },
+ {
+ .name = "WIFI_BT_INT",
+ .pin = {
+ .gpio = AT91_PIN_PB13,
+ .flags = GPIOF_IN,
+ .label = "wifi-bt-int",
+ }
+ },
+ {
+ .name = "WIFI_BT_RESET",
+ .pin = {
+ .gpio = AT91_PIN_PB10,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "wifi-bt-reset",
+ }
+ },
+ {
+ .name = "WIFI_BT_LPMODE",
+ .pin = {
+ .gpio = AT91_PIN_PB12,
+ .flags = GPIOF_IN,
+ .label = "wifi-bt-lpmode",
+ }
+ },
+ {
+ .name = "GNSS_RESET",
+ .pin = {
+ .gpio = AT91_PIN_PC6,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "gnss-reset",
+ }
+ },
+ {
+ .name = "USBHUB_RESET",
+ .pin = {
+ .gpio = AT91_PIN_PB6,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "usbhub-reset",
+ }
+ },
+ {
+ .name = "GNSS_INT",
+ .pin = {
+ .gpio = AT91_PIN_PC7,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ .label = "gnss-int",
+ }
+ },
+
+
+ { },
+};
+
button_info_t mths_wps_button = {
.name = "User Push Button WPS",
.label_pin = "wps_button",
@@ -287,6 +518,7 @@ button_info_t mths_bt_button = {
.long_interval = BUTTON_LONG_HOLD_COUNT,
};
+/* MTHS 0.0 and 0.1 have same buttons. */
static button_info_pt mths_buttons_0_0[] = {
&reset_button,
&mths_wps_button,
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index 0ea7e45..5e557fd 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -715,6 +715,12 @@ mts_id_eeprom_load(void)
set_buttons(mths_buttons_0_0);
mts_hw_version = MTHS_0_0;
log_info("detected board %s", HW_VERSION_MTHS_0_0);
+ } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTHS_0_1, strlen(HW_VERSION_MTHS_0_1)) == 0) {
+ attr_group = &mths_0_0_platform_attribute_group;
+ gpio_pins = gpio_pins_mths_0_1;
+ 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)) {
current_blength = attr_blength = sizeof mtcdt_0_1_platform_attributes;
diff --git a/io-module/mts_io_module.h b/io-module/mts_io_module.h
index 3d0240f..41a27e5 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.1.2"
+#define DRIVER_VERSION "v4.1.3"
#define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"
@@ -38,6 +38,7 @@
#define HW_VERSION_MTCAP_0_0 "MTCAP-0.0"
#define HW_VERSION_MTCAP_0_1 "MTCAP-0.1"
#define HW_VERSION_MTHS_0_0 "MTHS-0.0"
+#define HW_VERSION_MTHS_0_1 "MTHS-0.1"
enum {
MTCDP_E1_DK_0_0,
@@ -54,7 +55,8 @@ enum {
MTCDTIPHP_0_0,
MTCAP_0_0,
MTCAP_0_1,
- MTHS_0_0,
+ MTHS_0_0,
+ MTHS_0_1,
};
enum {