blob: 8dda6a97bd1c08dae98f595f08313bd43fb19f0e [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
Tom Rini2703df22022-03-30 18:07:19 -040011#define RED_LED 110
12#define GREEN_LED 109
13
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010014void coloured_LED_init(void)
15{
Tom Rini2703df22022-03-30 18:07:19 -040016 gpio_request(RED_LED, "red led");
17 gpio_direction_output(RED_LED, 0);
18 gpio_request(GREEN_LED, "green led");
19 gpio_direction_output(GREEN_LED, 0);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010020}
21
22void red_led_off(void)
23{
Tom Rini2703df22022-03-30 18:07:19 -040024 gpio_set_value(RED_LED, 0);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010025}
26
27void green_led_off(void)
28{
Tom Rini2703df22022-03-30 18:07:19 -040029 gpio_set_value(GREEN_LED, 0);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010030}
31
32void red_led_on(void)
33{
Tom Rini2703df22022-03-30 18:07:19 -040034 gpio_set_value(RED_LED, 1);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010035}
36
37void green_led_on(void)
38{
Tom Rini2703df22022-03-30 18:07:19 -040039 gpio_set_value(GREEN_LED, 1);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010040}