aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 18:41:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 18:41:42 -0400
commit2b69703fea185bb0ae1af78ca2da41af677b9dff (patch)
tree26b13044a0a20bed5525638d193e776f31f70af2 /include/linux
parent30c67e93c526639aaac90fa873800104b7c16d16 (diff)
parentdf92d5ff5e70999274f53884cc2c40ae620a109a (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem updates from Bryan Wu: - move LED trigger drivers into a new directory - lp55xx common driver updates - other led drivers updates and bug fixing * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: leds: leds-asic3: switch to using SIMPLE_DEV_PM_OPS leds: leds-bd2802: add CONFIG_PM_SLEEP to suspend/resume functions leds: lp55xx: configure the clock detection leds: lp55xx: use common clock framework when external clock is used leds: leds-ns2: fix oops at module removal leds: leds-pwm: Defer led_pwm_set() if PWM can sleep leds: lp55xx: fix the sysfs read operation leds: lm355x, lm3642: support camera LED triggers for flash and torch leds: add camera LED triggers leds: trigger: use inline functions instead of macros leds: tca6507: Use of_match_ptr() macro leds: wm8350: Complain if we fail to reenable DCDC leds: renesas: set gpio_request_one() flags param correctly leds: leds-ns2: set devm_gpio_request_one() flags param correctly leds: leds-lt3593: set devm_gpio_request_one() flags param correctly leds: leds-bd2802: remove erroneous __exit annotation leds: atmel-pwm: remove erroneous __exit annotation leds: move LED trigger drivers into new subdirectory leds: add new LP5562 LED driver
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/leds.h33
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/platform_data/leds-lp55xx.h21
3 files changed, 25 insertions, 31 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 0d9b5eed714e..0287ab296689 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -142,6 +142,10 @@ extern void led_set_brightness(struct led_classdev *led_cdev,
142/* 142/*
143 * LED Triggers 143 * LED Triggers
144 */ 144 */
145/* Registration functions for simple triggers */
146#define DEFINE_LED_TRIGGER(x) static struct led_trigger *x;
147#define DEFINE_LED_TRIGGER_GLOBAL(x) struct led_trigger *x;
148
145#ifdef CONFIG_LEDS_TRIGGERS 149#ifdef CONFIG_LEDS_TRIGGERS
146 150
147#define TRIG_NAME_MAX 50 151#define TRIG_NAME_MAX 50
@@ -164,9 +168,6 @@ struct led_trigger {
164extern int led_trigger_register(struct led_trigger *trigger); 168extern int led_trigger_register(struct led_trigger *trigger);
165extern void led_trigger_unregister(struct led_trigger *trigger); 169extern void led_trigger_unregister(struct led_trigger *trigger);
166 170
167/* Registration functions for simple triggers */
168#define DEFINE_LED_TRIGGER(x) static struct led_trigger *x;
169#define DEFINE_LED_TRIGGER_GLOBAL(x) struct led_trigger *x;
170extern void led_trigger_register_simple(const char *name, 171extern void led_trigger_register_simple(const char *name,
171 struct led_trigger **trigger); 172 struct led_trigger **trigger);
172extern void led_trigger_unregister_simple(struct led_trigger *trigger); 173extern void led_trigger_unregister_simple(struct led_trigger *trigger);
@@ -199,20 +200,30 @@ extern void led_trigger_rename_static(const char *name,
199 200
200#else 201#else
201 202
202/* Triggers aren't active - null macros */ 203/* Trigger has no members */
203#define DEFINE_LED_TRIGGER(x) 204struct led_trigger {};
204#define DEFINE_LED_TRIGGER_GLOBAL(x)
205#define led_trigger_register_simple(x, y) do {} while(0)
206#define led_trigger_unregister_simple(x) do {} while(0)
207#define led_trigger_event(x, y) do {} while(0)
208 205
209#endif 206/* Trigger inline empty functions */
207static inline void led_trigger_register_simple(const char *name,
208 struct led_trigger **trigger) {}
209static inline void led_trigger_unregister_simple(struct led_trigger *trigger) {}
210static inline void led_trigger_event(struct led_trigger *trigger,
211 enum led_brightness event) {}
212#endif /* CONFIG_LEDS_TRIGGERS */
210 213
211/* Trigger specific functions */ 214/* Trigger specific functions */
212#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK 215#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
213extern void ledtrig_ide_activity(void); 216extern void ledtrig_ide_activity(void);
214#else 217#else
215#define ledtrig_ide_activity() do {} while(0) 218static inline void ledtrig_ide_activity(void) {}
219#endif
220
221#if defined(CONFIG_LEDS_TRIGGER_CAMERA) || defined(CONFIG_LEDS_TRIGGER_CAMERA_MODULE)
222extern void ledtrig_flash_ctrl(bool on);
223extern void ledtrig_torch_ctrl(bool on);
224#else
225static inline void ledtrig_flash_ctrl(bool on) {}
226static inline void ledtrig_torch_ctrl(bool on) {}
216#endif 227#endif
217 228
218/* 229/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8873e8349597..e326ae2882a0 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -342,9 +342,7 @@ struct mmc_host {
342 342
343 mmc_pm_flag_t pm_flags; /* requested pm features */ 343 mmc_pm_flag_t pm_flags; /* requested pm features */
344 344
345#ifdef CONFIG_LEDS_TRIGGERS
346 struct led_trigger *led; /* activity led */ 345 struct led_trigger *led; /* activity led */
347#endif
348 346
349#ifdef CONFIG_REGULATOR 347#ifdef CONFIG_REGULATOR
350 bool regulator_enabled; /* regulator state */ 348 bool regulator_enabled; /* regulator state */
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h
index 1509570d5a3f..202e290faea8 100644
--- a/include/linux/platform_data/leds-lp55xx.h
+++ b/include/linux/platform_data/leds-lp55xx.h
@@ -20,18 +20,6 @@
20#define LP55XX_CLOCK_INT 1 20#define LP55XX_CLOCK_INT 1
21#define LP55XX_CLOCK_EXT 2 21#define LP55XX_CLOCK_EXT 2
22 22
23/* Bits in LP5521 CONFIG register. 'update_config' in lp55xx_platform_data */
24#define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */
25#define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */
26#define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */
27#define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */
28#define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */
29#define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */
30#define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */
31#define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */
32#define LP5521_CLK_INT 1 /* Internal clock */
33#define LP5521_CLK_AUTO 2 /* Automatic clock selection */
34
35struct lp55xx_led_config { 23struct lp55xx_led_config {
36 const char *name; 24 const char *name;
37 u8 chan_nr; 25 u8 chan_nr;
@@ -40,9 +28,9 @@ struct lp55xx_led_config {
40}; 28};
41 29
42struct lp55xx_predef_pattern { 30struct lp55xx_predef_pattern {
43 u8 *r; 31 const u8 *r;
44 u8 *g; 32 const u8 *g;
45 u8 *b; 33 const u8 *b;
46 u8 size_r; 34 u8 size_r;
47 u8 size_g; 35 u8 size_g;
48 u8 size_b; 36 u8 size_b;
@@ -79,9 +67,6 @@ struct lp55xx_platform_data {
79 /* Predefined pattern data */ 67 /* Predefined pattern data */
80 struct lp55xx_predef_pattern *patterns; 68 struct lp55xx_predef_pattern *patterns;
81 unsigned int num_patterns; 69 unsigned int num_patterns;
82
83 /* _CONFIG register */
84 u8 update_config;
85}; 70};
86 71
87#endif /* _LEDS_LP55XX_H */ 72#endif /* _LEDS_LP55XX_H */