Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2015 | ||||
Kamil Lulko | decd33b | 2015-11-29 11:50:53 +0100 | [diff] [blame] | 4 | * Kamil Lulko, <kamil.lulko@gmail.com> |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 5 | */ |
6 | |||||
Simon Glass | e7872cb | 2019-11-14 12:57:11 -0700 | [diff] [blame] | 7 | #include <status_led.h> |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 8 | #include <asm-generic/gpio.h> |
9 | |||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 10 | #define RED_LED 110 |
11 | #define GREEN_LED 109 | ||||
12 | |||||
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 13 | void coloured_LED_init(void) |
14 | { | ||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 15 | gpio_request(RED_LED, "red led"); |
16 | gpio_direction_output(RED_LED, 0); | ||||
17 | gpio_request(GREEN_LED, "green led"); | ||||
18 | gpio_direction_output(GREEN_LED, 0); | ||||
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 19 | } |
20 | |||||
21 | void red_led_off(void) | ||||
22 | { | ||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 23 | gpio_set_value(RED_LED, 0); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 24 | } |
25 | |||||
26 | void green_led_off(void) | ||||
27 | { | ||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 28 | gpio_set_value(GREEN_LED, 0); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 29 | } |
30 | |||||
31 | void red_led_on(void) | ||||
32 | { | ||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 33 | gpio_set_value(RED_LED, 1); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 34 | } |
35 | |||||
36 | void green_led_on(void) | ||||
37 | { | ||||
Tom Rini | 2703df2 | 2022-03-30 18:07:19 -0400 | [diff] [blame] | 38 | gpio_set_value(GREEN_LED, 1); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 39 | } |