Skip to content

Commit b54cf35

Browse files
Jan-Simon MöllerBryan Wu
Jan-Simon Möller
authored and
Bryan Wu
committed
LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS
Add driver for BlinkM device to drivers/leds/. Add entry to MAINTAINERS file. Add documentation in Documentation/leds/. A BlinkM is a RGB LED controlled through I2C. This driver implements an interface to the LED framework and another sysfs group to access the internal options of the BlinkM. rev6: Use module_i2c_driver(). rev5: Removed own workqueue in favor of events wq. rev4: Fixed comments by Bryan Wu. rev3: Fixed issues found by Jonathan Neuschäfer. (bryan.wu@canonical.com: remove 2 trailing whitespace) Signed-off-by: Jan-Simon Möller <jansimon.moeller@gmx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
1 parent eb18618 commit b54cf35

File tree

5 files changed

+906
-0
lines changed

5 files changed

+906
-0
lines changed

Documentation/leds/leds-blinkm.txt

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
The leds-blinkm driver supports the devices of the BlinkM family.
2+
3+
They are RGB-LED modules driven by a (AT)tiny microcontroller and
4+
communicate through I2C. The default address of these modules is
5+
0x09 but this can be changed through a command. By this you could
6+
dasy-chain up to 127 BlinkMs on an I2C bus.
7+
8+
The device accepts RGB and HSB color values through separate commands.
9+
Also you can store blinking sequences as "scripts" in
10+
the controller and run them. Also fading is an option.
11+
12+
The interface this driver provides is 2-fold:
13+
14+
a) LED class interface for use with triggers
15+
############################################
16+
17+
The registration follows the scheme:
18+
blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>
19+
20+
$ ls -h /sys/class/leds/blinkm-6-*
21+
/sys/class/leds/blinkm-6-9-blue:
22+
brightness device max_brightness power subsystem trigger uevent
23+
24+
/sys/class/leds/blinkm-6-9-green:
25+
brightness device max_brightness power subsystem trigger uevent
26+
27+
/sys/class/leds/blinkm-6-9-red:
28+
brightness device max_brightness power subsystem trigger uevent
29+
30+
(same is /sys/bus/i2c/devices/6-0009/leds)
31+
32+
We can control the colors separated into red, green and blue and
33+
assign triggers on each color.
34+
35+
E.g.:
36+
37+
$ cat blinkm-6-9-blue/brightness
38+
05
39+
40+
$ echo 200 > blinkm-6-9-blue/brightness
41+
$
42+
43+
$ modprobe ledtrig-heartbeat
44+
$ echo heartbeat > blinkm-6-9-green/trigger
45+
$
46+
47+
48+
b) Sysfs group to control rgb, fade, hsb, scripts ...
49+
#####################################################
50+
51+
This extended interface is available as folder blinkm
52+
in the sysfs folder of the I2C device.
53+
E.g. below /sys/bus/i2c/devices/6-0009/blinkm
54+
55+
$ ls -h /sys/bus/i2c/devices/6-0009/blinkm/
56+
blue green red test
57+
58+
Currently supported is just setting red, green, blue
59+
and a test sequence.
60+
61+
E.g.:
62+
63+
$ cat *
64+
00
65+
00
66+
00
67+
#Write into test to start test sequence!#
68+
69+
$ echo 1 > test
70+
$
71+
72+
$ echo 255 > red
73+
$
74+
75+
76+
77+
as of 6/2012
78+
79+
dl9pf <at> gmx <dot> de
80+

MAINTAINERS

+5
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,11 @@ W: http://blackfin.uclinux.org/
15181518
S: Supported
15191519
F: drivers/i2c/busses/i2c-bfin-twi.c
15201520

1521+
BLINKM RGB LED DRIVER
1522+
M: Jan-Simon Moeller <jansimon.moeller@gmx.de>
1523+
S: Maintained
1524+
F: drivers/leds/leds-blinkm.c
1525+
15211526
BLOCK LAYER
15221527
M: Jens Axboe <axboe@kernel.dk>
15231528
T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git

drivers/leds/Kconfig

+8
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ config LEDS_OT200
430430
This option enables support for the LEDs on the Bachmann OT200.
431431
Say Y to enable LEDs on the Bachmann OT200.
432432

433+
config LEDS_BLINKM
434+
tristate "LED support for the BlinkM I2C RGB LED"
435+
depends on LEDS_CLASS
436+
depends on I2C
437+
help
438+
This option enables support for the BlinkM RGB LED connected
439+
through I2C. Say Y to enable support for the BlinkM LED.
440+
433441
config LEDS_TRIGGERS
434442
bool "LED Trigger support"
435443
depends on LEDS_CLASS

drivers/leds/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o
4848
obj-$(CONFIG_LEDS_RENESAS_TPU) += leds-renesas-tpu.o
4949
obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
5050
obj-$(CONFIG_LEDS_LM3556) += leds-lm3556.o
51+
obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
5152

5253
# LED SPI Drivers
5354
obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o

0 commit comments

Comments
 (0)