diff options
author | Riku Voipio <riku.voipio@iki.fi> | 2008-05-31 09:43:41 -0400 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2008-07-23 04:49:56 -0400 |
commit | e14fa82439d33cef67eaafc1a48960bbfa610c8e (patch) | |
tree | e98b939481252441fecf05350f769a44acb7d99c /include/linux/leds-pca9532.h | |
parent | c010b2f76c3032e48097a6eef291d8593d5d79a6 (diff) |
leds: Add pca9532 led driver
NXP pca9532 is a LED dimmer/controller attached to i2c bus. It allows
attaching upto 16 leds which can either be on, off or dimmed and/or blinked
with the two PWM modulators available.
This driver is a "new-style" i2c driver that adheres to the driver model and
implements the led framework api. Since the leds connected to the driver are
platform specific, it is only useful when platform data is passed to the
driver to define what leds are connected to which pins.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'include/linux/leds-pca9532.h')
-rw-r--r-- | include/linux/leds-pca9532.h | 45 |
1 files changed, 45 insertions, 0 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 | |||
19 | enum pca9532_state { | ||
20 | PCA9532_OFF = 0x0, | ||
21 | PCA9532_ON = 0x1, | ||
22 | PCA9532_PWM0 = 0x2, | ||
23 | PCA9532_PWM1 = 0x3 | ||
24 | }; | ||
25 | |||
26 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, | ||
27 | PCA9532_TYPE_N2100_BEEP }; | ||
28 | |||
29 | struct 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 | |||
38 | struct 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 | |||