diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 16:55:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 16:55:37 -0500 |
commit | d7d717fa889fc7a60c38497846c7618940a999d9 (patch) | |
tree | 8a19ffa13d305588a4433defb9f128ed68ecf47c /include | |
parent | b64dc5a4842c3420d7a093bf5e8979c57ceb789c (diff) | |
parent | ce70a24575414d615f6a7a05caf9b7e8f91a1b6f (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: ledtrig-timer - on deactivation hardware blinking should be disabled
leds: Add suspend/resume to the core class
leds: Add WM8350 LED driver
leds: leds-pcs9532 - Move i2c work to a workqueque
leds: leds-pca9532 - fix memory leak and properly handle errors
leds: Fix wrong loop direction on removal in leds-ams-delta
leds: fix Cobalt Raq LED dependency
leds: Fix sparse warning in leds-ams-delta
leds: Fixup kdoc comment to match parameter names
leds: Make header variable naming consistent
leds: eds-pca9532: mark pca9532_event() static
leds: ALIX.2 LEDs driver
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/leds-pca9532.h | 2 | ||||
-rw-r--r-- | include/linux/leds.h | 5 | ||||
-rw-r--r-- | include/linux/mfd/wm8350/pmic.h | 36 |
3 files changed, 42 insertions, 1 deletions
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index 81b4207deb95..96eea90f01a8 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define __LINUX_PCA9532_H | 15 | #define __LINUX_PCA9532_H |
16 | 16 | ||
17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
18 | #include <linux/workqueue.h> | ||
18 | 19 | ||
19 | enum pca9532_state { | 20 | enum pca9532_state { |
20 | PCA9532_OFF = 0x0, | 21 | PCA9532_OFF = 0x0, |
@@ -31,6 +32,7 @@ struct pca9532_led { | |||
31 | struct i2c_client *client; | 32 | struct i2c_client *client; |
32 | char *name; | 33 | char *name; |
33 | struct led_classdev ldev; | 34 | struct led_classdev ldev; |
35 | struct work_struct work; | ||
34 | enum pca9532_type type; | 36 | enum pca9532_type type; |
35 | enum pca9532_state state; | 37 | enum pca9532_state state; |
36 | }; | 38 | }; |
diff --git a/include/linux/leds.h b/include/linux/leds.h index d3a73f5a48c3..24489da701e3 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -32,7 +32,10 @@ struct led_classdev { | |||
32 | int brightness; | 32 | int brightness; |
33 | int flags; | 33 | int flags; |
34 | 34 | ||
35 | /* Lower 16 bits reflect status */ | ||
35 | #define LED_SUSPENDED (1 << 0) | 36 | #define LED_SUSPENDED (1 << 0) |
37 | /* Upper 16 bits reflect control information */ | ||
38 | #define LED_CORE_SUSPENDRESUME (1 << 16) | ||
36 | 39 | ||
37 | /* Set LED brightness level */ | 40 | /* Set LED brightness level */ |
38 | /* Must not sleep, use a workqueue if needed */ | 41 | /* Must not sleep, use a workqueue if needed */ |
@@ -62,7 +65,7 @@ struct led_classdev { | |||
62 | 65 | ||
63 | extern int led_classdev_register(struct device *parent, | 66 | extern int led_classdev_register(struct device *parent, |
64 | struct led_classdev *led_cdev); | 67 | struct led_classdev *led_cdev); |
65 | extern void led_classdev_unregister(struct led_classdev *lcd); | 68 | extern void led_classdev_unregister(struct led_classdev *led_cdev); |
66 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 69 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
67 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 70 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
68 | 71 | ||
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index 96acbfc8aa12..be3264e286e0 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #ifndef __LINUX_MFD_WM8350_PMIC_H | 13 | #ifndef __LINUX_MFD_WM8350_PMIC_H |
14 | #define __LINUX_MFD_WM8350_PMIC_H | 14 | #define __LINUX_MFD_WM8350_PMIC_H |
15 | 15 | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/leds.h> | ||
18 | #include <linux/regulator/machine.h> | ||
19 | |||
16 | /* | 20 | /* |
17 | * Register values. | 21 | * Register values. |
18 | */ | 22 | */ |
@@ -700,6 +704,33 @@ struct wm8350; | |||
700 | struct platform_device; | 704 | struct platform_device; |
701 | struct regulator_init_data; | 705 | struct regulator_init_data; |
702 | 706 | ||
707 | /* | ||
708 | * WM8350 LED platform data | ||
709 | */ | ||
710 | struct wm8350_led_platform_data { | ||
711 | const char *name; | ||
712 | const char *default_trigger; | ||
713 | int max_uA; | ||
714 | }; | ||
715 | |||
716 | struct wm8350_led { | ||
717 | struct platform_device *pdev; | ||
718 | struct mutex mutex; | ||
719 | struct work_struct work; | ||
720 | spinlock_t value_lock; | ||
721 | enum led_brightness value; | ||
722 | struct led_classdev cdev; | ||
723 | int max_uA_index; | ||
724 | int enabled; | ||
725 | |||
726 | struct regulator *isink; | ||
727 | struct regulator_consumer_supply isink_consumer; | ||
728 | struct regulator_init_data isink_init; | ||
729 | struct regulator *dcdc; | ||
730 | struct regulator_consumer_supply dcdc_consumer; | ||
731 | struct regulator_init_data dcdc_init; | ||
732 | }; | ||
733 | |||
703 | struct wm8350_pmic { | 734 | struct wm8350_pmic { |
704 | /* Number of regulators of each type on this device */ | 735 | /* Number of regulators of each type on this device */ |
705 | int max_dcdc; | 736 | int max_dcdc; |
@@ -717,10 +748,15 @@ struct wm8350_pmic { | |||
717 | 748 | ||
718 | /* regulator devices */ | 749 | /* regulator devices */ |
719 | struct platform_device *pdev[NUM_WM8350_REGULATORS]; | 750 | struct platform_device *pdev[NUM_WM8350_REGULATORS]; |
751 | |||
752 | /* LED devices */ | ||
753 | struct wm8350_led led[2]; | ||
720 | }; | 754 | }; |
721 | 755 | ||
722 | int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | 756 | int wm8350_register_regulator(struct wm8350 *wm8350, int reg, |
723 | struct regulator_init_data *initdata); | 757 | struct regulator_init_data *initdata); |
758 | int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink, | ||
759 | struct wm8350_led_platform_data *pdata); | ||
724 | 760 | ||
725 | /* | 761 | /* |
726 | * Additional DCDC control not supported via regulator API | 762 | * Additional DCDC control not supported via regulator API |