summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolodymyr Vorobiov <volodymyr.vorobiov@globallogic.com>2019-11-01 18:52:43 +0200
committerVolodymyr Vorobiov <volodymyr.vorobiov@globallogic.com>2019-11-01 18:52:43 +0200
commite4577b095d086eeccc37516de42b331fd771a2fe (patch)
treec16382bb5ec5e4c5d1edc9aa1a4cef899380e499
parent7b69a324e2e76569a429341406a105b55d63a207 (diff)
downloadmts-io-e4577b095d086eeccc37516de42b331fd771a2fe.tar.gz
mts-io-e4577b095d086eeccc37516de42b331fd771a2fe.tar.bz2
mts-io-e4577b095d086eeccc37516de42b331fd771a2fe.zip
Add serial port io pins /dev/ttyS2 (Serial UART)
-rw-r--r--io-module/mt100eocg.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/io-module/mt100eocg.c b/io-module/mt100eocg.c
index f04a49b..ad22d22 100644
--- a/io-module/mt100eocg.c
+++ b/io-module/mt100eocg.c
@@ -2,6 +2,24 @@
/* Used for both MT100EOCG 0.0 */
static struct gpio_pin gpio_pins_mt100eocg_0_0[] = {
{
+ .name = "DTR1",
+ .pin = {
+ .label = "extserial-dtr",
+ .gpio = AT91_PIN_PB18,
+ .flags = GPIOF_IN,
+ },
+ .active_low = 1,
+ },
+ {
+ .name = "DCD1",
+ .pin = {
+ .label = "extserial-dcd",
+ .gpio = AT91_PIN_PB3,
+ .flags = GPIOF_OUT_INIT_HIGH,
+ },
+ .active_low = 1,
+ },
+ {
.name = "ETH0_ENABLED",
.pin = {
.label = "eth0-enabled",
@@ -120,29 +138,17 @@ static struct gpio_pin gpio_pins_mt100eocg_0_0[] = {
.gpio = AT91_PIN_PB17,
.flags = GPIOF_IN,
},
- },
- {
- .name = "DTR1",
- .pin = {
- .label = "extserial-dtr",
- .gpio = AT91_PIN_PB18,
- .flags = GPIOF_IN,
- },
- .active_low = 1,
- },
- {
- .name = "DCD1",
- .pin = {
- .label = "extserial-dcd",
- .gpio = AT91_PIN_PB3,
- .flags = GPIOF_OUT_INIT_HIGH,
- },
- .active_low = 1,
},*/
{ },
};
/* mt100eocg specific attributes */
+static DEVICE_ATTR_RO_MTS(dev_attr_extserial_dtr, "extserial-dtr",
+ mts_attr_show_gpio_pin);
+
+static DEVICE_ATTR_MTS(dev_attr_extserial_dcd_gpio, "extserial-dcd",
+ mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
+
static DEVICE_ATTR_MTS(dev_attr_eth0_enabled, "eth0-enabled",
mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
@@ -197,8 +203,8 @@ static struct attribute *mt100eocg_platform_attributes[] = {
&dev_attr_reset.attr,
&dev_attr_reset_monitor.attr,
&dev_attr_reset_monitor_intervals.attr,
-// &dev_attr_extserial_dtr.attr,
-// &dev_attr_extserial_dcd_gpio.attr,
+ &dev_attr_extserial_dtr.attr,
+ &dev_attr_extserial_dcd_gpio.attr,
&dev_attr_rsersrc.attr, // AT91_PIN_PC7
&dev_attr_radio_reset.attr, // AT91_PIN_PB30
&dev_attr_eth0_enabled.attr,