1 ========================
2 Kernel driver for lm3556
3 ========================
6 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source
7 * Datasheet: http://www.national.com/ds/LM/LM3556.pdf
12 Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com)
16 There are 3 functions in LM3556, Flash, Torch and Indicator.
21 In Flash Mode, the LED current source(LED) provides 16 target current levels
22 from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
23 CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
24 or by pulling the STROBE pin HIGH.
26 LM3556 Flash can be controlled through sys/class/leds/flash/brightness file
28 * if STROBE pin is enabled, below example control brightness only, and
29 ON / OFF will be controlled by STROBE pin.
35 #echo 0 > sys/class/leds/flash/brightness
39 #echo 1 > sys/class/leds/flash/brightness
45 #echo 16 > sys/class/leds/flash/brightness
50 In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
51 REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
54 LM3556 torch can be controlled through sys/class/leds/torch/brightness file.
55 * if TORCH pin is enabled, below example control brightness only,
56 and ON / OFF will be controlled by TORCH pin.
62 #echo 0 > sys/class/leds/torch/brightness
66 #echo 1 > sys/class/leds/torch/brightness
72 #echo 8 > sys/class/leds/torch/brightness
77 Indicator pattern can be set through sys/class/leds/indicator/pattern file,
78 and 4 patterns are pre-defined in indicator_pattern array.
80 According to N-lank, Pulse time and N Period values, different pattern wiill
81 be generated.If you want new patterns for your own device, change
82 indicator_pattern array with your own values and INDIC_PATTERN_SIZE.
84 Please refer datasheet for more detail about N-Blank, Pulse time and N Period.
86 Indicator pattern example:
90 #echo 0 > sys/class/leds/indicator/pattern
96 #echo 3 > sys/class/leds/indicator/pattern
98 Indicator brightness can be controlled through
99 sys/class/leds/indicator/brightness file.
105 #echo 0 > sys/class/leds/indicator/brightness
109 #echo 1 > sys/class/leds/indicator/brightness
115 #echo 8 > sys/class/leds/indicator/brightness
119 Driver expects it is registered using the i2c_board_info mechanism.
120 To register the chip at address 0x63 on specific adapter, set the platform data
121 according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
125 static struct i2c_board_info board_i2c_ch4[] __initdata = {
127 I2C_BOARD_INFO(LM3556_NAME, 0x63),
128 .platform_data = &lm3556_pdata,
132 and register it in the platform init function
136 board_register_i2c_bus(4, 400,
137 board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));