]> git.openpandora.org Git - pandora-kernel.git/commitdiff
Input: export LEDs as class devices in sysfs
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 17 Mar 2015 04:19:56 +0000 (21:19 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Jun 2015 01:18:11 +0000 (18:18 -0700)
This change creates a new input handler called "leds" that exports LEDs on input
devices as standard LED class devices in sysfs and allows controlling their
state via sysfs or via any of the standard LED triggers. This allows to
re-purpose and reassign LDEs on the keyboards to represent states other
than the standard keyboard states (CapsLock, NumLock, etc).

The old API of controlling input LEDs by writing into /dev/input/eventX
devices is still present and will take precedence over accessing via LEDs
subsystem (i.e. it may override state set by a trigger). If input device is
"grabbed" then requests coming through LED subsystem will be ignored.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/leds/leds-class.txt
drivers/input/Kconfig
drivers/input/Makefile
drivers/input/input-leds.c [new file with mode: 0644]
drivers/leds/Kconfig

index 79699c2007664e5572580a0eea812cae7efd65fb..62261c04060a73bef82a3a6784cef794d39e5d50 100644 (file)
@@ -2,9 +2,6 @@
 LED handling under Linux
 ========================
 
-If you're reading this and thinking about keyboard leds, these are
-handled by the input subsystem and the led class is *not* needed.
-
 In its simplest form, the LED class just allows control of LEDs from
 userspace. LEDs appear in /sys/class/leds/. The maximum brightness of the
 LED is defined in max_brightness file. The brightness file will set the brightness
index a11ff74a5127019cb6f367d07ffae32429ccf37e..a35532ec00e4131d40cda5a841a730e96e8e20e3 100644 (file)
@@ -25,6 +25,19 @@ config INPUT
 
 if INPUT
 
+config INPUT_LEDS
+       tristate "Export input device LEDs in sysfs"
+       depends on LEDS_CLASS
+       default INPUT
+       help
+         Say Y here if you would like to export LEDs on input devices
+         as standard LED class devices in sysfs.
+
+         If unsure, say Y.
+
+         To compile this driver as a module, choose M here: the
+         module will be called input-leds.
+
 config INPUT_FF_MEMLESS
        tristate "Support for memoryless force-feedback devices"
        help
index 5ca3f631497f4d8295cf42a1d2bf54ed9c4f9e16..0c9302ca9954f5887b1ff297648cd59dc215d629 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_INPUT_POLLDEV)   += input-polldev.o
 obj-$(CONFIG_INPUT_SPARSEKMAP) += sparse-keymap.o
 obj-$(CONFIG_INPUT_MATRIXKMAP) += matrix-keymap.o
 
+obj-$(CONFIG_INPUT_LEDS)       += input-leds.o
 obj-$(CONFIG_INPUT_MOUSEDEV)   += mousedev.o
 obj-$(CONFIG_INPUT_JOYDEV)     += joydev.o
 obj-$(CONFIG_INPUT_EVDEV)      += evdev.o
Simple merge
Simple merge