diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 23:26:27 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 23:26:27 -0400 |
| commit | aa0b3b2bee1d3ca8355de76caebf65b836c9bb6e (patch) | |
| tree | e1ba9eb2e96b55af1008162ec662b03ea24f9989 /include | |
| parent | 6ee127b7dd63afe4d6d0a58293786bf4bf336850 (diff) | |
| parent | d45bb11616c94c76c6e40960a120c0687b708a2e (diff) | |
Merge branch 'for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu.
* 'for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (50 commits)
leds-lp8788: forgotten unlock at lp8788_led_work
LEDS: propagate error codes in blinkm_detect()
LEDS: memory leak in blinkm_led_common_set()
leds: add new lp8788 led driver
LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS
leds: max8997: Simplify max8997_led_set_mode implementation
leds/leds-s3c24xx: use devm_gpio_request
leds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert DAC124S085 LED driver to devm_kzalloc()
leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert TCA6507 LED driver to devm_kzalloc()
leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path
leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA9532 LED driver to devm_kzalloc()
leds: convert LT3593 LED driver to devm_kzalloc()
leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path
leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA9633 LED driver to devm_kzalloc()
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/leds.h | 29 | ||||
| -rw-r--r-- | include/linux/platform_data/leds-lm3556.h | 50 |
2 files changed, 77 insertions, 2 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index 39eee41d8c6f..3aade1d8f410 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -38,6 +38,9 @@ struct led_classdev { | |||
| 38 | #define LED_SUSPENDED (1 << 0) | 38 | #define LED_SUSPENDED (1 << 0) |
| 39 | /* Upper 16 bits reflect control information */ | 39 | /* Upper 16 bits reflect control information */ |
| 40 | #define LED_CORE_SUSPENDRESUME (1 << 16) | 40 | #define LED_CORE_SUSPENDRESUME (1 << 16) |
| 41 | #define LED_BLINK_ONESHOT (1 << 17) | ||
| 42 | #define LED_BLINK_ONESHOT_STOP (1 << 18) | ||
| 43 | #define LED_BLINK_INVERT (1 << 19) | ||
| 41 | 44 | ||
| 42 | /* Set LED brightness level */ | 45 | /* Set LED brightness level */ |
| 43 | /* Must not sleep, use a workqueue if needed */ | 46 | /* Must not sleep, use a workqueue if needed */ |
| @@ -103,7 +106,25 @@ extern void led_blink_set(struct led_classdev *led_cdev, | |||
| 103 | unsigned long *delay_on, | 106 | unsigned long *delay_on, |
| 104 | unsigned long *delay_off); | 107 | unsigned long *delay_off); |
| 105 | /** | 108 | /** |
| 106 | * led_brightness_set - set LED brightness | 109 | * led_blink_set_oneshot - do a oneshot software blink |
| 110 | * @led_cdev: the LED to start blinking | ||
| 111 | * @delay_on: the time it should be on (in ms) | ||
| 112 | * @delay_off: the time it should ble off (in ms) | ||
| 113 | * @invert: blink off, then on, leaving the led on | ||
| 114 | * | ||
| 115 | * This function makes the LED blink one time for delay_on + | ||
| 116 | * delay_off time, ignoring the request if another one-shot | ||
| 117 | * blink is already in progress. | ||
| 118 | * | ||
| 119 | * If invert is set, led blinks for delay_off first, then for | ||
| 120 | * delay_on and leave the led on after the on-off cycle. | ||
| 121 | */ | ||
| 122 | extern void led_blink_set_oneshot(struct led_classdev *led_cdev, | ||
| 123 | unsigned long *delay_on, | ||
| 124 | unsigned long *delay_off, | ||
| 125 | int invert); | ||
| 126 | /** | ||
| 127 | * led_set_brightness - set LED brightness | ||
| 107 | * @led_cdev: the LED to set | 128 | * @led_cdev: the LED to set |
| 108 | * @brightness: the brightness to set it to | 129 | * @brightness: the brightness to set it to |
| 109 | * | 130 | * |
| @@ -111,7 +132,7 @@ extern void led_blink_set(struct led_classdev *led_cdev, | |||
| 111 | * software blink timer that implements blinking when the | 132 | * software blink timer that implements blinking when the |
| 112 | * hardware doesn't. | 133 | * hardware doesn't. |
| 113 | */ | 134 | */ |
| 114 | extern void led_brightness_set(struct led_classdev *led_cdev, | 135 | extern void led_set_brightness(struct led_classdev *led_cdev, |
| 115 | enum led_brightness brightness); | 136 | enum led_brightness brightness); |
| 116 | 137 | ||
| 117 | /* | 138 | /* |
| @@ -150,6 +171,10 @@ extern void led_trigger_event(struct led_trigger *trigger, | |||
| 150 | extern void led_trigger_blink(struct led_trigger *trigger, | 171 | extern void led_trigger_blink(struct led_trigger *trigger, |
| 151 | unsigned long *delay_on, | 172 | unsigned long *delay_on, |
| 152 | unsigned long *delay_off); | 173 | unsigned long *delay_off); |
| 174 | extern void led_trigger_blink_oneshot(struct led_trigger *trigger, | ||
| 175 | unsigned long *delay_on, | ||
| 176 | unsigned long *delay_off, | ||
| 177 | int invert); | ||
| 153 | 178 | ||
| 154 | #else | 179 | #else |
| 155 | 180 | ||
diff --git a/include/linux/platform_data/leds-lm3556.h b/include/linux/platform_data/leds-lm3556.h new file mode 100644 index 000000000000..4b4e7d6b0527 --- /dev/null +++ b/include/linux/platform_data/leds-lm3556.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Simple driver for Texas Instruments LM3556 LED Flash driver chip (Rev0x03) | ||
| 3 | * Copyright (C) 2012 Texas Instruments | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_LM3556_H | ||
| 12 | #define __LINUX_LM3556_H | ||
| 13 | |||
| 14 | #define LM3556_NAME "leds-lm3556" | ||
| 15 | |||
| 16 | enum lm3556_pin_polarity { | ||
| 17 | PIN_LOW_ACTIVE = 0, | ||
| 18 | PIN_HIGH_ACTIVE, | ||
| 19 | }; | ||
| 20 | |||
| 21 | enum lm3556_pin_enable { | ||
| 22 | PIN_DISABLED = 0, | ||
| 23 | PIN_ENABLED, | ||
| 24 | }; | ||
| 25 | |||
| 26 | enum lm3556_strobe_usuage { | ||
| 27 | STROBE_EDGE_DETECT = 0, | ||
| 28 | STROBE_LEVEL_DETECT, | ||
| 29 | }; | ||
| 30 | |||
| 31 | enum lm3556_indic_mode { | ||
| 32 | INDIC_MODE_INTERNAL = 0, | ||
| 33 | INDIC_MODE_EXTERNAL, | ||
| 34 | }; | ||
| 35 | |||
| 36 | struct lm3556_platform_data { | ||
| 37 | enum lm3556_pin_enable torch_pin_en; | ||
| 38 | enum lm3556_pin_polarity torch_pin_polarity; | ||
| 39 | |||
| 40 | enum lm3556_strobe_usuage strobe_usuage; | ||
| 41 | enum lm3556_pin_enable strobe_pin_en; | ||
| 42 | enum lm3556_pin_polarity strobe_pin_polarity; | ||
| 43 | |||
| 44 | enum lm3556_pin_enable tx_pin_en; | ||
| 45 | enum lm3556_pin_polarity tx_pin_polarity; | ||
| 46 | |||
| 47 | enum lm3556_indic_mode indicator_mode; | ||
| 48 | }; | ||
| 49 | |||
| 50 | #endif /* __LINUX_LM3556_H */ | ||
