summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Godinez <sgodinez@multitech.com>2013-07-17 09:29:25 -0500
committerSean Godinez <sgodinez@multitech.com>2013-07-17 09:29:25 -0500
commit7a6e6d70d77aa2176716f6b3e9b3a81e069a0c14 (patch)
tree8f52a7371e3413f99ff695deff5d26643932e937
parentd5beeadc07864a4bdc970ed76bd4693529039fcd (diff)
parent6a0c178ac7de9488debdb2fcf0c66e11d5e2c3cf (diff)
downloadcdp-io-controller-7a6e6d70d77aa2176716f6b3e9b3a81e069a0c14.tar.gz
cdp-io-controller-7a6e6d70d77aa2176716f6b3e9b3a81e069a0c14.tar.bz2
cdp-io-controller-7a6e6d70d77aa2176716f6b3e9b3a81e069a0c14.zip
Merge branch 'master' of sw.multitech.prv:/usr/local/git/jjg/cdp-io-controller
-rw-r--r--io-module/mts_io.c215
-rw-r--r--io-module/mts_io.h2
2 files changed, 214 insertions, 3 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 60ab232..ba9996f 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -42,7 +42,7 @@
#include "mts_io.h"
-#define DRIVER_VERSION "v0.6.2"
+#define DRIVER_VERSION "v0.6.3"
#define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"
@@ -827,6 +827,206 @@ static struct gpio_pin gpio_pins_mtr_0_0[] = {
{ },
};
+static struct gpio_pin gpio_pins_mtr_0_1[] = {
+ {
+ .name = "NETH_RST",
+ .attr_name = "eth0-enabled",
+ .pin = AT91_PIN_PC6,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ },
+ {
+ .name = "3G_RST",
+ .attr_name = "radio-reset",
+ .pin = AT91_PIN_PA22,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 1,
+ },
+ {
+ .name = "3G_ONOFF",
+ .attr_name = "radio-enabled",
+ .pin = AT91_PIN_PA21,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 1,
+ },
+ {
+ .name = "DEVICE_RESET",
+ .attr_name = "reset",
+ .pin = AT91_PIN_PC4,
+ .direction = GPIO_DIR_INPUT,
+ .output_value = 0,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LS_LED",
+ .attr_name = "led-ls",
+ .pin = AT91_PIN_PC16,
+#if LED_LS_CONTROLLABLE
+ .direction = GPIO_DIR_OUTPUT,
+#else
+ .direction = GPIO_DIR_INPUT,
+#endif
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "STATUS_LED",
+ .attr_name = "led-status",
+ .pin = AT91_PIN_PC21,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 0,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED3",
+ .attr_name = "led-wifi",
+ .pin = AT91_PIN_PC15,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED3",
+ .attr_name = "led-b",
+ .pin = AT91_PIN_PC15,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED4",
+ .attr_name = "led-cd",
+ .pin = AT91_PIN_PC20,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED4",
+ .attr_name = "led-c",
+ .pin = AT91_PIN_PC20,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED6",
+ .attr_name = "led-sig1",
+ .pin = AT91_PIN_PC19,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED6",
+ .attr_name = "led-d",
+ .pin = AT91_PIN_PC19,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED7",
+ .attr_name = "led-sig2",
+ .pin = AT91_PIN_PC18,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED7",
+ .attr_name = "led-e",
+ .pin = AT91_PIN_PC18,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED8",
+ .attr_name = "led-sig3",
+ .pin = AT91_PIN_PC17,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "LED8",
+ .attr_name = "led-f",
+ .pin = AT91_PIN_PC17,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "RI_B",
+ .attr_name = "extserial-ri",
+ .pin = AT91_PIN_PC25,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "DTR_B",
+ .attr_name = "extserial-dtr",
+ .pin = AT91_PIN_PC26,
+ .direction = GPIO_DIR_INPUT,
+ .output_value = 0,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "DSR_B",
+ .attr_name = "extserial-dsr",
+ .pin = AT91_PIN_PC27,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "DCD_B",
+ .attr_name = "extserial-dcd",
+ .pin = AT91_PIN_PC28,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 1,
+ .use_pullup = 0,
+ .active_low = 1,
+ },
+ {
+ .name = "BT_EN",
+ .attr_name = "bt-enabled",
+ .pin = AT91_PIN_PA28,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 0,
+ .use_pullup = 0,
+ },
+ {
+ .name = "WLAN_EN",
+ .attr_name = "wlan-enabled",
+ .pin = AT91_PIN_PA27,
+ .direction = GPIO_DIR_OUTPUT,
+ .output_value = 0,
+ .use_pullup = 0,
+ },
+ { },
+};
struct gpio_pin *gpio_pin_by_name(const char *name) {
struct gpio_pin *pin;
@@ -1035,7 +1235,7 @@ static int radio_reset_telit(void)
msleep(500);
- // set pin high (high Z)
+ // set pin high
ret = at91_set_gpio_output_with_pullup(rst_pin->pin, 1, rst_pin->use_pullup);
if (ret) {
return ret;
@@ -1052,7 +1252,7 @@ static int radio_reset_telit(void)
msleep(6000);
- // set on/off pin high (high Z)
+ // set on/off pin high
ret = at91_set_gpio_output_with_pullup(onoff_pin->pin, 1, onoff_pin->use_pullup);
if (ret) {
return ret;
@@ -2433,6 +2633,15 @@ static int mts_id_eeprom_load(void)
has_spi_dout = 0;
has_spi_temp = 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_product_id = MTR_0_1;
+ has_spi_sout = 0;
+ has_spi_din = 0;
+ has_spi_dout = 0;
+ has_spi_temp = 0;
+ log_info("detected board %s", HW_VERSION_MTR_0_1);
} else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTOCGD3_0_0, strlen(HW_VERSION_MTOCGD3_0_0)) == 0) {
attr_group = &mtr2_platform_attribute_group;
gpio_pins = gpio_pins_mtr2_0_0;
diff --git a/io-module/mts_io.h b/io-module/mts_io.h
index 43106cb..30b794d 100644
--- a/io-module/mts_io.h
+++ b/io-module/mts_io.h
@@ -39,6 +39,7 @@ struct device_attribute _dev_name = { \
#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_MTOCGD3_0_0 "MTOCGD3-0.0"
#define HW_VERSION_MTOCGD_0_0 "MTOCGD-0.0"
@@ -48,6 +49,7 @@ enum {
MT100EOCG_0_0,
MTR2_0_0,
MTR_0_0,
+ MTR_0_1,
MTOCGD3_0_0,
MTOCGD_0_0,
};