diff options
author | Mike Fiore <mfiore@multitech.com> | 2013-05-02 09:41:27 -0500 |
---|---|---|
committer | Mike Fiore <mfiore@multitech.com> | 2013-05-02 13:24:14 -0500 |
commit | e8708f8f4425f07280a61ce61fadb0b81aa62763 (patch) | |
tree | 560cc8631fb68e85fba7b4a6a894f07c702f8d03 /io-module/mts_io.c | |
parent | 49b27c48f56a2d772676963f4c0f9c16eac78c7f (diff) | |
download | cdp-io-controller-e8708f8f4425f07280a61ce61fadb0b81aa62763.tar.gz cdp-io-controller-e8708f8f4425f07280a61ce61fadb0b81aa62763.tar.bz2 cdp-io-controller-e8708f8f4425f07280a61ce61fadb0b81aa62763.zip |
add support for mtr rev-b
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index b20a5f8..ba55a1b 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -782,6 +782,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; @@ -2381,6 +2581,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; |