xref: /OK3568_Linux_fs/kernel/Documentation/leds/leds-lp3944.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun====================
2*4882a593SmuzhiyunKernel driver lp3944
3*4882a593Smuzhiyun====================
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun  * National Semiconductor LP3944 Fun-light Chip
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun    Prefix: 'lp3944'
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun    Addresses scanned: None (see the Notes section below)
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun    Datasheet:
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun	Publicly available at the National Semiconductor website
14*4882a593Smuzhiyun	http://www.national.com/pf/LP/LP3944.html
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunAuthors:
17*4882a593Smuzhiyun	Antonio Ospite <ospite@studenti.unina.it>
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunDescription
21*4882a593Smuzhiyun-----------
22*4882a593SmuzhiyunThe LP3944 is a helper chip that can drive up to 8 leds, with two programmable
23*4882a593SmuzhiyunDIM modes; it could even be used as a gpio expander but this driver assumes it
24*4882a593Smuzhiyunis used as a led controller.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunThe DIM modes are used to set _blink_ patterns for leds, the pattern is
27*4882a593Smuzhiyunspecified supplying two parameters:
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun  - period:
30*4882a593Smuzhiyun	from 0s to 1.6s
31*4882a593Smuzhiyun  - duty cycle:
32*4882a593Smuzhiyun	percentage of the period the led is on, from 0 to 100
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunSetting a led in DIM0 or DIM1 mode makes it blink according to the pattern.
35*4882a593SmuzhiyunSee the datasheet for details.
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunLP3944 can be found on Motorola A910 smartphone, where it drives the rgb
38*4882a593Smuzhiyunleds, the camera flash light and the lcds power.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunNotes
42*4882a593Smuzhiyun-----
43*4882a593SmuzhiyunThe chip is used mainly in embedded contexts, so this driver expects it is
44*4882a593Smuzhiyunregistered using the i2c_board_info mechanism.
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunTo register the chip at address 0x60 on adapter 0, set the platform data
47*4882a593Smuzhiyunaccording to include/linux/leds-lp3944.h, set the i2c board info::
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun	static struct i2c_board_info a910_i2c_board_info[] __initdata = {
50*4882a593Smuzhiyun		{
51*4882a593Smuzhiyun			I2C_BOARD_INFO("lp3944", 0x60),
52*4882a593Smuzhiyun			.platform_data = &a910_lp3944_leds,
53*4882a593Smuzhiyun		},
54*4882a593Smuzhiyun	};
55*4882a593Smuzhiyun
56*4882a593Smuzhiyunand register it in the platform init function::
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun	i2c_register_board_info(0, a910_i2c_board_info,
59*4882a593Smuzhiyun			ARRAY_SIZE(a910_i2c_board_info));
60