]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/misc/gpio_led.c
2 * Status LED driver based on GPIO access conventions of Linux
4 * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
12 #include <status_led.h>
15 /* assume led is active low */
17 void __led_init(led_id_t mask
, int state
)
19 gpio_direction_output(mask
, (state
== STATUS_LED_ON
) ? 0 : 1);
22 void __led_set(led_id_t mask
, int state
)
24 gpio_set_value(mask
, (state
== STATUS_LED_ON
) ? 0 : 1);
27 void __led_toggle(led_id_t mask
)
29 gpio_set_value(mask
, !gpio_get_value(mask
));