From 6192f3b1193c5a839547b5acd9da1ea03bafccce Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Wed, 14 Sep 2016 21:10:20 +0300 Subject: mtp: remove led-a/b/c/d, add led-status properly --- io-module/mtp.c | 69 ++++++++---------------------------------------------- io-module/mts_io.c | 2 +- 2 files changed, 11 insertions(+), 60 deletions(-) diff --git a/io-module/mtp.c b/io-module/mtp.c index 3d536a4..9726b86 100644 --- a/io-module/mtp.c +++ b/io-module/mtp.c @@ -8,7 +8,6 @@ static struct gpio_pin gpio_pins_mtp_0_0[] = { .flags = GPIOF_OUT_INIT_HIGH, .label = "eth-enabled", }, - .active_low = 0, }, { .name = "RADIO_POWER_MONITOR", @@ -43,40 +42,31 @@ static struct gpio_pin gpio_pins_mtp_0_0[] = { }, .active_low = 1, }, - { - .name = "USER_PUSHBUTTON", - .pin = { - .gpio = AT91_PIN_PA5, // User Pushbutton - .flags = GPIOF_IN, - .label = "button", - }, - .active_low = 1, - }, { .name = "LORA_RESET", .pin = { .gpio = AT91_PIN_PA8, // LORA_RST - .flags = GPIOF_OUT_INIT_HIGH, + .flags = GPIOF_OUT_INIT_LOW, .label = "lora-reset", }, }, /* LEDs */ { - .name = "LED2", // LED2 is for LoRa status + .name = "STATUS_LED", // DEV_LED_GN .pin = { - .gpio = AT91_PIN_PC15, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-lora", + .gpio = AT91_PIN_PC25, + .flags = GPIOF_OUT_INIT_LOW, + .label = "led-status", }, .active_low = 1, }, { - .name = "LED2", + .name = "LED2", // LED2 is for LoRa status .pin = { .gpio = AT91_PIN_PC15, .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-a", + .label = "led-lora", }, .active_low = 1, }, @@ -89,15 +79,6 @@ static struct gpio_pin gpio_pins_mtp_0_0[] = { }, .active_low = 1, }, - { - .name = "LED3", - .pin = { - .gpio = AT91_PIN_PC16, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-b", - }, - .active_low = 1, - }, { .name = "LED4", // LED4 is for WiFi status .pin = { @@ -107,33 +88,6 @@ static struct gpio_pin gpio_pins_mtp_0_0[] = { }, .active_low = 1, }, - { - .name = "LED4", - .pin = { - .gpio = AT91_PIN_PC20, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-c", - }, - .active_low = 1, - }, - { - .name = "LED5", // DEV_LED_GN - .pin = { - .gpio = AT91_PIN_PC25, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-dev", - }, - .active_low = 1, - }, - { - .name = "LED5", - .pin = { - .gpio = AT91_PIN_PC25, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-d", - }, - .active_low = 1, - }, { }, }; @@ -371,7 +325,7 @@ static DEVICE_ATTR_MTS(dev_attr_eth_enabled_mtp, "eth-enabled", static DEVICE_ATTR_MTS(dev_attr_led_lora_gpio_mtp, "led-lora", mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); -static DEVICE_ATTR_MTS(dev_attr_led_dev_gpio_mtp, "led-dev", +static DEVICE_ATTR_MTS(dev_attr_led_wifi_gpio_mtp, "led-wifi", mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); static struct attribute *mtp_0_0_platform_attributes[] = { @@ -400,14 +354,11 @@ static struct attribute *mtp_0_0_platform_attributes[] = { &dev_attr_radio_reset_backoff_index.attr, &dev_attr_radio_reset_backoff_seconds.attr, + &dev_attr_led_status.attr, &dev_attr_led_cd_gpio.attr, &dev_attr_led_lora_gpio_mtp.attr, - &dev_attr_led_dev_gpio_mtp.attr, + &dev_attr_led_wifi_gpio_mtp.attr, - &dev_attr_led_a_gpio.attr, - &dev_attr_led_b_gpio.attr, - &dev_attr_led_c_gpio.attr, - &dev_attr_led_d_gpio.attr, &dev_attr_lora_reset_mtp.attr, NULL, diff --git a/io-module/mts_io.c b/io-module/mts_io.c index bf0a6bd..17bf31f 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -47,7 +47,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v1.1.3" +#define DRIVER_VERSION "v1.4.0" #define DRIVER_AUTHOR "James Maki " #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" -- cgit v1.2.3