diff options
Diffstat (limited to 'io-module')
-rw-r--r-- | io-module/mts_io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index bdbc43d..9f27af2 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -596,7 +596,7 @@ static struct gpio_pin gpio_pins_mtr2_0_0[] = { .attr_name = "serial_mode", .pin = AT91_PIN_PC23, .direction = GPIO_DIR_OUTPUT, - .output_value = 1, + .output_value = 0, .use_pullup = 0, }, { @@ -2299,6 +2299,8 @@ static ssize_t mts_attr_show_serial_mode(struct device *dev, ret = sprintf(buf, "rs485\n"); else if (smode2 == 1 && smode1 == 0 && smode0 == 0) ret = sprintf(buf, "rs422\n"); + else if (smode2 == 0 && smode1 == 0 && smode0 == 0) + ret = sprintf(buf, "loopback\n"); else ret = sprintf(buf, "error\n"); @@ -2335,6 +2337,11 @@ static ssize_t mts_attr_store_serial_mode(struct device *dev, smode1 = 0; smode0 = 0; } + else if (!strcasecmp(buf, "loopback")) { + smode2 = 0; + smode1 = 0; + smode0 = 0; + } else { return -EINVAL; } |