dm: dm-zoned: use __bio_add_page for adding single metadata page
[linux-block.git] / Documentation / leds / leds-lm3556.rst
CommitLineData
8dab9197 1========================
32abb478
SJ
2Kernel driver for lm3556
3========================
4
8dab9197
MCC
5* Texas Instrument:
6 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source
32abb478
SJ
7* Datasheet: http://www.national.com/ds/LM/LM3556.pdf
8
9Authors:
8dab9197
MCC
10 - Daniel Jeong
11
32abb478
SJ
12 Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com)
13
14Description
15-----------
16There are 3 functions in LM3556, Flash, Torch and Indicator.
17
8dab9197
MCC
18Flash Mode
19^^^^^^^^^^
20
32abb478
SJ
21In Flash Mode, the LED current source(LED) provides 16 target current levels
22from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
23CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
24or by pulling the STROBE pin HIGH.
8dab9197 25
abb9c078 26LM3556 Flash can be controlled through /sys/class/leds/flash/brightness file
8dab9197 27
32abb478 28* if STROBE pin is enabled, below example control brightness only, and
8dab9197 29 ON / OFF will be controlled by STROBE pin.
32abb478
SJ
30
31Flash Example:
32abb478 32
8dab9197
MCC
33OFF::
34
abb9c078 35 #echo 0 > /sys/class/leds/flash/brightness
8dab9197
MCC
36
3793.75 mA::
38
abb9c078 39 #echo 1 > /sys/class/leds/flash/brightness
8dab9197
MCC
40
41...
42
431500 mA::
44
abb9c078 45 #echo 16 > /sys/class/leds/flash/brightness
8dab9197
MCC
46
47Torch Mode
48^^^^^^^^^^
49
32abb478
SJ
50In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
51REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
52hardware TORCH input.
8dab9197 53
abb9c078 54LM3556 torch can be controlled through /sys/class/leds/torch/brightness file.
32abb478
SJ
55* if TORCH pin is enabled, below example control brightness only,
56and ON / OFF will be controlled by TORCH pin.
57
58Torch Example:
32abb478 59
8dab9197
MCC
60OFF::
61
abb9c078 62 #echo 0 > /sys/class/leds/torch/brightness
8dab9197
MCC
63
6446.88 mA::
65
abb9c078 66 #echo 1 > /sys/class/leds/torch/brightness
8dab9197
MCC
67
68...
69
70375 mA::
71
abb9c078 72 #echo 8 > /sys/class/leds/torch/brightness
8dab9197
MCC
73
74Indicator Mode
75^^^^^^^^^^^^^^
76
abb9c078 77Indicator pattern can be set through /sys/class/leds/indicator/pattern file,
32abb478 78and 4 patterns are pre-defined in indicator_pattern array.
8dab9197 79
32abb478
SJ
80According to N-lank, Pulse time and N Period values, different pattern wiill
81be generated.If you want new patterns for your own device, change
82indicator_pattern array with your own values and INDIC_PATTERN_SIZE.
8dab9197 83
32abb478
SJ
84Please refer datasheet for more detail about N-Blank, Pulse time and N Period.
85
86Indicator pattern example:
8dab9197
MCC
87
88pattern 0::
89
abb9c078 90 #echo 0 > /sys/class/leds/indicator/pattern
8dab9197
MCC
91
92...
93
94pattern 3::
95
abb9c078 96 #echo 3 > /sys/class/leds/indicator/pattern
32abb478
SJ
97
98Indicator brightness can be controlled through
99sys/class/leds/indicator/brightness file.
100
101Example:
8dab9197
MCC
102
103OFF::
104
abb9c078 105 #echo 0 > /sys/class/leds/indicator/brightness
8dab9197
MCC
106
1075.86 mA::
108
abb9c078 109 #echo 1 > /sys/class/leds/indicator/brightness
8dab9197
MCC
110
111...
112
11346.875mA::
114
abb9c078 115 #echo 8 > /sys/class/leds/indicator/brightness
32abb478
SJ
116
117Notes
118-----
119Driver expects it is registered using the i2c_board_info mechanism.
120To register the chip at address 0x63 on specific adapter, set the platform data
121according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
122
8dab9197
MCC
123Example::
124
eb967b6a 125 static struct i2c_board_info board_i2c_ch4[] __initdata = {
32abb478
SJ
126 {
127 I2C_BOARD_INFO(LM3556_NAME, 0x63),
128 .platform_data = &lm3556_pdata,
129 },
130 };
131
132and register it in the platform init function
133
8dab9197
MCC
134Example::
135
32abb478
SJ
136 board_register_i2c_bus(4, 400,
137 board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));