projects
/
karo-tx-uboot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22b815e
)
karo: tx28: request gpio for acitivity LED and disable LED on failure
author
Lothar Waßmann
<LW@KARO-electronics.de>
Thu, 30 Jun 2016 12:33:39 +0000
(14:33 +0200)
committer
Lothar Waßmann
<LW@KARO-electronics.de>
Thu, 30 Jun 2016 12:33:39 +0000
(14:33 +0200)
board/karo/tx28/tx28.c
patch
|
blob
|
history
diff --git
a/board/karo/tx28/tx28.c
b/board/karo/tx28/tx28.c
index
f1fca4a
..
273463e
100644
(file)
--- 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);