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
led_get_brightness(struct led_classdev * led_cdev)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);
22*af0bfab9SAbanoub Sameh void led_set_brightness_nopm(struct led_classdev *led_cdev, unsigned int value);
23*af0bfab9SAbanoub Sameh void led_set_brightness_nosleep(struct led_classdev *led_cdev, unsigned int value);
2411f70002SAkinobu Mita ssize_t led_trigger_read(struct file *filp, struct kobject *kobj,
2511f70002SAkinobu Mita struct bin_attribute *attr, char *buf,
2611f70002SAkinobu Mita loff_t pos, size_t count);
2711f70002SAkinobu Mita ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
2811f70002SAkinobu Mita struct bin_attribute *bin_attr, char *buf,
2911f70002SAkinobu Mita loff_t pos, size_t count);
30d23a22a7SFabio Baltieri
3172f8da32SRichard Purdie extern struct rw_semaphore leds_list_lock;
32c72a1d60SRichard Purdie extern struct list_head leds_list;
33ba93cdceSEzequiel Garcia extern struct list_head trigger_list;
34bb4e9af0SJacek Anaszewski extern const char * const led_colors[LED_COLOR_ID_MAX];
35c72a1d60SRichard Purdie
36c72a1d60SRichard Purdie #endif /* __LEDS_H_INCLUDED */
37