aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/leds.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r--include/linux/leds.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
new file mode 100644
index 000000000000..6812640b39cc
--- /dev/null
+++ b/include/linux/leds.h
@@ -0,0 +1,51 @@
1/*
2 * Driver model for leds and led triggers
3 *
4 * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu>
5 * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef __LINUX_LEDS_H_INCLUDED
13#define __LINUX_LEDS_H_INCLUDED
14
15struct device;
16struct class_device;
17/*
18 * LED Core
19 */
20
21enum led_brightness {
22 LED_OFF = 0,
23 LED_HALF = 127,
24 LED_FULL = 255,
25};
26
27struct led_classdev {
28 const char *name;
29 int brightness;
30 int flags;
31#define LED_SUSPENDED (1 << 0)
32
33 /* A function to set the brightness of the led */
34 void (*brightness_set)(struct led_classdev *led_cdev,
35 enum led_brightness brightness);
36
37 struct class_device *class_dev;
38 /* LED Device linked list */
39 struct list_head node;
40
41 /* Trigger data */
42 char *default_trigger;
43};
44
45extern int led_classdev_register(struct device *parent,
46 struct led_classdev *led_cdev);
47extern void led_classdev_unregister(struct led_classdev *led_cdev);
48extern void led_classdev_suspend(struct led_classdev *led_cdev);
49extern void led_classdev_resume(struct led_classdev *led_cdev);
50
51#endif /* __LINUX_LEDS_H_INCLUDED */