diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/leds/Kconfig | 80 | ||||
-rw-r--r-- | drivers/leds/Makefile | 1 | ||||
-rw-r--r-- | drivers/leds/dell-led.c | 200 | ||||
-rw-r--r-- | drivers/leds/led-class.c | 42 | ||||
-rw-r--r-- | drivers/leds/leds-gpio.c | 3 | ||||
-rw-r--r-- | drivers/leds/leds-ss4200.c | 2 |
6 files changed, 257 insertions, 71 deletions
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index e0b64312e66a..505eb64c329c 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -15,6 +15,8 @@ config LEDS_CLASS | |||
15 | This option enables the led sysfs class in /sys/class/leds. You'll | 15 | This option enables the led sysfs class in /sys/class/leds. You'll |
16 | need this to do anything useful with LEDs. If unsure, say N. | 16 | need this to do anything useful with LEDs. If unsure, say N. |
17 | 17 | ||
18 | if LEDS_CLASS | ||
19 | |||
18 | comment "LED drivers" | 20 | comment "LED drivers" |
19 | 21 | ||
20 | config LEDS_88PM860X | 22 | config LEDS_88PM860X |
@@ -26,73 +28,73 @@ config LEDS_88PM860X | |||
26 | 28 | ||
27 | config LEDS_ATMEL_PWM | 29 | config LEDS_ATMEL_PWM |
28 | tristate "LED Support using Atmel PWM outputs" | 30 | tristate "LED Support using Atmel PWM outputs" |
29 | depends on LEDS_CLASS && ATMEL_PWM | 31 | depends on ATMEL_PWM |
30 | help | 32 | help |
31 | This option enables support for LEDs driven using outputs | 33 | This option enables support for LEDs driven using outputs |
32 | of the dedicated PWM controller found on newer Atmel SOCs. | 34 | of the dedicated PWM controller found on newer Atmel SOCs. |
33 | 35 | ||
34 | config LEDS_LOCOMO | 36 | config LEDS_LOCOMO |
35 | tristate "LED Support for Locomo device" | 37 | tristate "LED Support for Locomo device" |
36 | depends on LEDS_CLASS && SHARP_LOCOMO | 38 | depends on SHARP_LOCOMO |
37 | help | 39 | help |
38 | This option enables support for the LEDs on Sharp Locomo. | 40 | This option enables support for the LEDs on Sharp Locomo. |
39 | Zaurus models SL-5500 and SL-5600. | 41 | Zaurus models SL-5500 and SL-5600. |
40 | 42 | ||
41 | config LEDS_MIKROTIK_RB532 | 43 | config LEDS_MIKROTIK_RB532 |
42 | tristate "LED Support for Mikrotik Routerboard 532" | 44 | tristate "LED Support for Mikrotik Routerboard 532" |
43 | depends on LEDS_CLASS && MIKROTIK_RB532 | 45 | depends on MIKROTIK_RB532 |
44 | help | 46 | help |
45 | This option enables support for the so called "User LED" of | 47 | This option enables support for the so called "User LED" of |
46 | Mikrotik's Routerboard 532. | 48 | Mikrotik's Routerboard 532. |
47 | 49 | ||
48 | config LEDS_S3C24XX | 50 | config LEDS_S3C24XX |
49 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" | 51 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" |
50 | depends on LEDS_CLASS && ARCH_S3C2410 | 52 | depends on ARCH_S3C2410 |
51 | help | 53 | help |
52 | This option enables support for LEDs connected to GPIO lines | 54 | This option enables support for LEDs connected to GPIO lines |
53 | on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440. | 55 | on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440. |
54 | 56 | ||
55 | config LEDS_AMS_DELTA | 57 | config LEDS_AMS_DELTA |
56 | tristate "LED Support for the Amstrad Delta (E3)" | 58 | tristate "LED Support for the Amstrad Delta (E3)" |
57 | depends on LEDS_CLASS && MACH_AMS_DELTA | 59 | depends on MACH_AMS_DELTA |
58 | help | 60 | help |
59 | This option enables support for the LEDs on Amstrad Delta (E3). | 61 | This option enables support for the LEDs on Amstrad Delta (E3). |
60 | 62 | ||
61 | config LEDS_NET48XX | 63 | config LEDS_NET48XX |
62 | tristate "LED Support for Soekris net48xx series Error LED" | 64 | tristate "LED Support for Soekris net48xx series Error LED" |
63 | depends on LEDS_CLASS && SCx200_GPIO | 65 | depends on SCx200_GPIO |
64 | help | 66 | help |
65 | This option enables support for the Soekris net4801 and net4826 error | 67 | This option enables support for the Soekris net4801 and net4826 error |
66 | LED. | 68 | LED. |
67 | 69 | ||
68 | config LEDS_FSG | 70 | config LEDS_FSG |
69 | tristate "LED Support for the Freecom FSG-3" | 71 | tristate "LED Support for the Freecom FSG-3" |
70 | depends on LEDS_CLASS && MACH_FSG | 72 | depends on MACH_FSG |
71 | help | 73 | help |
72 | This option enables support for the LEDs on the Freecom FSG-3. | 74 | This option enables support for the LEDs on the Freecom FSG-3. |
73 | 75 | ||
74 | config LEDS_WRAP | 76 | config LEDS_WRAP |
75 | tristate "LED Support for the WRAP series LEDs" | 77 | tristate "LED Support for the WRAP series LEDs" |
76 | depends on LEDS_CLASS && SCx200_GPIO | 78 | depends on SCx200_GPIO |
77 | help | 79 | help |
78 | This option enables support for the PCEngines WRAP programmable LEDs. | 80 | This option enables support for the PCEngines WRAP programmable LEDs. |
79 | 81 | ||
80 | config LEDS_ALIX2 | 82 | config LEDS_ALIX2 |
81 | tristate "LED Support for ALIX.2 and ALIX.3 series" | 83 | tristate "LED Support for ALIX.2 and ALIX.3 series" |
82 | depends on LEDS_CLASS && X86 && EXPERIMENTAL | 84 | depends on X86 && !GPIO_CS5535 && !CS5535_GPIO |
83 | help | 85 | help |
84 | This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs. | 86 | This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs. |
85 | You have to set leds-alix2.force=1 for boards with Award BIOS. | 87 | You have to set leds-alix2.force=1 for boards with Award BIOS. |
86 | 88 | ||
87 | config LEDS_H1940 | 89 | config LEDS_H1940 |
88 | tristate "LED Support for iPAQ H1940 device" | 90 | tristate "LED Support for iPAQ H1940 device" |
89 | depends on LEDS_CLASS && ARCH_H1940 | 91 | depends on ARCH_H1940 |
90 | help | 92 | help |
91 | This option enables support for the LEDs on the h1940. | 93 | This option enables support for the LEDs on the h1940. |
92 | 94 | ||
93 | config LEDS_COBALT_QUBE | 95 | config LEDS_COBALT_QUBE |
94 | tristate "LED Support for the Cobalt Qube series front LED" | 96 | tristate "LED Support for the Cobalt Qube series front LED" |
95 | depends on LEDS_CLASS && MIPS_COBALT | 97 | depends on MIPS_COBALT |
96 | help | 98 | help |
97 | This option enables support for the front LED on Cobalt Qube series | 99 | This option enables support for the front LED on Cobalt Qube series |
98 | 100 | ||
@@ -105,7 +107,7 @@ config LEDS_COBALT_RAQ | |||
105 | 107 | ||
106 | config LEDS_SUNFIRE | 108 | config LEDS_SUNFIRE |
107 | tristate "LED support for SunFire servers." | 109 | tristate "LED support for SunFire servers." |
108 | depends on LEDS_CLASS && SPARC64 | 110 | depends on SPARC64 |
109 | select LEDS_TRIGGERS | 111 | select LEDS_TRIGGERS |
110 | help | 112 | help |
111 | This option enables support for the Left, Middle, and Right | 113 | This option enables support for the Left, Middle, and Right |
@@ -113,14 +115,14 @@ config LEDS_SUNFIRE | |||
113 | 115 | ||
114 | config LEDS_HP6XX | 116 | config LEDS_HP6XX |
115 | tristate "LED Support for the HP Jornada 6xx" | 117 | tristate "LED Support for the HP Jornada 6xx" |
116 | depends on LEDS_CLASS && SH_HP6XX | 118 | depends on SH_HP6XX |
117 | help | 119 | help |
118 | This option enables LED support for the handheld | 120 | This option enables LED support for the handheld |
119 | HP Jornada 620/660/680/690. | 121 | HP Jornada 620/660/680/690. |
120 | 122 | ||
121 | config LEDS_PCA9532 | 123 | config LEDS_PCA9532 |
122 | tristate "LED driver for PCA9532 dimmer" | 124 | tristate "LED driver for PCA9532 dimmer" |
123 | depends on LEDS_CLASS && I2C && INPUT && EXPERIMENTAL | 125 | depends on I2C && INPUT && EXPERIMENTAL |
124 | help | 126 | help |
125 | This option enables support for NXP pca9532 | 127 | This option enables support for NXP pca9532 |
126 | LED controller. It is generally only useful | 128 | LED controller. It is generally only useful |
@@ -128,7 +130,7 @@ config LEDS_PCA9532 | |||
128 | 130 | ||
129 | config LEDS_GPIO | 131 | config LEDS_GPIO |
130 | tristate "LED Support for GPIO connected LEDs" | 132 | tristate "LED Support for GPIO connected LEDs" |
131 | depends on LEDS_CLASS && GENERIC_GPIO | 133 | depends on GENERIC_GPIO |
132 | help | 134 | help |
133 | This option enables support for the LEDs connected to GPIO | 135 | This option enables support for the LEDs connected to GPIO |
134 | outputs. To be useful the particular board must have LEDs | 136 | outputs. To be useful the particular board must have LEDs |
@@ -155,7 +157,7 @@ config LEDS_GPIO_OF | |||
155 | 157 | ||
156 | config LEDS_LP3944 | 158 | config LEDS_LP3944 |
157 | tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip" | 159 | tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip" |
158 | depends on LEDS_CLASS && I2C | 160 | depends on I2C |
159 | help | 161 | help |
160 | This option enables support for LEDs connected to the National | 162 | This option enables support for LEDs connected to the National |
161 | Semiconductor LP3944 Lighting Management Unit (LMU) also known as | 163 | Semiconductor LP3944 Lighting Management Unit (LMU) also known as |
@@ -166,7 +168,7 @@ config LEDS_LP3944 | |||
166 | 168 | ||
167 | config LEDS_CLEVO_MAIL | 169 | config LEDS_CLEVO_MAIL |
168 | tristate "Mail LED on Clevo notebook" | 170 | tristate "Mail LED on Clevo notebook" |
169 | depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI | 171 | depends on X86 && SERIO_I8042 && DMI |
170 | help | 172 | help |
171 | This driver makes the mail LED accessible from userspace | 173 | This driver makes the mail LED accessible from userspace |
172 | programs through the leds subsystem. This LED have three | 174 | programs through the leds subsystem. This LED have three |
@@ -196,7 +198,7 @@ config LEDS_CLEVO_MAIL | |||
196 | 198 | ||
197 | config LEDS_PCA955X | 199 | config LEDS_PCA955X |
198 | tristate "LED Support for PCA955x I2C chips" | 200 | tristate "LED Support for PCA955x I2C chips" |
199 | depends on LEDS_CLASS && I2C | 201 | depends on I2C |
200 | help | 202 | help |
201 | This option enables support for LEDs connected to PCA955x | 203 | This option enables support for LEDs connected to PCA955x |
202 | LED driver chips accessed via the I2C bus. Supported | 204 | LED driver chips accessed via the I2C bus. Supported |
@@ -204,54 +206,54 @@ config LEDS_PCA955X | |||
204 | 206 | ||
205 | config LEDS_WM831X_STATUS | 207 | config LEDS_WM831X_STATUS |
206 | tristate "LED support for status LEDs on WM831x PMICs" | 208 | tristate "LED support for status LEDs on WM831x PMICs" |
207 | depends on LEDS_CLASS && MFD_WM831X | 209 | depends on MFD_WM831X |
208 | help | 210 | help |
209 | This option enables support for the status LEDs of the WM831x | 211 | This option enables support for the status LEDs of the WM831x |
210 | series of PMICs. | 212 | series of PMICs. |
211 | 213 | ||
212 | config LEDS_WM8350 | 214 | config LEDS_WM8350 |
213 | tristate "LED Support for WM8350 AudioPlus PMIC" | 215 | tristate "LED Support for WM8350 AudioPlus PMIC" |
214 | depends on LEDS_CLASS && MFD_WM8350 | 216 | depends on MFD_WM8350 |
215 | help | 217 | help |
216 | This option enables support for LEDs driven by the Wolfson | 218 | This option enables support for LEDs driven by the Wolfson |
217 | Microelectronics WM8350 AudioPlus PMIC. | 219 | Microelectronics WM8350 AudioPlus PMIC. |
218 | 220 | ||
219 | config LEDS_DA903X | 221 | config LEDS_DA903X |
220 | tristate "LED Support for DA9030/DA9034 PMIC" | 222 | tristate "LED Support for DA9030/DA9034 PMIC" |
221 | depends on LEDS_CLASS && PMIC_DA903X | 223 | depends on PMIC_DA903X |
222 | help | 224 | help |
223 | This option enables support for on-chip LED drivers found | 225 | This option enables support for on-chip LED drivers found |
224 | on Dialog Semiconductor DA9030/DA9034 PMICs. | 226 | on Dialog Semiconductor DA9030/DA9034 PMICs. |
225 | 227 | ||
226 | config LEDS_DAC124S085 | 228 | config LEDS_DAC124S085 |
227 | tristate "LED Support for DAC124S085 SPI DAC" | 229 | tristate "LED Support for DAC124S085 SPI DAC" |
228 | depends on LEDS_CLASS && SPI | 230 | depends on SPI |
229 | help | 231 | help |
230 | This option enables support for DAC124S085 SPI DAC from NatSemi, | 232 | This option enables support for DAC124S085 SPI DAC from NatSemi, |
231 | which can be used to control up to four LEDs. | 233 | which can be used to control up to four LEDs. |
232 | 234 | ||
233 | config LEDS_PWM | 235 | config LEDS_PWM |
234 | tristate "PWM driven LED Support" | 236 | tristate "PWM driven LED Support" |
235 | depends on LEDS_CLASS && HAVE_PWM | 237 | depends on HAVE_PWM |
236 | help | 238 | help |
237 | This option enables support for pwm driven LEDs | 239 | This option enables support for pwm driven LEDs |
238 | 240 | ||
239 | config LEDS_REGULATOR | 241 | config LEDS_REGULATOR |
240 | tristate "REGULATOR driven LED support" | 242 | tristate "REGULATOR driven LED support" |
241 | depends on LEDS_CLASS && REGULATOR | 243 | depends on REGULATOR |
242 | help | 244 | help |
243 | This option enables support for regulator driven LEDs. | 245 | This option enables support for regulator driven LEDs. |
244 | 246 | ||
245 | config LEDS_BD2802 | 247 | config LEDS_BD2802 |
246 | tristate "LED driver for BD2802 RGB LED" | 248 | tristate "LED driver for BD2802 RGB LED" |
247 | depends on LEDS_CLASS && I2C | 249 | depends on I2C |
248 | help | 250 | help |
249 | This option enables support for BD2802GU RGB LED driver chips | 251 | This option enables support for BD2802GU RGB LED driver chips |
250 | accessed via the I2C bus. | 252 | accessed via the I2C bus. |
251 | 253 | ||
252 | config LEDS_INTEL_SS4200 | 254 | config LEDS_INTEL_SS4200 |
253 | tristate "LED driver for Intel NAS SS4200 series" | 255 | tristate "LED driver for Intel NAS SS4200 series" |
254 | depends on LEDS_CLASS && PCI && DMI | 256 | depends on PCI && DMI |
255 | help | 257 | help |
256 | This option enables support for the Intel SS4200 series of | 258 | This option enables support for the Intel SS4200 series of |
257 | Network Attached Storage servers. You may control the hard | 259 | Network Attached Storage servers. You may control the hard |
@@ -260,7 +262,7 @@ config LEDS_INTEL_SS4200 | |||
260 | 262 | ||
261 | config LEDS_LT3593 | 263 | config LEDS_LT3593 |
262 | tristate "LED driver for LT3593 controllers" | 264 | tristate "LED driver for LT3593 controllers" |
263 | depends on LEDS_CLASS && GENERIC_GPIO | 265 | depends on GENERIC_GPIO |
264 | help | 266 | help |
265 | This option enables support for LEDs driven by a Linear Technology | 267 | This option enables support for LEDs driven by a Linear Technology |
266 | LT3593 controller. This controller uses a special one-wire pulse | 268 | LT3593 controller. This controller uses a special one-wire pulse |
@@ -268,7 +270,7 @@ config LEDS_LT3593 | |||
268 | 270 | ||
269 | config LEDS_ADP5520 | 271 | config LEDS_ADP5520 |
270 | tristate "LED Support for ADP5520/ADP5501 PMIC" | 272 | tristate "LED Support for ADP5520/ADP5501 PMIC" |
271 | depends on LEDS_CLASS && PMIC_ADP5520 | 273 | depends on PMIC_ADP5520 |
272 | help | 274 | help |
273 | This option enables support for on-chip LED drivers found | 275 | This option enables support for on-chip LED drivers found |
274 | on Analog Devices ADP5520/ADP5501 PMICs. | 276 | on Analog Devices ADP5520/ADP5501 PMICs. |
@@ -276,7 +278,12 @@ config LEDS_ADP5520 | |||
276 | To compile this driver as a module, choose M here: the module will | 278 | To compile this driver as a module, choose M here: the module will |
277 | be called leds-adp5520. | 279 | be called leds-adp5520. |
278 | 280 | ||
279 | comment "LED Triggers" | 281 | config LEDS_DELL_NETBOOKS |
282 | tristate "External LED on Dell Business Netbooks" | ||
283 | depends on X86 && ACPI_WMI | ||
284 | help | ||
285 | This adds support for the Latitude 2100 and similar | ||
286 | notebooks that have an external LED. | ||
280 | 287 | ||
281 | config LEDS_TRIGGERS | 288 | config LEDS_TRIGGERS |
282 | bool "LED Trigger support" | 289 | bool "LED Trigger support" |
@@ -285,9 +292,12 @@ config LEDS_TRIGGERS | |||
285 | These triggers allow kernel events to drive the LEDs and can | 292 | These triggers allow kernel events to drive the LEDs and can |
286 | be configured via sysfs. If unsure, say Y. | 293 | be configured via sysfs. If unsure, say Y. |
287 | 294 | ||
295 | if LEDS_TRIGGERS | ||
296 | |||
297 | comment "LED Triggers" | ||
298 | |||
288 | config LEDS_TRIGGER_TIMER | 299 | config LEDS_TRIGGER_TIMER |
289 | tristate "LED Timer Trigger" | 300 | tristate "LED Timer Trigger" |
290 | depends on LEDS_TRIGGERS | ||
291 | help | 301 | help |
292 | This allows LEDs to be controlled by a programmable timer | 302 | This allows LEDs to be controlled by a programmable timer |
293 | via sysfs. Some LED hardware can be programmed to start | 303 | via sysfs. Some LED hardware can be programmed to start |
@@ -298,14 +308,13 @@ config LEDS_TRIGGER_TIMER | |||
298 | 308 | ||
299 | config LEDS_TRIGGER_IDE_DISK | 309 | config LEDS_TRIGGER_IDE_DISK |
300 | bool "LED IDE Disk Trigger" | 310 | bool "LED IDE Disk Trigger" |
301 | depends on LEDS_TRIGGERS && IDE_GD_ATA | 311 | depends on IDE_GD_ATA |
302 | help | 312 | help |
303 | This allows LEDs to be controlled by IDE disk activity. | 313 | This allows LEDs to be controlled by IDE disk activity. |
304 | If unsure, say Y. | 314 | If unsure, say Y. |
305 | 315 | ||
306 | config LEDS_TRIGGER_HEARTBEAT | 316 | config LEDS_TRIGGER_HEARTBEAT |
307 | tristate "LED Heartbeat Trigger" | 317 | tristate "LED Heartbeat Trigger" |
308 | depends on LEDS_TRIGGERS | ||
309 | help | 318 | help |
310 | This allows LEDs to be controlled by a CPU load average. | 319 | This allows LEDs to be controlled by a CPU load average. |
311 | The flash frequency is a hyperbolic function of the 1-minute | 320 | The flash frequency is a hyperbolic function of the 1-minute |
@@ -314,7 +323,6 @@ config LEDS_TRIGGER_HEARTBEAT | |||
314 | 323 | ||
315 | config LEDS_TRIGGER_BACKLIGHT | 324 | config LEDS_TRIGGER_BACKLIGHT |
316 | tristate "LED backlight Trigger" | 325 | tristate "LED backlight Trigger" |
317 | depends on LEDS_TRIGGERS | ||
318 | help | 326 | help |
319 | This allows LEDs to be controlled as a backlight device: they | 327 | This allows LEDs to be controlled as a backlight device: they |
320 | turn off and on when the display is blanked and unblanked. | 328 | turn off and on when the display is blanked and unblanked. |
@@ -323,7 +331,6 @@ config LEDS_TRIGGER_BACKLIGHT | |||
323 | 331 | ||
324 | config LEDS_TRIGGER_GPIO | 332 | config LEDS_TRIGGER_GPIO |
325 | tristate "LED GPIO Trigger" | 333 | tristate "LED GPIO Trigger" |
326 | depends on LEDS_TRIGGERS | ||
327 | depends on GPIOLIB | 334 | depends on GPIOLIB |
328 | help | 335 | help |
329 | This allows LEDs to be controlled by gpio events. It's good | 336 | This allows LEDs to be controlled by gpio events. It's good |
@@ -336,7 +343,6 @@ config LEDS_TRIGGER_GPIO | |||
336 | 343 | ||
337 | config LEDS_TRIGGER_DEFAULT_ON | 344 | config LEDS_TRIGGER_DEFAULT_ON |
338 | tristate "LED Default ON Trigger" | 345 | tristate "LED Default ON Trigger" |
339 | depends on LEDS_TRIGGERS | ||
340 | help | 346 | help |
341 | This allows LEDs to be initialised in the ON state. | 347 | This allows LEDs to be initialised in the ON state. |
342 | If unsure, say Y. | 348 | If unsure, say Y. |
@@ -344,4 +350,8 @@ config LEDS_TRIGGER_DEFAULT_ON | |||
344 | comment "iptables trigger is under Netfilter config (LED target)" | 350 | comment "iptables trigger is under Netfilter config (LED target)" |
345 | depends on LEDS_TRIGGERS | 351 | depends on LEDS_TRIGGERS |
346 | 352 | ||
353 | endif # LEDS_TRIGGERS | ||
354 | |||
355 | endif # LEDS_CLASS | ||
356 | |||
347 | endif # NEW_LEDS | 357 | endif # NEW_LEDS |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index d76fb32b77c0..0cd8b9957380 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -34,6 +34,7 @@ obj-$(CONFIG_LEDS_REGULATOR) += leds-regulator.o | |||
34 | obj-$(CONFIG_LEDS_INTEL_SS4200) += leds-ss4200.o | 34 | obj-$(CONFIG_LEDS_INTEL_SS4200) += leds-ss4200.o |
35 | obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o | 35 | obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o |
36 | obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o | 36 | obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o |
37 | obj-$(CONFIG_LEDS_DELL_NETBOOKS) += dell-led.o | ||
37 | 38 | ||
38 | # LED SPI Drivers | 39 | # LED SPI Drivers |
39 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o | 40 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o |
diff --git a/drivers/leds/dell-led.c b/drivers/leds/dell-led.c new file mode 100644 index 000000000000..ee310891fff8 --- /dev/null +++ b/drivers/leds/dell-led.c | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * dell_led.c - Dell LED Driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Dell Inc. | ||
5 | * Louis Davis <louis_davis@dell.com> | ||
6 | * Jim Dailey <jim_dailey@dell.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/acpi.h> | ||
15 | #include <linux/leds.h> | ||
16 | |||
17 | MODULE_AUTHOR("Louis Davis/Jim Dailey"); | ||
18 | MODULE_DESCRIPTION("Dell LED Control Driver"); | ||
19 | MODULE_LICENSE("GPL"); | ||
20 | |||
21 | #define DELL_LED_BIOS_GUID "F6E4FE6E-909D-47cb-8BAB-C9F6F2F8D396" | ||
22 | MODULE_ALIAS("wmi:" DELL_LED_BIOS_GUID); | ||
23 | |||
24 | /* Error Result Codes: */ | ||
25 | #define INVALID_DEVICE_ID 250 | ||
26 | #define INVALID_PARAMETER 251 | ||
27 | #define INVALID_BUFFER 252 | ||
28 | #define INTERFACE_ERROR 253 | ||
29 | #define UNSUPPORTED_COMMAND 254 | ||
30 | #define UNSPECIFIED_ERROR 255 | ||
31 | |||
32 | /* Device ID */ | ||
33 | #define DEVICE_ID_PANEL_BACK 1 | ||
34 | |||
35 | /* LED Commands */ | ||
36 | #define CMD_LED_ON 16 | ||
37 | #define CMD_LED_OFF 17 | ||
38 | #define CMD_LED_BLINK 18 | ||
39 | |||
40 | struct bios_args { | ||
41 | unsigned char length; | ||
42 | unsigned char result_code; | ||
43 | unsigned char device_id; | ||
44 | unsigned char command; | ||
45 | unsigned char on_time; | ||
46 | unsigned char off_time; | ||
47 | }; | ||
48 | |||
49 | static int dell_led_perform_fn(u8 length, | ||
50 | u8 result_code, | ||
51 | u8 device_id, | ||
52 | u8 command, | ||
53 | u8 on_time, | ||
54 | u8 off_time) | ||
55 | { | ||
56 | struct bios_args *bios_return; | ||
57 | u8 return_code; | ||
58 | union acpi_object *obj; | ||
59 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | ||
60 | struct acpi_buffer input; | ||
61 | acpi_status status; | ||
62 | |||
63 | struct bios_args args; | ||
64 | args.length = length; | ||
65 | args.result_code = result_code; | ||
66 | args.device_id = device_id; | ||
67 | args.command = command; | ||
68 | args.on_time = on_time; | ||
69 | args.off_time = off_time; | ||
70 | |||
71 | input.length = sizeof(struct bios_args); | ||
72 | input.pointer = &args; | ||
73 | |||
74 | status = wmi_evaluate_method(DELL_LED_BIOS_GUID, | ||
75 | 1, | ||
76 | 1, | ||
77 | &input, | ||
78 | &output); | ||
79 | |||
80 | if (ACPI_FAILURE(status)) | ||
81 | return status; | ||
82 | |||
83 | obj = output.pointer; | ||
84 | |||
85 | if (!obj) | ||
86 | return -EINVAL; | ||
87 | else if (obj->type != ACPI_TYPE_BUFFER) { | ||
88 | kfree(obj); | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | |||
92 | bios_return = ((struct bios_args *)obj->buffer.pointer); | ||
93 | return_code = bios_return->result_code; | ||
94 | |||
95 | kfree(obj); | ||
96 | |||
97 | return return_code; | ||
98 | } | ||
99 | |||
100 | static int led_on(void) | ||
101 | { | ||
102 | return dell_led_perform_fn(3, /* Length of command */ | ||
103 | INTERFACE_ERROR, /* Init to INTERFACE_ERROR */ | ||
104 | DEVICE_ID_PANEL_BACK, /* Device ID */ | ||
105 | CMD_LED_ON, /* Command */ | ||
106 | 0, /* not used */ | ||
107 | 0); /* not used */ | ||
108 | } | ||
109 | |||
110 | static int led_off(void) | ||
111 | { | ||
112 | return dell_led_perform_fn(3, /* Length of command */ | ||
113 | INTERFACE_ERROR, /* Init to INTERFACE_ERROR */ | ||
114 | DEVICE_ID_PANEL_BACK, /* Device ID */ | ||
115 | CMD_LED_OFF, /* Command */ | ||
116 | 0, /* not used */ | ||
117 | 0); /* not used */ | ||
118 | } | ||
119 | |||
120 | static int led_blink(unsigned char on_eighths, | ||
121 | unsigned char off_eighths) | ||
122 | { | ||
123 | return dell_led_perform_fn(5, /* Length of command */ | ||
124 | INTERFACE_ERROR, /* Init to INTERFACE_ERROR */ | ||
125 | DEVICE_ID_PANEL_BACK, /* Device ID */ | ||
126 | CMD_LED_BLINK, /* Command */ | ||
127 | on_eighths, /* blink on in eigths of a second */ | ||
128 | off_eighths); /* blink off in eights of a second */ | ||
129 | } | ||
130 | |||
131 | static void dell_led_set(struct led_classdev *led_cdev, | ||
132 | enum led_brightness value) | ||
133 | { | ||
134 | if (value == LED_OFF) | ||
135 | led_off(); | ||
136 | else | ||
137 | led_on(); | ||
138 | } | ||
139 | |||
140 | static int dell_led_blink(struct led_classdev *led_cdev, | ||
141 | unsigned long *delay_on, | ||
142 | unsigned long *delay_off) | ||
143 | { | ||
144 | unsigned long on_eighths; | ||
145 | unsigned long off_eighths; | ||
146 | |||
147 | /* The Dell LED delay is based on 125ms intervals. | ||
148 | Need to round up to next interval. */ | ||
149 | |||
150 | on_eighths = (*delay_on + 124) / 125; | ||
151 | if (0 == on_eighths) | ||
152 | on_eighths = 1; | ||
153 | if (on_eighths > 255) | ||
154 | on_eighths = 255; | ||
155 | *delay_on = on_eighths * 125; | ||
156 | |||
157 | off_eighths = (*delay_off + 124) / 125; | ||
158 | if (0 == off_eighths) | ||
159 | off_eighths = 1; | ||
160 | if (off_eighths > 255) | ||
161 | off_eighths = 255; | ||
162 | *delay_off = off_eighths * 125; | ||
163 | |||
164 | led_blink(on_eighths, off_eighths); | ||
165 | |||
166 | return 0; | ||
167 | } | ||
168 | |||
169 | static struct led_classdev dell_led = { | ||
170 | .name = "dell::lid", | ||
171 | .brightness = LED_OFF, | ||
172 | .max_brightness = 1, | ||
173 | .brightness_set = dell_led_set, | ||
174 | .blink_set = dell_led_blink, | ||
175 | .flags = LED_CORE_SUSPENDRESUME, | ||
176 | }; | ||
177 | |||
178 | static int __init dell_led_init(void) | ||
179 | { | ||
180 | int error = 0; | ||
181 | |||
182 | if (!wmi_has_guid(DELL_LED_BIOS_GUID)) | ||
183 | return -ENODEV; | ||
184 | |||
185 | error = led_off(); | ||
186 | if (error != 0) | ||
187 | return -ENODEV; | ||
188 | |||
189 | return led_classdev_register(NULL, &dell_led); | ||
190 | } | ||
191 | |||
192 | static void __exit dell_led_exit(void) | ||
193 | { | ||
194 | led_classdev_unregister(&dell_led); | ||
195 | |||
196 | led_off(); | ||
197 | } | ||
198 | |||
199 | module_init(dell_led_init); | ||
200 | module_exit(dell_led_exit); | ||
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 782f95822eab..69e7d86a5143 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -72,11 +72,14 @@ static ssize_t led_max_brightness_show(struct device *dev, | |||
72 | return sprintf(buf, "%u\n", led_cdev->max_brightness); | 72 | return sprintf(buf, "%u\n", led_cdev->max_brightness); |
73 | } | 73 | } |
74 | 74 | ||
75 | static DEVICE_ATTR(brightness, 0644, led_brightness_show, led_brightness_store); | 75 | static struct device_attribute led_class_attrs[] = { |
76 | static DEVICE_ATTR(max_brightness, 0444, led_max_brightness_show, NULL); | 76 | __ATTR(brightness, 0644, led_brightness_show, led_brightness_store), |
77 | __ATTR(max_brightness, 0644, led_max_brightness_show, NULL), | ||
77 | #ifdef CONFIG_LEDS_TRIGGERS | 78 | #ifdef CONFIG_LEDS_TRIGGERS |
78 | static DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store); | 79 | __ATTR(trigger, 0644, led_trigger_show, led_trigger_store), |
79 | #endif | 80 | #endif |
81 | __ATTR_NULL, | ||
82 | }; | ||
80 | 83 | ||
81 | /** | 84 | /** |
82 | * led_classdev_suspend - suspend an led_classdev. | 85 | * led_classdev_suspend - suspend an led_classdev. |
@@ -127,18 +130,11 @@ static int led_resume(struct device *dev) | |||
127 | */ | 130 | */ |
128 | int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) | 131 | int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) |
129 | { | 132 | { |
130 | int rc; | ||
131 | |||
132 | led_cdev->dev = device_create(leds_class, parent, 0, led_cdev, | 133 | led_cdev->dev = device_create(leds_class, parent, 0, led_cdev, |
133 | "%s", led_cdev->name); | 134 | "%s", led_cdev->name); |
134 | if (IS_ERR(led_cdev->dev)) | 135 | if (IS_ERR(led_cdev->dev)) |
135 | return PTR_ERR(led_cdev->dev); | 136 | return PTR_ERR(led_cdev->dev); |
136 | 137 | ||
137 | /* register the attributes */ | ||
138 | rc = device_create_file(led_cdev->dev, &dev_attr_brightness); | ||
139 | if (rc) | ||
140 | goto err_out; | ||
141 | |||
142 | #ifdef CONFIG_LEDS_TRIGGERS | 138 | #ifdef CONFIG_LEDS_TRIGGERS |
143 | init_rwsem(&led_cdev->trigger_lock); | 139 | init_rwsem(&led_cdev->trigger_lock); |
144 | #endif | 140 | #endif |
@@ -150,36 +146,18 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) | |||
150 | if (!led_cdev->max_brightness) | 146 | if (!led_cdev->max_brightness) |
151 | led_cdev->max_brightness = LED_FULL; | 147 | led_cdev->max_brightness = LED_FULL; |
152 | 148 | ||
153 | rc = device_create_file(led_cdev->dev, &dev_attr_max_brightness); | ||
154 | if (rc) | ||
155 | goto err_out_attr_max; | ||
156 | |||
157 | led_update_brightness(led_cdev); | 149 | led_update_brightness(led_cdev); |
158 | 150 | ||
159 | #ifdef CONFIG_LEDS_TRIGGERS | 151 | #ifdef CONFIG_LEDS_TRIGGERS |
160 | rc = device_create_file(led_cdev->dev, &dev_attr_trigger); | ||
161 | if (rc) | ||
162 | goto err_out_led_list; | ||
163 | |||
164 | led_trigger_set_default(led_cdev); | 152 | led_trigger_set_default(led_cdev); |
165 | #endif | 153 | #endif |
166 | 154 | ||
167 | printk(KERN_INFO "Registered led device: %s\n", | 155 | printk(KERN_DEBUG "Registered led device: %s\n", |
168 | led_cdev->name); | 156 | led_cdev->name); |
169 | 157 | ||
170 | return 0; | 158 | return 0; |
171 | |||
172 | #ifdef CONFIG_LEDS_TRIGGERS | ||
173 | err_out_led_list: | ||
174 | device_remove_file(led_cdev->dev, &dev_attr_max_brightness); | ||
175 | #endif | ||
176 | err_out_attr_max: | ||
177 | device_remove_file(led_cdev->dev, &dev_attr_brightness); | ||
178 | list_del(&led_cdev->node); | ||
179 | err_out: | ||
180 | device_unregister(led_cdev->dev); | ||
181 | return rc; | ||
182 | } | 159 | } |
160 | |||
183 | EXPORT_SYMBOL_GPL(led_classdev_register); | 161 | EXPORT_SYMBOL_GPL(led_classdev_register); |
184 | 162 | ||
185 | /** | 163 | /** |
@@ -190,10 +168,7 @@ EXPORT_SYMBOL_GPL(led_classdev_register); | |||
190 | */ | 168 | */ |
191 | void led_classdev_unregister(struct led_classdev *led_cdev) | 169 | void led_classdev_unregister(struct led_classdev *led_cdev) |
192 | { | 170 | { |
193 | device_remove_file(led_cdev->dev, &dev_attr_max_brightness); | ||
194 | device_remove_file(led_cdev->dev, &dev_attr_brightness); | ||
195 | #ifdef CONFIG_LEDS_TRIGGERS | 171 | #ifdef CONFIG_LEDS_TRIGGERS |
196 | device_remove_file(led_cdev->dev, &dev_attr_trigger); | ||
197 | down_write(&led_cdev->trigger_lock); | 172 | down_write(&led_cdev->trigger_lock); |
198 | if (led_cdev->trigger) | 173 | if (led_cdev->trigger) |
199 | led_trigger_set(led_cdev, NULL); | 174 | led_trigger_set(led_cdev, NULL); |
@@ -215,6 +190,7 @@ static int __init leds_init(void) | |||
215 | return PTR_ERR(leds_class); | 190 | return PTR_ERR(leds_class); |
216 | leds_class->suspend = led_suspend; | 191 | leds_class->suspend = led_suspend; |
217 | leds_class->resume = led_resume; | 192 | leds_class->resume = led_resume; |
193 | leds_class->dev_attrs = led_class_attrs; | ||
218 | return 0; | 194 | return 0; |
219 | } | 195 | } |
220 | 196 | ||
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index e5225d28f392..0823e2622e8c 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c | |||
@@ -211,7 +211,6 @@ static int __devinit of_gpio_leds_probe(struct of_device *ofdev, | |||
211 | const struct of_device_id *match) | 211 | const struct of_device_id *match) |
212 | { | 212 | { |
213 | struct device_node *np = ofdev->node, *child; | 213 | struct device_node *np = ofdev->node, *child; |
214 | struct gpio_led led; | ||
215 | struct gpio_led_of_platform_data *pdata; | 214 | struct gpio_led_of_platform_data *pdata; |
216 | int count = 0, ret; | 215 | int count = 0, ret; |
217 | 216 | ||
@@ -226,8 +225,8 @@ static int __devinit of_gpio_leds_probe(struct of_device *ofdev, | |||
226 | if (!pdata) | 225 | if (!pdata) |
227 | return -ENOMEM; | 226 | return -ENOMEM; |
228 | 227 | ||
229 | memset(&led, 0, sizeof(led)); | ||
230 | for_each_child_of_node(np, child) { | 228 | for_each_child_of_node(np, child) { |
229 | struct gpio_led led = {}; | ||
231 | enum of_gpio_flags flags; | 230 | enum of_gpio_flags flags; |
232 | const char *state; | 231 | const char *state; |
233 | 232 | ||
diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c index 97f04984c1ca..51477ec71391 100644 --- a/drivers/leds/leds-ss4200.c +++ b/drivers/leds/leds-ss4200.c | |||
@@ -63,7 +63,7 @@ MODULE_LICENSE("GPL"); | |||
63 | /* | 63 | /* |
64 | * PCI ID of the Intel ICH7 LPC Device within which the GPIO block lives. | 64 | * PCI ID of the Intel ICH7 LPC Device within which the GPIO block lives. |
65 | */ | 65 | */ |
66 | static struct pci_device_id ich7_lpc_pci_id[] = | 66 | static const struct pci_device_id ich7_lpc_pci_id[] = |
67 | { | 67 | { |
68 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0) }, | 68 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0) }, |
69 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1) }, | 69 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1) }, |