summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mts_io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 211dbc4..4d2bc64 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,
},
{
@@ -2281,6 +2281,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");
@@ -2317,6 +2319,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;
}