diff options
author | Sean Godinez <sgodinez@multitech.com> | 2013-11-22 17:26:44 -0600 |
---|---|---|
committer | Sean Godinez <sgodinez@multitech.com> | 2013-11-22 17:26:44 -0600 |
commit | 7c714aea0d69691f4b99b92cb6bd8b11ee020390 (patch) | |
tree | d15f4eb3dde2c13b5acf82db65e3f5a3332fb431 /io-module/mts_io.c | |
parent | e0e72edb4da3ac44f8db1d144729ea87e50b24f1 (diff) | |
parent | a7eb04eef347e5481a42a3afd0bcd038e1b4acda (diff) | |
download | cdp-io-controller-7c714aea0d69691f4b99b92cb6bd8b11ee020390.tar.gz cdp-io-controller-7c714aea0d69691f4b99b92cb6bd8b11ee020390.tar.bz2 cdp-io-controller-7c714aea0d69691f4b99b92cb6bd8b11ee020390.zip |
Merge branch 'mtr2-serial'
Diffstat (limited to 'io-module/mts_io.c')
-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; } |