2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <status_led.h>
13 /* The LED port is configured as output only, so we
14 * must track the state manually.
16 static led_id_t val = 0;
18 void __led_init (led_id_t mask, int state)
20 nios_pio_t *pio = (nios_pio_t *)CONFIG_SYS_LEDPIO_ADDR;
22 if (state == STATUS_LED_ON)
26 writel (val, &pio->data);
29 void __led_set (led_id_t mask, int state)
31 nios_pio_t *pio = (nios_pio_t *)CONFIG_SYS_LEDPIO_ADDR;
33 if (state == STATUS_LED_ON)
37 writel (val, &pio->data);
40 void __led_toggle (led_id_t mask)
42 nios_pio_t *pio = (nios_pio_t *)CONFIG_SYS_LEDPIO_ADDR;
45 writel (val, &pio->data);