From d92fe3e06395ff78d277124cfd383a5aebab0d7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Thu, 30 Jun 2016 14:33:39 +0200 Subject: [PATCH] karo: tx28: request gpio for acitivity LED and disable LED on failure --- board/karo/tx28/tx28.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/board/karo/tx28/tx28.c b/board/karo/tx28/tx28.c index f1fca4a17a..273463efcf 100644 --- a/board/karo/tx28/tx28.c +++ b/board/karo/tx28/tx28.c @@ -370,13 +370,18 @@ static int led_state = LED_STATE_DISABLED; void show_activity(int arg) { static ulong last; + int ret; if (led_state == LED_STATE_DISABLED) { return; } else if (led_state == LED_STATE_INIT) { last = get_timer(0); - gpio_set_value(TX28_LED_GPIO, 1); - led_state = LED_STATE_ON; + ret = gpio_request_one(TX28_LED_GPIO, + GPIOFLAG_OUTPUT_INIT_HIGH, "Activity"); + if (ret == 0) + led_state = LED_STATE_ON; + else + led_state = LED_STATE_DISABLED; } else { if (get_timer(last) > CONFIG_SYS_HZ) { last = get_timer(0); -- 2.39.2