xref: /openbmc/linux/drivers/leds/leds.h (revision bb4e9af0348dfeafd66c7e7f82e8a0983fe5390c)
1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2c72a1d60SRichard Purdie /*
3c72a1d60SRichard Purdie  * LED Core
4c72a1d60SRichard Purdie  *
5c72a1d60SRichard Purdie  * Copyright 2005 Openedhand Ltd.
6c72a1d60SRichard Purdie  *
7c72a1d60SRichard Purdie  * Author: Richard Purdie <rpurdie@openedhand.com>
8c72a1d60SRichard Purdie  */
9c72a1d60SRichard Purdie #ifndef __LEDS_H_INCLUDED
10c72a1d60SRichard Purdie #define __LEDS_H_INCLUDED
11c72a1d60SRichard Purdie 
1272f8da32SRichard Purdie #include <linux/rwsem.h>
13c72a1d60SRichard Purdie #include <linux/leds.h>
14c72a1d60SRichard Purdie 
150013b23dSNémeth Márton static inline int led_get_brightness(struct led_classdev *led_cdev)
160013b23dSNémeth Márton {
170013b23dSNémeth Márton 	return led_cdev->brightness;
180013b23dSNémeth Márton }
190013b23dSNémeth Márton 
20757b06aeSJacek Anaszewski void led_init_core(struct led_classdev *led_cdev);
21d23a22a7SFabio Baltieri void led_stop_software_blink(struct led_classdev *led_cdev);
2281fe8e5bSJacek Anaszewski void led_set_brightness_nopm(struct led_classdev *led_cdev,
2381fe8e5bSJacek Anaszewski 				enum led_brightness value);
2481fe8e5bSJacek Anaszewski void led_set_brightness_nosleep(struct led_classdev *led_cdev,
2581fe8e5bSJacek Anaszewski 				enum led_brightness value);
26d23a22a7SFabio Baltieri 
2772f8da32SRichard Purdie extern struct rw_semaphore leds_list_lock;
28c72a1d60SRichard Purdie extern struct list_head leds_list;
29ba93cdceSEzequiel Garcia extern struct list_head trigger_list;
30*bb4e9af0SJacek Anaszewski extern const char * const led_colors[LED_COLOR_ID_MAX];
31c72a1d60SRichard Purdie 
32c72a1d60SRichard Purdie #endif	/* __LEDS_H_INCLUDED */
33