-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 319131 b: refs/heads/master c: 7b9b04f h: refs/heads/master i: 319129: d848d55 319127: 54979d4 v: v3
- Loading branch information
David S. Miller
committed
Jul 27, 2012
1 parent
8d3474a
commit f4d8e39
Showing
90 changed files
with
2,677 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 28ea499ac5b90f6266a24b826c6d469fc503758c | ||
refs/heads/master: 7b9b04fb728ec0b94464ed902f3395aa592c5bcf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
Kernel driver for lm3556 | ||
======================== | ||
|
||
*Texas Instrument: | ||
1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source | ||
* Datasheet: http://www.national.com/ds/LM/LM3556.pdf | ||
|
||
Authors: | ||
Daniel Jeong | ||
Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com) | ||
|
||
Description | ||
----------- | ||
There are 3 functions in LM3556, Flash, Torch and Indicator. | ||
|
||
FLASH MODE | ||
In Flash Mode, the LED current source(LED) provides 16 target current levels | ||
from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT | ||
CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A), | ||
or by pulling the STROBE pin HIGH. | ||
LM3556 Flash can be controlled through sys/class/leds/flash/brightness file | ||
* if STROBE pin is enabled, below example control brightness only, and | ||
ON / OFF will be controlled by STROBE pin. | ||
|
||
Flash Example: | ||
OFF : #echo 0 > sys/class/leds/flash/brightness | ||
93.75 mA: #echo 1 > sys/class/leds/flash/brightness | ||
... ..... | ||
1500 mA: #echo 16 > sys/class/leds/flash/brightness | ||
|
||
TORCH MODE | ||
In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL | ||
REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the | ||
hardware TORCH input. | ||
LM3556 torch can be controlled through sys/class/leds/torch/brightness file. | ||
* if TORCH pin is enabled, below example control brightness only, | ||
and ON / OFF will be controlled by TORCH pin. | ||
|
||
Torch Example: | ||
OFF : #echo 0 > sys/class/leds/torch/brightness | ||
46.88 mA: #echo 1 > sys/class/leds/torch/brightness | ||
... ..... | ||
375 mA : #echo 8 > sys/class/leds/torch/brightness | ||
|
||
INDICATOR MODE | ||
Indicator pattern can be set through sys/class/leds/indicator/pattern file, | ||
and 4 patterns are pre-defined in indicator_pattern array. | ||
According to N-lank, Pulse time and N Period values, different pattern wiill | ||
be generated.If you want new patterns for your own device, change | ||
indicator_pattern array with your own values and INDIC_PATTERN_SIZE. | ||
Please refer datasheet for more detail about N-Blank, Pulse time and N Period. | ||
|
||
Indicator pattern example: | ||
pattern 0: #echo 0 > sys/class/leds/indicator/pattern | ||
.... | ||
pattern 3: #echo 3 > sys/class/leds/indicator/pattern | ||
|
||
Indicator brightness can be controlled through | ||
sys/class/leds/indicator/brightness file. | ||
|
||
Example: | ||
OFF : #echo 0 > sys/class/leds/indicator/brightness | ||
5.86 mA : #echo 1 > sys/class/leds/indicator/brightness | ||
........ | ||
46.875mA : #echo 8 > sys/class/leds/indicator/brightness | ||
|
||
Notes | ||
----- | ||
Driver expects it is registered using the i2c_board_info mechanism. | ||
To register the chip at address 0x63 on specific adapter, set the platform data | ||
according to include/linux/platform_data/leds-lm3556.h, set the i2c board info | ||
|
||
Example: | ||
static struct i2c_board_info __initdata board_i2c_ch4[] = { | ||
{ | ||
I2C_BOARD_INFO(LM3556_NAME, 0x63), | ||
.platform_data = &lm3556_pdata, | ||
}, | ||
}; | ||
|
||
and register it in the platform init function | ||
|
||
Example: | ||
board_register_i2c_bus(4, 400, | ||
board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
One-shot LED Trigger | ||
==================== | ||
|
||
This is a LED trigger useful for signaling the user of an event where there are | ||
no clear trap points to put standard led-on and led-off settings. Using this | ||
trigger, the application needs only to signal the trigger when an event has | ||
happened, than the trigger turns the LED on and than keeps it off for a | ||
specified amount of time. | ||
|
||
This trigger is meant to be usable both for sporadic and dense events. In the | ||
first case, the trigger produces a clear single controlled blink for each | ||
event, while in the latter it keeps blinking at constant rate, as to signal | ||
that the events are arriving continuously. | ||
|
||
A one-shot LED only stays in a constant state when there are no events. An | ||
additional "invert" property specifies if the LED has to stay off (normal) or | ||
on (inverted) when not rearmed. | ||
|
||
The trigger can be activated from user space on led class devices as shown | ||
below: | ||
|
||
echo oneshot > trigger | ||
|
||
This adds the following sysfs attributes to the LED: | ||
|
||
delay_on - specifies for how many milliseconds the LED has to stay at | ||
LED_FULL brightness after it has been armed. | ||
Default to 100 ms. | ||
|
||
delay_off - specifies for how many milliseconds the LED has to stay at | ||
LED_OFF brightness after it has been armed. | ||
Default to 100 ms. | ||
|
||
invert - reverse the blink logic. If set to 0 (default) blink on for delay_on | ||
ms, then blink off for delay_off ms, leaving the LED normally off. If | ||
set to 1, blink off for delay_off ms, then blink on for delay_on ms, | ||
leaving the LED normally on. | ||
Setting this value also immediately change the LED state. | ||
|
||
shot - write any non-empty string to signal an events, this starts a blink | ||
sequence if not already running. | ||
|
||
Example use-case: network devices, initialization: | ||
|
||
echo oneshot > trigger # set trigger for this led | ||
echo 33 > delay_on # blink at 1 / (33 + 33) Hz on continuous traffic | ||
echo 33 > delay_off | ||
|
||
interface goes up: | ||
|
||
echo 1 > invert # set led as normally-on, turn the led on | ||
|
||
packet received/transmitted: | ||
|
||
echo 1 > shot # led starts blinking, ignored if already blinking | ||
|
||
interface goes down | ||
|
||
echo 0 > invert # set led as normally-off, turn the led off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.