From e4577b095d086eeccc37516de42b331fd771a2fe Mon Sep 17 00:00:00 2001 From: Volodymyr Vorobiov Date: Fri, 1 Nov 2019 18:52:43 +0200 Subject: Add serial port io pins /dev/ttyS2 (Serial UART) --- io-module/mt100eocg.c | 46 ++++++++++++++++++++++++++-------------------- 1 file 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 @@ -1,6 +1,24 @@ #include "at91gpio.h" /* 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 = { @@ -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, -- cgit v1.2.3