xref: /freebsd/sys/compat/linuxkpi/common/include/linux/leds.h (revision 69880fede78fc769ad417e5a984fb9fee7815d8b)
1a62d5ff5SBjoern A. Zeeb /*-
2a62d5ff5SBjoern A. Zeeb  * Copyright (c) 2022 Bjoern A. Zeeb
3a62d5ff5SBjoern A. Zeeb  *
4a62d5ff5SBjoern A. Zeeb  * Redistribution and use in source and binary forms, with or without
5a62d5ff5SBjoern A. Zeeb  * modification, are permitted provided that the following conditions
6a62d5ff5SBjoern A. Zeeb  * are met:
7a62d5ff5SBjoern A. Zeeb  * 1. Redistributions of source code must retain the above copyright
8a62d5ff5SBjoern A. Zeeb  *    notice, this list of conditions and the following disclaimer.
9a62d5ff5SBjoern A. Zeeb  * 2. Redistributions in binary form must reproduce the above copyright
10a62d5ff5SBjoern A. Zeeb  *    notice, this list of conditions and the following disclaimer in the
11a62d5ff5SBjoern A. Zeeb  *    documentation and/or other materials provided with the distribution.
12a62d5ff5SBjoern A. Zeeb  *
13a62d5ff5SBjoern A. Zeeb  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14a62d5ff5SBjoern A. Zeeb  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15a62d5ff5SBjoern A. Zeeb  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16a62d5ff5SBjoern A. Zeeb  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17a62d5ff5SBjoern A. Zeeb  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18a62d5ff5SBjoern A. Zeeb  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19a62d5ff5SBjoern A. Zeeb  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20a62d5ff5SBjoern A. Zeeb  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21a62d5ff5SBjoern A. Zeeb  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22a62d5ff5SBjoern A. Zeeb  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23a62d5ff5SBjoern A. Zeeb  * SUCH DAMAGE.
24a62d5ff5SBjoern A. Zeeb  */
25a62d5ff5SBjoern A. Zeeb 
26a62d5ff5SBjoern A. Zeeb #ifndef	_LINUXKPI_LINUX_LEDS_H
27a62d5ff5SBjoern A. Zeeb #define	_LINUXKPI_LINUX_LEDS_H
28a62d5ff5SBjoern A. Zeeb 
29a62d5ff5SBjoern A. Zeeb enum led_brightness {
30*69880fedSBjoern A. Zeeb 	LED_OFF,
31a62d5ff5SBjoern A. Zeeb };
32a62d5ff5SBjoern A. Zeeb 
33a62d5ff5SBjoern A. Zeeb struct led_classdev {
34a62d5ff5SBjoern A. Zeeb 	const char		*name;
35a62d5ff5SBjoern A. Zeeb 	const char		*default_trigger;
36a62d5ff5SBjoern A. Zeeb 	int (*blink_set)(struct led_classdev *, unsigned long *, unsigned long *);
37a62d5ff5SBjoern A. Zeeb 	void (*brightness_set)(struct led_classdev *, enum led_brightness);
38*69880fedSBjoern A. Zeeb 	void (*led_set)(struct led_classdev *, enum led_brightness);
39a62d5ff5SBjoern A. Zeeb };
40a62d5ff5SBjoern A. Zeeb 
41a62d5ff5SBjoern A. Zeeb #endif	/* _LINUXKPI_LINUX_LEDS_H */
42