aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/leds.h29
-rw-r--r--include/linux/platform_data/leds-lm3556.h50
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 */
122extern 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 */
114extern void led_brightness_set(struct led_classdev *led_cdev, 135extern 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,
150extern void led_trigger_blink(struct led_trigger *trigger, 171extern 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);
174extern 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
16enum lm3556_pin_polarity {
17 PIN_LOW_ACTIVE = 0,
18 PIN_HIGH_ACTIVE,
19};
20
21enum lm3556_pin_enable {
22 PIN_DISABLED = 0,
23 PIN_ENABLED,
24};
25
26enum lm3556_strobe_usuage {
27 STROBE_EDGE_DETECT = 0,
28 STROBE_LEVEL_DETECT,
29};
30
31enum lm3556_indic_mode {
32 INDIC_MODE_INTERNAL = 0,
33 INDIC_MODE_EXTERNAL,
34};
35
36struct 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 */