diff options
author | Joachim Eastwood <manabian@gmail.com> | 2011-05-24 20:13:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:50 -0400 |
commit | 3c1ab50d0a31b27bb4e55168f4901dd91e6e5ea4 (patch) | |
tree | a9ec955ad64bda0ff64f5654c1b16eeb79e0d895 /include/linux/leds-pca9532.h | |
parent | fff26f8141145e01eae8f4d6e642ac8a0d500158 (diff) |
drivers/leds/leds-pca9532.c: add gpio capability
Allow unused leds on pca9532 to be used as gpio. The board I am working
on now has no less than 6 pca9532 chips. One chips is used for only leds,
one has 14 leds and 2 gpio and the rest of the chips are gpio only.
There is also one board in mainline which could use this capabilty;
arch/arm/mach-iop32x/n2100.c
232 { .type = PCA9532_TYPE_NONE }, /* power OFF gpio */
233 { .type = PCA9532_TYPE_NONE }, /* reset gpio */
This patch defines a new pin type, PCA9532_TYPE_GPIO, and registers a
gpiochip if any pin has this type set. The gpio will registers all chip
pins but will filter on gpio_request.
[randy.dunlap@oracle.com: fix build when GPIOLIB is not enabled]
Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jan Weitzel <j.weitzel@phytec.de>
Cc: Juergen Kilb <j.kilb@phytec.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/leds-pca9532.h')
-rw-r--r-- | include/linux/leds-pca9532.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index f158eb1149aa..b8d6fffed4d8 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -25,7 +25,7 @@ enum pca9532_state { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, | 27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, |
28 | PCA9532_TYPE_N2100_BEEP }; | 28 | PCA9532_TYPE_N2100_BEEP, PCA9532_TYPE_GPIO }; |
29 | 29 | ||
30 | struct pca9532_led { | 30 | struct pca9532_led { |
31 | u8 id; | 31 | u8 id; |
@@ -41,6 +41,7 @@ struct pca9532_platform_data { | |||
41 | struct pca9532_led leds[16]; | 41 | struct pca9532_led leds[16]; |
42 | u8 pwm[2]; | 42 | u8 pwm[2]; |
43 | u8 psc[2]; | 43 | u8 psc[2]; |
44 | int gpio_base; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif /* __LINUX_PCA9532_H */ | 47 | #endif /* __LINUX_PCA9532_H */ |