Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: move LED trigger drivers into new subdirectory

For better driver management, new subdirectory, 'trigger' is created.
All LED trigger drivers are moved into this directory.

Internal header, 'leds.h' is included in each LED trigger drivers.
Fix the location of header file, "leds.h" -> "../leds.h" in driver files.
One exception is here, 'ledtrig-timer.c'.
There is no need to include 'leds.h'. so '#include "leds.h"' line was removed.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

authored by

Kim, Milo and committed by
Bryan Wu
f07fb521 ff45262a

+121 -117
+1 -100
drivers/leds/Kconfig
··· 479 479 This option enables support for the BlinkM RGB LED connected 480 480 through I2C. Say Y to enable support for the BlinkM LED. 481 481 482 - config LEDS_TRIGGERS 483 - bool "LED Trigger support" 484 - depends on LEDS_CLASS 485 - help 486 - This option enables trigger support for the leds class. 487 - These triggers allow kernel events to drive the LEDs and can 488 - be configured via sysfs. If unsure, say Y. 489 - 490 482 comment "LED Triggers" 491 - 492 - config LEDS_TRIGGER_TIMER 493 - tristate "LED Timer Trigger" 494 - depends on LEDS_TRIGGERS 495 - help 496 - This allows LEDs to be controlled by a programmable timer 497 - via sysfs. Some LED hardware can be programmed to start 498 - blinking the LED without any further software interaction. 499 - For more details read Documentation/leds/leds-class.txt. 500 - 501 - If unsure, say Y. 502 - 503 - config LEDS_TRIGGER_ONESHOT 504 - tristate "LED One-shot Trigger" 505 - depends on LEDS_TRIGGERS 506 - help 507 - This allows LEDs to blink in one-shot pulses with parameters 508 - controlled via sysfs. It's useful to notify the user on 509 - sporadic events, when there are no clear begin and end trap points, 510 - or on dense events, where this blinks the LED at constant rate if 511 - rearmed continuously. 512 - 513 - It also shows how to use the led_blink_set_oneshot() function. 514 - 515 - If unsure, say Y. 516 - 517 - config LEDS_TRIGGER_IDE_DISK 518 - bool "LED IDE Disk Trigger" 519 - depends on IDE_GD_ATA 520 - depends on LEDS_TRIGGERS 521 - help 522 - This allows LEDs to be controlled by IDE disk activity. 523 - If unsure, say Y. 524 - 525 - config LEDS_TRIGGER_HEARTBEAT 526 - tristate "LED Heartbeat Trigger" 527 - depends on LEDS_TRIGGERS 528 - help 529 - This allows LEDs to be controlled by a CPU load average. 530 - The flash frequency is a hyperbolic function of the 1-minute 531 - load average. 532 - If unsure, say Y. 533 - 534 - config LEDS_TRIGGER_BACKLIGHT 535 - tristate "LED backlight Trigger" 536 - depends on LEDS_TRIGGERS 537 - help 538 - This allows LEDs to be controlled as a backlight device: they 539 - turn off and on when the display is blanked and unblanked. 540 - 541 - If unsure, say N. 542 - 543 - config LEDS_TRIGGER_CPU 544 - bool "LED CPU Trigger" 545 - depends on LEDS_TRIGGERS 546 - help 547 - This allows LEDs to be controlled by active CPUs. This shows 548 - the active CPUs across an array of LEDs so you can see which 549 - CPUs are active on the system at any given moment. 550 - 551 - If unsure, say N. 552 - 553 - config LEDS_TRIGGER_GPIO 554 - tristate "LED GPIO Trigger" 555 - depends on LEDS_TRIGGERS 556 - depends on GPIOLIB 557 - help 558 - This allows LEDs to be controlled by gpio events. It's good 559 - when using gpios as switches and triggering the needed LEDs 560 - from there. One use case is n810's keypad LEDs that could 561 - be triggered by this trigger when user slides up to show 562 - keypad. 563 - 564 - If unsure, say N. 565 - 566 - config LEDS_TRIGGER_DEFAULT_ON 567 - tristate "LED Default ON Trigger" 568 - depends on LEDS_TRIGGERS 569 - help 570 - This allows LEDs to be initialised in the ON state. 571 - If unsure, say Y. 572 - 573 - comment "iptables trigger is under Netfilter config (LED target)" 574 - depends on LEDS_TRIGGERS 575 - 576 - config LEDS_TRIGGER_TRANSIENT 577 - tristate "LED Transient Trigger" 578 - depends on LEDS_TRIGGERS 579 - help 580 - This allows one time activation of a transient state on 581 - GPIO/PWM based hardware. 582 - If unsure, say Y. 483 + source "drivers/leds/trigger/Kconfig" 583 484 584 485 endif # NEW_LEDS
+1 -9
drivers/leds/Makefile
··· 58 58 obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o 59 59 60 60 # LED Triggers 61 - obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o 62 - obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o 63 - obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o 64 - obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o 65 - obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o 66 - obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o 67 - obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o 68 - obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o 69 - obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o 61 + obj-$(CONFIG_LEDS_TRIGGERS) += trigger/
+1 -1
drivers/leds/ledtrig-backlight.c drivers/leds/trigger/ledtrig-backlight.c
··· 16 16 #include <linux/init.h> 17 17 #include <linux/fb.h> 18 18 #include <linux/leds.h> 19 - #include "leds.h" 19 + #include "../leds.h" 20 20 21 21 #define BLANK 1 22 22 #define UNBLANK 0
+1 -1
drivers/leds/ledtrig-cpu.c drivers/leds/trigger/ledtrig-cpu.c
··· 26 26 #include <linux/percpu.h> 27 27 #include <linux/syscore_ops.h> 28 28 #include <linux/rwsem.h> 29 - #include "leds.h" 29 + #include "../leds.h" 30 30 31 31 #define MAX_NAME_LEN 8 32 32
+1 -1
drivers/leds/ledtrig-default-on.c drivers/leds/trigger/ledtrig-default-on.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 17 #include <linux/leds.h> 18 - #include "leds.h" 18 + #include "../leds.h" 19 19 20 20 static void defon_trig_activate(struct led_classdev *led_cdev) 21 21 {
+1 -1
drivers/leds/ledtrig-gpio.c drivers/leds/trigger/ledtrig-gpio.c
··· 17 17 #include <linux/workqueue.h> 18 18 #include <linux/leds.h> 19 19 #include <linux/slab.h> 20 - #include "leds.h" 20 + #include "../leds.h" 21 21 22 22 struct gpio_trig_data { 23 23 struct led_classdev *led;
+1 -1
drivers/leds/ledtrig-heartbeat.c drivers/leds/trigger/ledtrig-heartbeat.c
··· 19 19 #include <linux/sched.h> 20 20 #include <linux/leds.h> 21 21 #include <linux/reboot.h> 22 - #include "leds.h" 22 + #include "../leds.h" 23 23 24 24 static int panic_heartbeats; 25 25
drivers/leds/ledtrig-ide-disk.c drivers/leds/trigger/ledtrig-ide-disk.c
+1 -1
drivers/leds/ledtrig-oneshot.c drivers/leds/trigger/ledtrig-oneshot.c
··· 18 18 #include <linux/ctype.h> 19 19 #include <linux/slab.h> 20 20 #include <linux/leds.h> 21 - #include "leds.h" 21 + #include "../leds.h" 22 22 23 23 #define DEFAULT_DELAY 100 24 24
-1
drivers/leds/ledtrig-timer.c drivers/leds/trigger/ledtrig-timer.c
··· 17 17 #include <linux/device.h> 18 18 #include <linux/ctype.h> 19 19 #include <linux/leds.h> 20 - #include "leds.h" 21 20 22 21 static ssize_t led_delay_on_show(struct device *dev, 23 22 struct device_attribute *attr, char *buf)
+1 -1
drivers/leds/ledtrig-transient.c drivers/leds/trigger/ledtrig-transient.c
··· 25 25 #include <linux/slab.h> 26 26 #include <linux/timer.h> 27 27 #include <linux/leds.h> 28 - #include "leds.h" 28 + #include "../leds.h" 29 29 30 30 struct transient_trig_data { 31 31 int activate;
+103
drivers/leds/trigger/Kconfig
··· 1 + menuconfig LEDS_TRIGGERS 2 + bool "LED Trigger support" 3 + depends on LEDS_CLASS 4 + help 5 + This option enables trigger support for the leds class. 6 + These triggers allow kernel events to drive the LEDs and can 7 + be configured via sysfs. If unsure, say Y. 8 + 9 + if LEDS_TRIGGERS 10 + 11 + config LEDS_TRIGGER_TIMER 12 + tristate "LED Timer Trigger" 13 + depends on LEDS_TRIGGERS 14 + help 15 + This allows LEDs to be controlled by a programmable timer 16 + via sysfs. Some LED hardware can be programmed to start 17 + blinking the LED without any further software interaction. 18 + For more details read Documentation/leds/leds-class.txt. 19 + 20 + If unsure, say Y. 21 + 22 + config LEDS_TRIGGER_ONESHOT 23 + tristate "LED One-shot Trigger" 24 + depends on LEDS_TRIGGERS 25 + help 26 + This allows LEDs to blink in one-shot pulses with parameters 27 + controlled via sysfs. It's useful to notify the user on 28 + sporadic events, when there are no clear begin and end trap points, 29 + or on dense events, where this blinks the LED at constant rate if 30 + rearmed continuously. 31 + 32 + It also shows how to use the led_blink_set_oneshot() function. 33 + 34 + If unsure, say Y. 35 + 36 + config LEDS_TRIGGER_IDE_DISK 37 + bool "LED IDE Disk Trigger" 38 + depends on IDE_GD_ATA 39 + depends on LEDS_TRIGGERS 40 + help 41 + This allows LEDs to be controlled by IDE disk activity. 42 + If unsure, say Y. 43 + 44 + config LEDS_TRIGGER_HEARTBEAT 45 + tristate "LED Heartbeat Trigger" 46 + depends on LEDS_TRIGGERS 47 + help 48 + This allows LEDs to be controlled by a CPU load average. 49 + The flash frequency is a hyperbolic function of the 1-minute 50 + load average. 51 + If unsure, say Y. 52 + 53 + config LEDS_TRIGGER_BACKLIGHT 54 + tristate "LED backlight Trigger" 55 + depends on LEDS_TRIGGERS 56 + help 57 + This allows LEDs to be controlled as a backlight device: they 58 + turn off and on when the display is blanked and unblanked. 59 + 60 + If unsure, say N. 61 + 62 + config LEDS_TRIGGER_CPU 63 + bool "LED CPU Trigger" 64 + depends on LEDS_TRIGGERS 65 + help 66 + This allows LEDs to be controlled by active CPUs. This shows 67 + the active CPUs across an array of LEDs so you can see which 68 + CPUs are active on the system at any given moment. 69 + 70 + If unsure, say N. 71 + 72 + config LEDS_TRIGGER_GPIO 73 + tristate "LED GPIO Trigger" 74 + depends on LEDS_TRIGGERS 75 + depends on GPIOLIB 76 + help 77 + This allows LEDs to be controlled by gpio events. It's good 78 + when using gpios as switches and triggering the needed LEDs 79 + from there. One use case is n810's keypad LEDs that could 80 + be triggered by this trigger when user slides up to show 81 + keypad. 82 + 83 + If unsure, say N. 84 + 85 + config LEDS_TRIGGER_DEFAULT_ON 86 + tristate "LED Default ON Trigger" 87 + depends on LEDS_TRIGGERS 88 + help 89 + This allows LEDs to be initialised in the ON state. 90 + If unsure, say Y. 91 + 92 + comment "iptables trigger is under Netfilter config (LED target)" 93 + depends on LEDS_TRIGGERS 94 + 95 + config LEDS_TRIGGER_TRANSIENT 96 + tristate "LED Transient Trigger" 97 + depends on LEDS_TRIGGERS 98 + help 99 + This allows one time activation of a transient state on 100 + GPIO/PWM based hardware. 101 + If unsure, say Y. 102 + 103 + endif # LEDS_TRIGGERS
+9
drivers/leds/trigger/Makefile
··· 1 + obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o 2 + obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o 3 + obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o 4 + obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o 5 + obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o 6 + obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o 7 + obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o 8 + obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o 9 + obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o