summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mts_io.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 20c663d..528b754 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -73,13 +73,11 @@ enum {
LED_FLASHING,
};
-#define LED_STATUS_CONTROLLABLE 0
+#define LED_STATUS_CONTROLLABLE_MTCDP 0
#define LED_LS_CONTROLLABLE 0
#define USBH2_PS_CONTROLLABLE 0
-#if LED_STATUS_CONTROLLABLE
static int led_mode_status = LED_OFF;
-#endif
#define SOUT_LED_CD_BIT BIT(0)
#define SOUT_EXTSERIAL_RI_BIT BIT(1)
@@ -156,7 +154,7 @@ static struct gpio_pin gpio_pins_mtcdp_0_0[] = {
.output_value = 1,
.use_pullup = 0,
},
-#if LED_STATUS_CONTROLLABLE
+#if LED_STATUS_CONTROLLABLE_MTCDP
{
.name = "STATUS_LED",
.attr_name = "led-status",
@@ -231,7 +229,7 @@ static struct gpio_pin gpio_pins_mtcdp_1_0[] = {
.use_pullup = 0,
},
-#if LED_STATUS_CONTROLLABLE
+#if LED_STATUS_CONTROLLABLE_MTCDP
{
.name = "STATUS_LED",
.attr_name = "led-status",
@@ -435,7 +433,6 @@ static struct gpio_pin gpio_pins_en4_0_0[] = {
.output_value = 1,
.use_pullup = 0,
},
-#if LED_STATUS_CONTROLLABLE
{
.name = "STATUS_LED",
.attr_name = "led-status",
@@ -444,7 +441,6 @@ static struct gpio_pin gpio_pins_en4_0_0[] = {
.output_value = 1,
.use_pullup = 0,
},
-#endif
{
.name = "LED7",
.attr_name = "led-cd",
@@ -819,14 +815,12 @@ static void blink_callback(struct work_struct *ignored)
reset_count = 0;
}
-#if LED_STATUS_CONTROLLABLE
if (led_mode_status == LED_FLASHING) {
pin = gpio_pin_by_name("STATUS_LED");
if (pin) {
at91_set_gpio_value(pin->pin, !at91_get_gpio_value(pin->pin));
}
}
-#endif
mutex_unlock(&mts_io_mutex);
@@ -1612,7 +1606,6 @@ static struct device_attribute dev_attr_extserial_ri_gpio = {
.store = mts_attr_store_gpio_pin_inverted,
};
-#if LED_STATUS_CONTROLLABLE
static ssize_t mts_attr_show_led_status(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -1674,6 +1667,7 @@ static struct device_attribute dev_attr_led_status = {
.store = mts_attr_store_led_status,
};
+#if LED_STATUS_CONTROLLABLE_MTCDP
static struct device_attribute dev_attr_led_sdk_a = {
.attr = {
.name = "led-sdk-a",
@@ -2219,7 +2213,6 @@ static ssize_t mts_attr_show_serial_mode(struct device *dev,
static ssize_t mts_attr_store_serial_mode(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- pid_t pid;
int smode0;
int smode2;
struct gpio_pin *pin_smode0 = gpio_pin_by_name("SERIAL_MODE0");
@@ -2364,6 +2357,7 @@ static struct attribute *en4_platform_attributes[] = {
&dev_attr_rs485_term_res.attr,
&dev_attr_rs422_term_res.attr,
+ &dev_attr_led_status.attr,
&dev_attr_led_sig1_gpio.attr,
&dev_attr_led_sig2_gpio.attr,
&dev_attr_led_sig3_gpio.attr,
@@ -2386,7 +2380,7 @@ static struct attribute *platform_attributes[] = {
&dev_attr_eth0_enabled.attr,
&dev_attr_extserial_dtr.attr,
&dev_attr_led_ls.attr,
-#if LED_STATUS_CONTROLLABLE
+#if LED_STATUS_CONTROLLABLE_MTCDP
&dev_attr_led_status.attr,
&dev_attr_led_sdk_a.attr,
#endif