Skip to content

Commit 5fd2c0a

Browse files
committed
Merge pull request torvalds#80 from kmihelich/c1_led
Set C1 status LED to active low
2 parents 428e2c7 + ec6a188 commit 5fd2c0a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/gpio/gpiolib-of.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,25 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data)
7373
#include <linux/amlogic/aml_gpio_consumer.h>
7474
int of_get_named_gpio_flags(struct device_node *np, const char *propname,
7575
int index __attribute__((unused)),
76-
enum of_gpio_flags *flags __attribute__((unused)))
76+
enum of_gpio_flags *flags)
7777
{
7878
const char *str;
79+
int gpio;
7980

8081
if(of_property_read_string(np, "gpios", &str))
8182
return -EPROBE_DEFER;
8283

83-
return amlogic_gpio_name_map_num(str);
84+
gpio = amlogic_gpio_name_map_num(str);
85+
86+
/* Set ODROID-C1 status LED to active low */
87+
if (flags != NULL) {
88+
if (gpio == 13)
89+
*flags = 1;
90+
else
91+
*flags = 0;
92+
}
93+
94+
return gpio;
8495
}
8596
#else
8697
int of_get_named_gpio_flags(struct device_node *np, const char *propname,

0 commit comments

Comments
 (0)