1 Kernel driver for lm3556
2 ========================
5 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source
6 * Datasheet: http://www.national.com/ds/LM/LM3556.pdf
10 Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com)
14 There are 3 functions in LM3556, Flash, Torch and Indicator.
17 In Flash Mode, the LED current source(LED) provides 16 target current levels
18 from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
19 CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
20 or by pulling the STROBE pin HIGH.
21 LM3556 Flash can be controlled through sys/class/leds/flash/brightness file
22 * if STROBE pin is enabled, below example control brightness only, and
23 ON / OFF will be controlled by STROBE pin.
26 OFF : #echo 0 > sys/class/leds/flash/brightness
27 93.75 mA: #echo 1 > sys/class/leds/flash/brightness
29 1500 mA: #echo 16 > sys/class/leds/flash/brightness
32 In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
33 REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
35 LM3556 torch can be controlled through sys/class/leds/torch/brightness file.
36 * if TORCH pin is enabled, below example control brightness only,
37 and ON / OFF will be controlled by TORCH pin.
40 OFF : #echo 0 > sys/class/leds/torch/brightness
41 46.88 mA: #echo 1 > sys/class/leds/torch/brightness
43 375 mA : #echo 8 > sys/class/leds/torch/brightness
46 Indicator pattern can be set through sys/class/leds/indicator/pattern file,
47 and 4 patterns are pre-defined in indicator_pattern array.
48 According to N-lank, Pulse time and N Period values, different pattern wiill
49 be generated.If you want new patterns for your own device, change
50 indicator_pattern array with your own values and INDIC_PATTERN_SIZE.
51 Please refer datasheet for more detail about N-Blank, Pulse time and N Period.
53 Indicator pattern example:
54 pattern 0: #echo 0 > sys/class/leds/indicator/pattern
56 pattern 3: #echo 3 > sys/class/leds/indicator/pattern
58 Indicator brightness can be controlled through
59 sys/class/leds/indicator/brightness file.
62 OFF : #echo 0 > sys/class/leds/indicator/brightness
63 5.86 mA : #echo 1 > sys/class/leds/indicator/brightness
65 46.875mA : #echo 8 > sys/class/leds/indicator/brightness
69 Driver expects it is registered using the i2c_board_info mechanism.
70 To register the chip at address 0x63 on specific adapter, set the platform data
71 according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
74 static struct i2c_board_info board_i2c_ch4[] __initdata = {
76 I2C_BOARD_INFO(LM3556_NAME, 0x63),
77 .platform_data = &lm3556_pdata,
81 and register it in the platform init function
84 board_register_i2c_bus(4, 400,
85 board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));