blob: 539c139bb5dd633d680e2fe9bfd3cdae65caa408 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +01002/*
3 * (C) Copyright 2015
Kamil Lulkodecd33b2015-11-29 11:50:53 +01004 * Kamil Lulko, <kamil.lulko@gmail.com>
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +01005 */
6
7#include <common.h>
Simon Glasse7872cb2019-11-14 12:57:11 -07008#include <status_led.h>
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +01009#include <asm-generic/gpio.h>
10
11void coloured_LED_init(void)
12{
Patrice Chotard33cfadc2019-06-26 10:26:41 +020013 gpio_request(CONFIG_RED_LED, "red led");
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010014 gpio_direction_output(CONFIG_RED_LED, 0);
Patrice Chotard33cfadc2019-06-26 10:26:41 +020015 gpio_request(CONFIG_GREEN_LED, "green led");
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010016 gpio_direction_output(CONFIG_GREEN_LED, 0);
17}
18
19void red_led_off(void)
20{
21 gpio_set_value(CONFIG_RED_LED, 0);
22}
23
24void green_led_off(void)
25{
26 gpio_set_value(CONFIG_GREEN_LED, 0);
27}
28
29void red_led_on(void)
30{
31 gpio_set_value(CONFIG_RED_LED, 1);
32}
33
34void green_led_on(void)
35{
36 gpio_set_value(CONFIG_GREEN_LED, 1);
37}