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 | |
| 7 | #include <common.h> |
| 8 | #include <asm-generic/gpio.h> |
| 9 | |
| 10 | void coloured_LED_init(void) |
| 11 | { |
Patrice Chotard | 33cfadc | 2019-06-26 10:26:41 +0200 | [diff] [blame^] | 12 | gpio_request(CONFIG_RED_LED, "red led"); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 13 | gpio_direction_output(CONFIG_RED_LED, 0); |
Patrice Chotard | 33cfadc | 2019-06-26 10:26:41 +0200 | [diff] [blame^] | 14 | gpio_request(CONFIG_GREEN_LED, "green led"); |
rev13@wp.pl | 6b5e5a9 | 2015-03-01 12:44:42 +0100 | [diff] [blame] | 15 | gpio_direction_output(CONFIG_GREEN_LED, 0); |
| 16 | } |
| 17 | |
| 18 | void red_led_off(void) |
| 19 | { |
| 20 | gpio_set_value(CONFIG_RED_LED, 0); |
| 21 | } |
| 22 | |
| 23 | void green_led_off(void) |
| 24 | { |
| 25 | gpio_set_value(CONFIG_GREEN_LED, 0); |
| 26 | } |
| 27 | |
| 28 | void red_led_on(void) |
| 29 | { |
| 30 | gpio_set_value(CONFIG_RED_LED, 1); |
| 31 | } |
| 32 | |
| 33 | void green_led_on(void) |
| 34 | { |
| 35 | gpio_set_value(CONFIG_GREEN_LED, 1); |
| 36 | } |