blob: 4b8038341b9ed04e42e9a3a2ae5d3d813fe644c4 [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
Simon Glasse7872cb2019-11-14 12:57:11 -07007#include <status_led.h>
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +01008#include <asm-generic/gpio.h>
9
Tom Rini2703df22022-03-30 18:07:19 -040010#define RED_LED 110
11#define GREEN_LED 109
12
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010013void coloured_LED_init(void)
14{
Tom Rini2703df22022-03-30 18:07:19 -040015 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.pl6b5e5a92015-03-01 12:44:42 +010019}
20
21void red_led_off(void)
22{
Tom Rini2703df22022-03-30 18:07:19 -040023 gpio_set_value(RED_LED, 0);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010024}
25
26void green_led_off(void)
27{
Tom Rini2703df22022-03-30 18:07:19 -040028 gpio_set_value(GREEN_LED, 0);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010029}
30
31void red_led_on(void)
32{
Tom Rini2703df22022-03-30 18:07:19 -040033 gpio_set_value(RED_LED, 1);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010034}
35
36void green_led_on(void)
37{
Tom Rini2703df22022-03-30 18:07:19 -040038 gpio_set_value(GREEN_LED, 1);
rev13@wp.pl6b5e5a92015-03-01 12:44:42 +010039}