xref: /linux/Documentation/driver-api/backlight/lp855x-driver.rst (revision 0898782247ae533d1f4e47a06bc5d4870931b284)
1*56198359SMauro Carvalho Chehab====================
2*56198359SMauro Carvalho ChehabKernel driver lp855x
3*56198359SMauro Carvalho Chehab====================
4*56198359SMauro Carvalho Chehab
5*56198359SMauro Carvalho ChehabBacklight driver for LP855x ICs
6*56198359SMauro Carvalho Chehab
7*56198359SMauro Carvalho ChehabSupported chips:
8*56198359SMauro Carvalho Chehab
9*56198359SMauro Carvalho Chehab	Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
10*56198359SMauro Carvalho Chehab	LP8557
11*56198359SMauro Carvalho Chehab
12*56198359SMauro Carvalho ChehabAuthor: Milo(Woogyom) Kim <milo.kim@ti.com>
13*56198359SMauro Carvalho Chehab
14*56198359SMauro Carvalho ChehabDescription
15*56198359SMauro Carvalho Chehab-----------
16*56198359SMauro Carvalho Chehab
17*56198359SMauro Carvalho Chehab* Brightness control
18*56198359SMauro Carvalho Chehab
19*56198359SMauro Carvalho Chehab  Brightness can be controlled by the pwm input or the i2c command.
20*56198359SMauro Carvalho Chehab  The lp855x driver supports both cases.
21*56198359SMauro Carvalho Chehab
22*56198359SMauro Carvalho Chehab* Device attributes
23*56198359SMauro Carvalho Chehab
24*56198359SMauro Carvalho Chehab  1) bl_ctl_mode
25*56198359SMauro Carvalho Chehab
26*56198359SMauro Carvalho Chehab  Backlight control mode.
27*56198359SMauro Carvalho Chehab
28*56198359SMauro Carvalho Chehab  Value: pwm based or register based
29*56198359SMauro Carvalho Chehab
30*56198359SMauro Carvalho Chehab  2) chip_id
31*56198359SMauro Carvalho Chehab
32*56198359SMauro Carvalho Chehab  The lp855x chip id.
33*56198359SMauro Carvalho Chehab
34*56198359SMauro Carvalho Chehab  Value: lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557
35*56198359SMauro Carvalho Chehab
36*56198359SMauro Carvalho ChehabPlatform data for lp855x
37*56198359SMauro Carvalho Chehab------------------------
38*56198359SMauro Carvalho Chehab
39*56198359SMauro Carvalho ChehabFor supporting platform specific data, the lp855x platform data can be used.
40*56198359SMauro Carvalho Chehab
41*56198359SMauro Carvalho Chehab* name:
42*56198359SMauro Carvalho Chehab	Backlight driver name. If it is not defined, default name is set.
43*56198359SMauro Carvalho Chehab* device_control:
44*56198359SMauro Carvalho Chehab	Value of DEVICE CONTROL register.
45*56198359SMauro Carvalho Chehab* initial_brightness:
46*56198359SMauro Carvalho Chehab	Initial value of backlight brightness.
47*56198359SMauro Carvalho Chehab* period_ns:
48*56198359SMauro Carvalho Chehab	Platform specific PWM period value. unit is nano.
49*56198359SMauro Carvalho Chehab	Only valid when brightness is pwm input mode.
50*56198359SMauro Carvalho Chehab* size_program:
51*56198359SMauro Carvalho Chehab	Total size of lp855x_rom_data.
52*56198359SMauro Carvalho Chehab* rom_data:
53*56198359SMauro Carvalho Chehab	List of new eeprom/eprom registers.
54*56198359SMauro Carvalho Chehab
55*56198359SMauro Carvalho ChehabExamples
56*56198359SMauro Carvalho Chehab========
57*56198359SMauro Carvalho Chehab
58*56198359SMauro Carvalho Chehab1) lp8552 platform data: i2c register mode with new eeprom data::
59*56198359SMauro Carvalho Chehab
60*56198359SMauro Carvalho Chehab    #define EEPROM_A5_ADDR	0xA5
61*56198359SMauro Carvalho Chehab    #define EEPROM_A5_VAL	0x4f	/* EN_VSYNC=0 */
62*56198359SMauro Carvalho Chehab
63*56198359SMauro Carvalho Chehab    static struct lp855x_rom_data lp8552_eeprom_arr[] = {
64*56198359SMauro Carvalho Chehab	{EEPROM_A5_ADDR, EEPROM_A5_VAL},
65*56198359SMauro Carvalho Chehab    };
66*56198359SMauro Carvalho Chehab
67*56198359SMauro Carvalho Chehab    static struct lp855x_platform_data lp8552_pdata = {
68*56198359SMauro Carvalho Chehab	.name = "lcd-bl",
69*56198359SMauro Carvalho Chehab	.device_control = I2C_CONFIG(LP8552),
70*56198359SMauro Carvalho Chehab	.initial_brightness = INITIAL_BRT,
71*56198359SMauro Carvalho Chehab	.size_program = ARRAY_SIZE(lp8552_eeprom_arr),
72*56198359SMauro Carvalho Chehab	.rom_data = lp8552_eeprom_arr,
73*56198359SMauro Carvalho Chehab    };
74*56198359SMauro Carvalho Chehab
75*56198359SMauro Carvalho Chehab2) lp8556 platform data: pwm input mode with default rom data::
76*56198359SMauro Carvalho Chehab
77*56198359SMauro Carvalho Chehab    static struct lp855x_platform_data lp8556_pdata = {
78*56198359SMauro Carvalho Chehab	.device_control = PWM_CONFIG(LP8556),
79*56198359SMauro Carvalho Chehab	.initial_brightness = INITIAL_BRT,
80*56198359SMauro Carvalho Chehab	.period_ns = 1000000,
81*56198359SMauro Carvalho Chehab    };
82