提交 b54cf35a 编写于 作者: J Jan-Simon Möller 提交者: Bryan Wu

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: NJan-Simon Möller <jansimon.moeller@gmx.de>
Signed-off-by: NBryan Wu <bryan.wu@canonical.com>
上级 eb18618b
The leds-blinkm driver supports the devices of the BlinkM family.
They are RGB-LED modules driven by a (AT)tiny microcontroller and
communicate through I2C. The default address of these modules is
0x09 but this can be changed through a command. By this you could
dasy-chain up to 127 BlinkMs on an I2C bus.
The device accepts RGB and HSB color values through separate commands.
Also you can store blinking sequences as "scripts" in
the controller and run them. Also fading is an option.
The interface this driver provides is 2-fold:
a) LED class interface for use with triggers
############################################
The registration follows the scheme:
blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>
$ ls -h /sys/class/leds/blinkm-6-*
/sys/class/leds/blinkm-6-9-blue:
brightness device max_brightness power subsystem trigger uevent
/sys/class/leds/blinkm-6-9-green:
brightness device max_brightness power subsystem trigger uevent
/sys/class/leds/blinkm-6-9-red:
brightness device max_brightness power subsystem trigger uevent
(same is /sys/bus/i2c/devices/6-0009/leds)
We can control the colors separated into red, green and blue and
assign triggers on each color.
E.g.:
$ cat blinkm-6-9-blue/brightness
05
$ echo 200 > blinkm-6-9-blue/brightness
$
$ modprobe ledtrig-heartbeat
$ echo heartbeat > blinkm-6-9-green/trigger
$
b) Sysfs group to control rgb, fade, hsb, scripts ...
#####################################################
This extended interface is available as folder blinkm
in the sysfs folder of the I2C device.
E.g. below /sys/bus/i2c/devices/6-0009/blinkm
$ ls -h /sys/bus/i2c/devices/6-0009/blinkm/
blue green red test
Currently supported is just setting red, green, blue
and a test sequence.
E.g.:
$ cat *
00
00
00
#Write into test to start test sequence!#
$ echo 1 > test
$
$ echo 255 > red
$
as of 6/2012
dl9pf <at> gmx <dot> de
...@@ -1518,6 +1518,11 @@ W: http://blackfin.uclinux.org/ ...@@ -1518,6 +1518,11 @@ W: http://blackfin.uclinux.org/
S: Supported S: Supported
F: drivers/i2c/busses/i2c-bfin-twi.c F: drivers/i2c/busses/i2c-bfin-twi.c
BLINKM RGB LED DRIVER
M: Jan-Simon Moeller <jansimon.moeller@gmx.de>
S: Maintained
F: drivers/leds/leds-blinkm.c
BLOCK LAYER BLOCK LAYER
M: Jens Axboe <axboe@kernel.dk> M: Jens Axboe <axboe@kernel.dk>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
......
...@@ -430,6 +430,14 @@ config LEDS_OT200 ...@@ -430,6 +430,14 @@ config LEDS_OT200
This option enables support for the LEDs on the Bachmann OT200. This option enables support for the LEDs on the Bachmann OT200.
Say Y to enable LEDs on the Bachmann OT200. Say Y to enable LEDs on the Bachmann OT200.
config LEDS_BLINKM
tristate "LED support for the BlinkM I2C RGB LED"
depends on LEDS_CLASS
depends on I2C
help
This option enables support for the BlinkM RGB LED connected
through I2C. Say Y to enable support for the BlinkM LED.
config LEDS_TRIGGERS config LEDS_TRIGGERS
bool "LED Trigger support" bool "LED Trigger support"
depends on LEDS_CLASS depends on LEDS_CLASS
......
...@@ -48,6 +48,7 @@ obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o ...@@ -48,6 +48,7 @@ obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o
obj-$(CONFIG_LEDS_RENESAS_TPU) += leds-renesas-tpu.o obj-$(CONFIG_LEDS_RENESAS_TPU) += leds-renesas-tpu.o
obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
obj-$(CONFIG_LEDS_LM3556) += leds-lm3556.o obj-$(CONFIG_LEDS_LM3556) += leds-lm3556.o
obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
# LED SPI Drivers # LED SPI Drivers
obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册