Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 2 | /* |
| 3 | * LED Core |
| 4 | * |
| 5 | * Copyright 2005 Openedhand Ltd. |
| 6 | * |
| 7 | * Author: Richard Purdie <rpurdie@openedhand.com> |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 8 | */ |
| 9 | #ifndef __LEDS_H_INCLUDED |
| 10 | #define __LEDS_H_INCLUDED |
| 11 | |
Richard Purdie | 72f8da3 | 2007-12-31 23:09:44 +0000 | [diff] [blame] | 12 | #include <linux/rwsem.h> |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 13 | #include <linux/leds.h> |
| 14 | |
Németh Márton | 0013b23 | 2008-03-09 20:54:37 +0000 | [diff] [blame] | 15 | static inline int led_get_brightness(struct led_classdev *led_cdev) |
| 16 | { |
| 17 | return led_cdev->brightness; |
| 18 | } |
| 19 | |
Jacek Anaszewski | 757b06a | 2015-09-28 14:38:04 +0200 | [diff] [blame] | 20 | void led_init_core(struct led_classdev *led_cdev); |
Fabio Baltieri | d23a22a | 2012-08-15 21:44:34 +0800 | [diff] [blame] | 21 | void led_stop_software_blink(struct led_classdev *led_cdev); |
Jacek Anaszewski | 81fe8e5 | 2015-10-07 11:10:41 +0200 | [diff] [blame] | 22 | void led_set_brightness_nopm(struct led_classdev *led_cdev, |
| 23 | enum led_brightness value); |
| 24 | void led_set_brightness_nosleep(struct led_classdev *led_cdev, |
| 25 | enum led_brightness value); |
Fabio Baltieri | d23a22a | 2012-08-15 21:44:34 +0800 | [diff] [blame] | 26 | |
Richard Purdie | 72f8da3 | 2007-12-31 23:09:44 +0000 | [diff] [blame] | 27 | extern struct rw_semaphore leds_list_lock; |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 28 | extern struct list_head leds_list; |
Ezequiel Garcia | ba93cdc | 2016-04-28 19:03:38 -0300 | [diff] [blame] | 29 | extern struct list_head trigger_list; |
Jacek Anaszewski | bb4e9af | 2019-06-09 20:19:04 +0200 | [diff] [blame] | 30 | extern const char * const led_colors[LED_COLOR_ID_MAX]; |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 31 | |
Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame] | 32 | #endif /* __LEDS_H_INCLUDED */ |