aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 15:16:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 15:16:02 -0400
commitc54554d388369f7f88ddcbe285ca96f7fb8a2d4b (patch)
tree5911607c237fc77d36787b813250ee64fdb41dd6 /include
parent4378dcca8578b0fd0fba883a3354ad4820d4f85f (diff)
parentfe3025b55c8ed06929afe94e9c9095fc19d15aa0 (diff)
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds: leds: Ensure led->trigger is set earlier leds: Add support for Philips PCA955x I2C LED drivers leds: Fix sparse warnings in leds-h1940 driver leds: mark led_classdev.default_trigger as const leds: fix unsigned value overflow in atmel pwm driver leds: Add pca9532 platform data for Thecus N2100 leds: Add pca9532 led driver
Diffstat (limited to 'include')
-rw-r--r--include/linux/leds-pca9532.h45
-rw-r--r--include/linux/leds.h16
2 files changed, 60 insertions, 1 deletions
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h
new file mode 100644
index 000000000000..81b4207deb95
--- /dev/null
+++ b/include/linux/leds-pca9532.h
@@ -0,0 +1,45 @@
1/*
2 * pca9532.h - platform data structure for pca9532 led controller
3 *
4 * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
11 *
12 */
13
14#ifndef __LINUX_PCA9532_H
15#define __LINUX_PCA9532_H
16
17#include <linux/leds.h>
18
19enum pca9532_state {
20 PCA9532_OFF = 0x0,
21 PCA9532_ON = 0x1,
22 PCA9532_PWM0 = 0x2,
23 PCA9532_PWM1 = 0x3
24};
25
26enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED,
27 PCA9532_TYPE_N2100_BEEP };
28
29struct pca9532_led {
30 u8 id;
31 struct i2c_client *client;
32 char *name;
33 struct led_classdev ldev;
34 enum pca9532_type type;
35 enum pca9532_state state;
36};
37
38struct pca9532_platform_data {
39 struct pca9532_led leds[16];
40 u8 pwm[2];
41 u8 psc[2];
42};
43
44#endif /* __LINUX_PCA9532_H */
45
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 519df72e939d..d41ccb56146a 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -48,7 +48,7 @@ struct led_classdev {
48 48
49 struct device *dev; 49 struct device *dev;
50 struct list_head node; /* LED Device list */ 50 struct list_head node; /* LED Device list */
51 char *default_trigger; /* Trigger to use */ 51 const char *default_trigger; /* Trigger to use */
52 52
53#ifdef CONFIG_LEDS_TRIGGERS 53#ifdef CONFIG_LEDS_TRIGGERS
54 /* Protects the trigger data below */ 54 /* Protects the trigger data below */
@@ -118,6 +118,20 @@ extern void ledtrig_ide_activity(void);
118#define ledtrig_ide_activity() do {} while(0) 118#define ledtrig_ide_activity() do {} while(0)
119#endif 119#endif
120 120
121/*
122 * Generic LED platform data for describing LED names and default triggers.
123 */
124struct led_info {
125 const char *name;
126 char *default_trigger;
127 int flags;
128};
129
130struct led_platform_data {
131 int num_leds;
132 struct led_info *leds;
133};
134
121/* For the leds-gpio driver */ 135/* For the leds-gpio driver */
122struct gpio_led { 136struct gpio_led {
123 const char *name; 137 const char *name;