blob: 0b577cece8f7e169f7eabb3427b5bc69e74267ad [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Richard Purdiec72a1d62006-03-31 02:31:04 -08002/*
3 * LED Core
4 *
5 * Copyright 2005 Openedhand Ltd.
6 *
7 * Author: Richard Purdie <rpurdie@openedhand.com>
Richard Purdiec72a1d62006-03-31 02:31:04 -08008 */
9#ifndef __LEDS_H_INCLUDED
10#define __LEDS_H_INCLUDED
11
Richard Purdie72f8da32007-12-31 23:09:44 +000012#include <linux/rwsem.h>
Richard Purdiec72a1d62006-03-31 02:31:04 -080013#include <linux/leds.h>
14
Németh Márton0013b232008-03-09 20:54:37 +000015static inline int led_get_brightness(struct led_classdev *led_cdev)
16{
17 return led_cdev->brightness;
18}
19
Jacek Anaszewski757b06a2015-09-28 14:38:04 +020020void led_init_core(struct led_classdev *led_cdev);
Fabio Baltierid23a22a2012-08-15 21:44:34 +080021void led_stop_software_blink(struct led_classdev *led_cdev);
Jacek Anaszewski81fe8e52015-10-07 11:10:41 +020022void led_set_brightness_nopm(struct led_classdev *led_cdev,
23 enum led_brightness value);
24void led_set_brightness_nosleep(struct led_classdev *led_cdev,
25 enum led_brightness value);
Fabio Baltierid23a22a2012-08-15 21:44:34 +080026
Richard Purdie72f8da32007-12-31 23:09:44 +000027extern struct rw_semaphore leds_list_lock;
Richard Purdiec72a1d62006-03-31 02:31:04 -080028extern struct list_head leds_list;
Ezequiel Garciaba93cdc2016-04-28 19:03:38 -030029extern struct list_head trigger_list;
Jacek Anaszewskibb4e9af2019-06-09 20:19:04 +020030extern const char * const led_colors[LED_COLOR_ID_MAX];
Richard Purdiec72a1d62006-03-31 02:31:04 -080031
Richard Purdiec72a1d62006-03-31 02:31:04 -080032#endif /* __LEDS_H_INCLUDED */